Skip to content

Orders

GET /orders/delta

Return the Orders created or modified completed since start_date from all channels.

Orders will be ordered by (start_date, id) fields.

Required scopes: orders

GET Params

param type/format required sample value description
start_date YYYY-MM-DDTHH:mm:ss.sssZ false 2018-01-25T15:00:56.643Z Simplified extended ISO format (ISO 8601). The timezone is zero UTC offset, as denoted by the suffix "Z".
limit integer false 100 default and max value: 100
page integer false 10 page number. This endpoint's pages start at 0
channel string false backoffice Default: shop. Channels: ipad, shop, ebay, ece, backoffice, atalanda, click_and_collect
order_by string false id,-channel Sort results by given fields. Seprate fields by ,. To sort descending add - before field name: -channel.

VERSIONING

When X-Api-Version < 12, you will get all orders back including the ones inPENDING state.

Order states

The order states are represented by a bitmask.
Defined states:

status value description
DRAFT 1 all is possible with this state
PENDING 2 temporarily frozen, waiting for money
CANCELED 4 end of processing, nothing will happen, no responsibilities
CLOSED 8 frozen, indicator for is_paid, can only be shipped or delivered or refunded
REFUNDED 16 end of processing, has been returned
SHIPPED 32 frozen, can only be delivered or refunded
DELIVERED 64 frozen, can only be refunded. end of processing after return time.
TEST_PRINT 128 -
PAID 256 -
READ 512 -

Example

"Completed" orders have a state value of 360 which includes following states: PAID, SHIPPED, DELIVERED, and CLOSED.

Request

curl -X GET \
  https://app.inventorum.com/api/orders/delta/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {{oauth_token}}' \
  -H 'X-Api-Version: 12'

Response

{
    "total": 1,
    "data": [
        {
            "id": 8791312,
            "basket": {
                "note_internal": null,
                "note_external": null,
                "items": [
                    {
                        "id": 17311484,
                        "name": "YAD Smart Wobbler 60mm",
                        "discount": null,
                        "original_quantity": "10.00",
                        "price": "5.8739495798",
                        "product": 2195273,
                        "quantity": 10,
                        "tax_rate": "19.000",
                        "gross_price": "69.90",
                        "unit_gross_price": "6.99",
                        "product_code": "72060235"
                    }
                ],
                "discount": null,
                "receipt": {
                    "pdf": "http://app.inventorum.com/uploads/invoices/11/Inventorum-Workshop_-630.pdf",
                    "image_width": 576,
                    "image_height": 2237,
                    "image": "http://app.inventorum.com/uploads/invoices/1/Inventorum-Workshop_-630.png"
                },
                "invoice_number": "630"
            },
            "state": 360,
            "customer": null,
            "amount_paid": "138.6000000000",
            "payments": [
                {
                    "id": 8210484,
                    "payment_method": "0",
                    "payment_amount": "138.6000000000",
                    "date": "2017-12-12T14:49:26+00:00",
                    "transaction_id": null,
                    "transaction_duration": null,
                    "paypal_invoice_id": null,
                    "paypal_tab_id": null,
                    "external_payment_method": null
                }
            ],
            "shipment": null,
            "channel": "ipad",
            "time_added": "2017-12-12T14:49:22+00:00",
            "completed_at": "2017-12-12T14:49:22+00:00",
            "delta_state": "created",
            "user_id": 1959,
            "available_refund_types": [
                "0",
                "6",
                "1",
                "3",
                "2"
            ]
        }
    ]
}

GET /orders

Returns orders created between start and end dates excluding oders with DRAFT status (see status table).
By default (without channel query param it returns all orders excluding iPad channel).
Orders are ordered by completed_at and time_added

Required scopes: orders

GET Params

param type/format required sample value description
start YYYY.MM.DD hh:mm:ss true 2018.08.16 16:21:00
end YYYY.MM.DD hh:mm:ss true 2018.08.16 18:21:00
limit integer false 10 default and maximum value: 40
page integer false 1 page number. This endpoint's pages start at 1
channel string false ipad Channel options: ipad, shop, ebay, ece, click_and_collect, atalanda
search string false adidas space separated, case-insensitive search queries. supported fields: product_code, basket item name, invoice_number, customer names, company name

Request

curl -X GET \
  'https://app.inventorum.com/api/orders/?start=2018.08.16%2016:21:00&end=2018.08.16%2016:21:00' \
  -H 'Authorization: Bearer {{oauth_token}}' \
  -H 'X-Api-Version: 10'

response

{
    "total": 23,
    "data": [
        {
            "id": 5011967,
            "basket": {
                "note_internal": null,
                "note_external": null,
                "items": [
                    {
                        "id": 9906372,
                        "name": "00001 Club Mate",
                        "discount": null,
                        "original_quantity": "1.00",
                        "price": "4.2016806723",
                        "product": 5977221,
                        "quantity": 1,
                        "tax_rate": "19.000",
                        "gross_price": "5.00",
                        "unit_gross_price": "5.00",
                        "product_code": null
                    }
                ],
                "discount": null,
                "receipt": null,
                "invoice_number": ""
            },
            "state": 2,
            "customer": {
                "id": 408367,
                "channel": 4,
                "email": "paulschmidt@inventorum.com",
                "title": "Mr.",
                "first_name": "Paul",
                "middle_name": null,
                "last_name": "Schmidt",
                "billing_address": {
                    "country": "DE",
                    "id": 471652,
                    "address1": "Danziger Str 100b",
                    "address2": "",
                    "zipcode": "10405",
                    "city": "Berlin",
                    "state": null,
                    "first_name": "Paul",
                    "last_name": "Schmidt",
                    "company": null,
                    "title": null
                },
                "shipping_address": [
                    {
                        "country": "DE",
                        "id": 471653,
                        "address1": "Danziger Str 100b",
                        "address2": "",
                        "zipcode": "10405",
                        "city": "Berlin",
                        "state": null,
                        "first_name": "Paul",
                        "last_name": "Schmidt",
                        "company": "",
                        "title": ""
                    }
                ]
            },
            "amount_paid": "5.0000000000",
            "payments": [
                {
                    "id": 4573521,
                    "payment_method": "6",
                    "payment_amount": "5.0000000000",
                    "date": "2017-01-25T12:19:21+00:00",
                    "transaction_id": null,
                    "transaction_duration": null,
                    "paypal_invoice_id": null,
                    "paypal_tab_id": null,
                    "external_payment_method": null
                }
            ],
            "shipment": {
                "id": 9169,
                "name": "Abholung",
                "tracking_number": null,
                "cost": "0E-10",
                "external_key": null,
                "service": {
                    "id": 22099,
                    "name": "Abholung",
                    "time_max": 0,
                    "time_min": 0
                }
            },
            "channel": "shop",
            "time_added": "2017-01-25T12:15:08+00:00",
            "completed_at": "2017-01-25T12:19:37+00:00"
        }
    ]
}

POST /basket

Creates a basket [checkout]

The basket created has a pending status, it still need to be paid to be closed.

Required scopes: checkout

Payload

name type/format required sample value description
items array of BasketItems true at least must have one item
note_internal string false
note_external string false This note will appear on the invoice
customer integer false 494 Id of existing customer belongs to this account
discount object of Discount false Basket discount

BasketItem

name type/format required sample value description
price float true 15.99 The net price of the product. If the product has custom_sale = true, this field will override original price. In case it's false, the price in the basket will be taken from the product anyway, but you still need to pass it in the body.
quantity integer true 1 Minimum value 1
product integer true 7890302 ID of existing product
name string false
discount object of Discount false Item item discount

Discount

name type/format required sample value description
amount float true 0.5
reason integer true 0
type string false "percent" possible values "percent" and "cash", if cash: the given value is deducted from the gross price, if percent: the value 1 = 100% discount.

Required headers: Content-Type: application/json

Request

curl -X POST \
  https://app.inventorum.com/api/basket/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Token {{oauth_token}}' \
  -H 'Content-Type: application/json' \
  -H 'X-Api-Version: 8' \
  -d '{
        "items": [
                  {
                    "price": 99, 
                    "product": 7890302,
                    "quantity": 1,
                    "discount": {
                      "type":"percent",
                      "amount": 0.5,
                      "reason": 0
                    }
                  }
                ],
        "customer": 494,
        "note_internal": "internal note",
        "note_external": "external note",
        "discount": {
          "type":"cash",
          "amount": 0.5,
          "reason": 0
        }
  }'

Response

{
  "id": 19663267, // This is the order id you need to track this order
  "user": 523,
  "customer": 494,
  "basket": 19664038,
  "state": "01",
  "completed_at": "2020-02-18T15:48:38.038+01:00",
  "channel": 1,
  "shipment": null,
  "description": null
}

Error

Status 400 Bad Request
{
    "error": {
        "fields": {
            "items": [
                "This field is required."
            ]
        },
        "description": "Serialization error",
        "key": "common.serializer_error"
    }
}