Order

Best practise

How to successfully harvest data using this endpoint:

  1. Fetch total items by sending a request with limit set to 0.

  2. Page though the results with limit and offset.

Get customer orders

URL : /:organizationid/:wsmid/api/v1/order/customer/:customer

URL Parameters: organizationid=[string] is the ID of the chainbox.io organization.

wsmid=[string] is the APP ID of the WSM application.

customer=[string] is the ID of the customer.

Querystring parameters:

to=[date] returns items with a lastupdated value less than or equal to this date.

(optional) from=[date] returns items with a lastupdated value greater than this date. No default value - not supplying a value will omit this condition.

(optional) limit=[int] number of items returned. Default = 1000.

(optional) offset=[int] number of items to skip. Default = 0.

(optional) keyword=[string] search for part of an ID or lines if applyKeywordToLines is set to true.

(optional) applyKeywordToLines=[boolean] extend search with part of productname on lines.

(optional) orderby=[string] order results by field. One of: orderdate (default), deliverydate

Method: GET

Auth required: YES

Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.

Success Response

Condition: If Organization & WSM app exists and the given credentials are correct.

Code: 200 OK

Content example

{
	"total": 1,
	"items": [
		{
			"head": {
				"id": "12345678",
				"salesRep": "",
				"customer": "12345678",
				"orderDate": "2021-11-03T00:00:00",
				"type": "Order",
				"deliveryDate": "1753-01-01T00:00:00",
				"shippingDate": "1753-01-01T00:00:00",
				"totalPrice": 1000.00,
				"vatAmount": 250.00,
				"currency": "DKK",
				"ourReference": "",
				"yourReference": "",
				"deliveryMethod": "",
				"paymentMethod": "",
				"invoiceName": "",
				"invoiceAddress": "",
				"invoiceAddress2": "",
				"invoiceCity": "",
				"invoiceZipCode": "",
				"invoiceCountry": "",
				"invoicePhone": "",
				"invoiceEmail": "",
				"deliveryName": "",
				"deliveryAddress": "",
				"deliveryAddress2": "",
				"deliveryCity": "",
				"deliveryZipCode": "",
				"deliveryCountry": "",
				"deliveryEmail": "",
				"comment": "",
				"extraFields": {
					"dynamicfield-1": "value1",
          "dynamicfield-2": "value2",
          "dynamicfield-2": 0
				}
			},
			"lines": [
				{
					"lineNumber": 1,
					"totalPrice": 0.0,
					"discountPercentage": 0.0,
					"quantityToDeliver": 0.0,
					"quantityInvoiced": 0.0,
					"unitPrice": 0.0,
					"orderId": "12345678",
					"text": "",
					"product": "",
					"variant": "",
					"unit": "",
					"quantityOrdered": 0.0,
					"quantityDelivered": 0.0,
					"extraFields": {
            "dynamicfield-1": "value1",
            "dynamicfield-2": "value2",
            "dynamicfield-2": 0
					}
				}
			]
		}
	]
}

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Get order

URL : /:organizationid/:wsmid/api/v1/order/:orderid

URL Parameters: organizationid=[string] is the ID of the chainbox.io organization.

wsmid=[string] is the APP ID of the WSM application.

orderid=[string] is the ID of the order.

documentid=[string] is the ID of the document.

Method: GET

Auth required: YES

Permissions required: Basic Auth credentials to the api can be delivered by contacting our support.

Success Response

Condition: If Organization & WSM app exists and the given credentials are correct.

Code: 200 OK

Content example

{
	"total": 1,
	"items": [
		{
			"head": {
				"id": "12345678",
				"salesRep": "",
				"customer": "12345678",
				"orderDate": "2021-11-03T00:00:00",
				"type": "Order",
				"deliveryDate": "1753-01-01T00:00:00",
				"shippingDate": "1753-01-01T00:00:00",
				"totalPrice": 1000.00,
				"vatAmount": 250.00,
				"currency": "DKK",
				"ourReference": "",
				"yourReference": "",
				"deliveryMethod": "",
				"paymentMethod": "",
				"invoiceName": "",
				"invoiceAddress": "",
				"invoiceAddress2": "",
				"invoiceCity": "",
				"invoiceZipCode": "",
				"invoiceCountry": "",
				"invoicePhone": "",
				"invoiceEmail": "",
				"deliveryName": "",
				"deliveryAddress": "",
				"deliveryAddress2": "",
				"deliveryCity": "",
				"deliveryZipCode": "",
				"deliveryCountry": "",
				"deliveryEmail": "",
				"comment": "",
				"extraFields": {
					"dynamicfield-1": "value1",
          "dynamicfield-2": "value2",
          "dynamicfield-2": 0
				}
			},
			"lines": [
				{
					"lineNumber": 1,
					"totalPrice": 0.0,
					"discountPercentage": 0.0,
					"quantityToDeliver": 0.0,
					"quantityInvoiced": 0.0,
					"unitPrice": 0.0,
					"orderId": "12345678",
					"text": "",
					"product": "",
					"variant": "",
					"unit": "",
					"quantityOrdered": 0.0,
					"quantityDelivered": 0.0,
					"extraFields": {
            "dynamicfield-1": "value1",
            "dynamicfield-2": "value2",
            "dynamicfield-2": 0
					}
				}
			]
		}
	]
}

Error Responses

Condition: If basic auth header is not present in request or is incorrect. Code: 401 UNAUTHORIZED

Condition: Order ID missing. Code: 404 NOT FOUND

Last updated

Logo

Copyright Chainbox 2008-2023