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 createdDateTowill 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 MethodGET
URLStagehttps://api.stage.ananastest.com/ws-inventory/api/v1/supplier-integration/orders
Productionhttps://api.ananas.rs/ws-inventory/api/v1/supplier-integration/orders
HTTP Headers
Header nameHeader value
AuthorizationBearer {access_token}
URL Parameters
Parameter nameParameter description
orderIdFind order by orderId and return it in the response list
orderStatusFilter orders by order status (CREATED, PENDING, CANCELLED, PARTIALLY_CONFIRMED or CONFIRMED)
createdDateFromOrder created date from filter in yyyy-MM-dd'T'HH:mm:ss.SSSXXX format (e.g., 2024-11-15T00:00:00Z)
createdDateToOrder created date to filter in yyyy-MM-dd'T'HH:mm:ss.SSSXXX format (e.g., 2024-11-16T00:00:00Z)
pagePagination - page number
sizePagination - 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 NameTypeDescription
contentList<OrderDetails>List of orders with details
pageablePageableDetails of pagination
totalPagesintNumber of total pages
totalElementslongTotal amount of elements
lastbooleanIndicates if it's the last page
sizeIntegerSize
numberintNumber of items on that page
sortSortDetails about sorting
numberOfElementslongNumber of elements
firstbooleanFirst
emptybooleanEmpty

Pageable

Field NameTypeDescription
sortSortDetails about sorting
offsetLongOffset
pageSizeintPage size
pageNumberintPage number
pagedbooleanPaged
unpagedbooleanUnpaged

Sort:

Field NameTypeDescription
emptybooleanEmpty
unsortedbooleanUnsorted
sortedbooleanSorted

OrderDetails

Field NameTypeDescription
orderIdStringUnique order identifier
createdDateLocalDateTimeDate and time of creation in UTC
totalPurchasePriceBigDecimalTotal purchase price of an order
totalOrderedQuantityIntegerTotal ordered quantity of items of an order
statusStringOrder status. Possible values:
  • CREATED
  • PENDING
  • CANCELLED
  • PARTIALLY_CONFIRMED
  • CONFIRMED
itemsList<ItemDetails>List of items

ItemDetails

Field NameTypeDescription
productIdLongUnique item identifier - id of product
productEanStringEuropean Article Number
productSkuStringStock Keeping Unit of product
productNameStringProduct name
productImageUrlStringProduct Image URL
orderedQuantityIntegerOrdered quantity of an item
confirmedQuantityIntegerConfirmed quantity of an item
purchasePriceBigDecimalRepresents price that product was purchased from supplier
totalPurchasePriceBigDecimalTotal purchase price of an item

Example of response:

JSON:

Click to copy
Success!
{
    "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
}
Copyright © Ananas 2023. All right reserved.