Get Orders
GET REST API request that returns a list of orders linked to a supplier. The response example is shown below.
The parameter orderId
will try to find an order by orderId and return it in the response list. This parameter is optional.
The parameter orderStatus
will filter orders by order status. Possible values for this filter are: CREATED, PENDING, CANCELLED, PARTIALLY_CONFIRMED and CONFIRMED. This parameter is optional.
The parameters createdDateFrom
and createdDateTo
will filter orders by the date the order was created. The dates are in in yyyy-MM-dd'T'HH:mm:ss.SSSXXX format (e.g., 2024-11-15T00:00:00). Both parameters are optional. Filter createdDateTo
can not be after createdDateFrom
.
The other two parameters are page
and size
, which are used for pagination. If not passed, by default, only 10 orders will be listed. However, by setting the size to higher values, the list can be increased. The maximum number of orders per page is 500.
Request
HTTP Method | GET |
URL | Stage | https://api.stage.ananastest.com/ws-inventory/api/v1/supplier-integration/orders |
Production | https://api.ananas.rs/ws-inventory/api/v1/supplier-integration/orders |
HTTP Headers | | Header name | Header value | Authorization | Bearer {access_token} |
|
URL Parameters | | Parameter name | Parameter description | orderId | Find order by orderId and return it in the response list | orderStatus | Filter orders by order status (CREATED, PENDING, CANCELLED, PARTIALLY_CONFIRMED or CONFIRMED) | createdDateFrom | Order created date from filter in yyyy-MM-dd'T'HH:mm:ss.SSSXXX format (e.g., 2024-11-15T00:00:00Z) | createdDateTo | Order created date to filter in yyyy-MM-dd'T'HH:mm:ss.SSSXXX format (e.g., 2024-11-16T00:00:00Z) | page | Pagination - page number | size | Pagination - number of orders per page (max 500) |
|
Response
Response is a collection of order details.
The API method defaults sorting by created date of order in descending order.
Field Name | Type | Description |
content | List<OrderDetails> | List of orders with details |
pageable | Pageable | Details of pagination |
totalPages | int | Number of total pages |
totalElements | long | Total amount of elements |
last | boolean | Indicates if it's the last page |
size | Integer | Size |
number | int | Number of items on that page |
sort | Sort | Details about sorting |
numberOfElements | long | Number of elements |
first | boolean | First |
empty | boolean | Empty |
Pageable
Field Name | Type | Description |
sort | Sort | Details about sorting |
offset | Long | Offset |
pageSize | int | Page size |
pageNumber | int | Page number |
paged | boolean | Paged |
unpaged | boolean | Unpaged |
Sort:
Field Name | Type | Description |
empty | boolean | Empty |
unsorted | boolean | Unsorted |
sorted | boolean | Sorted |
OrderDetails
Field Name | Type | Description |
orderId | String | Unique order identifier |
createdDate | LocalDateTime | Date and time of creation in UTC |
totalPurchasePrice | BigDecimal | Total purchase price of an order |
totalOrderedQuantity | Integer | Total ordered quantity of items of an order |
status | String | Order status. Possible values:- CREATED
- PENDING
- CANCELLED
- PARTIALLY_CONFIRMED
- CONFIRMED
|
items | List<ItemDetails> | List of items |
ItemDetails
Field Name | Type | Description |
productId | Long | Unique item identifier - id of product |
productEan | String | European Article Number |
productSku | String | Stock Keeping Unit of product |
productName | String | Product name |
productImageUrl | String | Product Image URL |
orderedQuantity | Integer | Ordered quantity of an item |
confirmedQuantity | Integer | Confirmed quantity of an item |
purchasePrice | BigDecimal | Represents price that product was purchased from supplier |
totalPurchasePrice | BigDecimal | Total purchase price of an item |
Example of response:
JSON:
{
"content": [
{
"orderId": "TXHXU-1J251",
"createdDate": "2024-11-18T11:02:54.831961",
"totalPurchasePrice": 0.00,
"totalOrderedQuantity": 2,
"status": "CANCELLED",
"items": [
{
"productId": 197208,
"productEan": "8801643206772",
"productSku": "Azxxcn415",
"productName": "SAMSUNG Usisivač VCC4320S3A/BOL",
"productImageUrl": "https://static.stage.ananastest.com/assets/Product_Images/Vacuums/samsung_vcc4320s3a_bol_usisivac_1_3_l_cilindricni_usisivac_suvo_1600_w_bez_kesa/0a67af06c21ec49d.jpeg",
"orderedQuantity": 2,
"confirmedQuantity": 0,
"purchasePrice": 500.00,
"totalPurchasePrice": 0.00
}
]
}
],
"pageable": {
"sort": [],
"offset": 0,
"pageSize": 10,
"pageNumber": 0,
"paged": true,
"unpaged": false
},
"last": true,
"totalElements": 1,
"totalPages": 1,
"size": 10,
"number": 0,
"sort": [],
"first": true,
"numberOfElements": 1,
"empty": false
}