OrderDocument

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 orderdocuments

URL : /:organizationid/:wsmid/api/v1/orderdocument/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) type=[string] returns items of the document type.

?> Possible document types are: Invoice, PackingSlip, Unknown, ProformaInvoice, Confirmation, Offer, Custom, CreditMemo

(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.

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": 4,
  "items": [
    {
      "header": {
        "comment": "",
        "contact": "",
        "currency": "DKK",
        "customer": "12345678",
        "deliveryAddress": "",
        "deliveryAddress2": "",
        "deliveryCity": "",
        "deliveryCountry": "",
        "deliveryEmail": "",
        "deliveryMethod": "",
        "deliveryName": "",
        "deliveryRegion": "",
        "deliveryZipCode": "",
        "discountAmount": 0.0,
        "discountGroup": "",
        "documentDate": "2021-09-20T00:00:00",
        "documentId": "",
        "documentType": "Invoice",
        "dutyAmountTaxable": 0.0,
        "dutyAmountTaxfree": 0.0,
        "extraFields": {
          "dynamicfield-1": "value1",
          "dynamicfield-2": "value2",
          "dynamicfield-2": 0
        },
        "feeAmountTaxable": 0.0,
        "feeAmountTaxfree": 0.0,
        "group": "",
        "id": "12345678",
        "invoiceAddress": "",
        "invoiceAddress2": "",
        "invoiceCity": "",
        "invoiceCountry": "",
        "invoiceCustomer": "12345678",
        "invoiceEmail": "",
        "invoiceName": "",
        "invoicePhone": "",
        "invoiceRegion": "",
        "invoiceZipCode": "",
        "orderDate": "2021-12-01T00:00:00",
        "ourReference": "CQP",
        "paymentMethod": "",
        "priceGroup": "1",
        "relatedOrder": "",
        "salesRep": "CQP",
        "shippingDate": "2021-12-01T00:00:00",
        "status": "Archived",
        "totalPrice": 1000.0,
        "type": "Order",
        "vatAmount": 0.0
      },
      "id": "12345678",
      "lines": [
        {
          "discountPercentage": 0.0,
          "extraFields": {
            "dynamicfield-1": "value1",
            "dynamicfield-2": "value2",
            "dynamicfield-2": 0
          },
          "lineNumber": 10000,
          "orderId": "12345678",
          "product": "12345678",
          "quantityDelivered": 1.0,
          "quantityInvoiced": 1.0,
          "quantityOrdered": 1.0,
          "quantityToDeliver": 1.0,
          "text": "",
          "totalPrice": 1000.0,
          "unit": "STK",
          "unitPrice": 1000.0,
          "variant": ""
        }
      ],
      "offsetId": "1",
      "postingDate": "2021-12-01T00:00:00",
      "type": "Invoice"
    }
  ]
}

Error Responses

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

Get orderdocument

URL : /:organizationid/:wsmid/api/v1/orderdocument/:orderid/:documentid

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": [
    {
      "header": {
        "comment": "",
        "contact": "",
        "currency": "DKK",
        "customer": "12345678",
        "deliveryAddress": "",
        "deliveryAddress2": "",
        "deliveryCity": "",
        "deliveryCountry": "",
        "deliveryEmail": "",
        "deliveryMethod": "",
        "deliveryName": "",
        "deliveryRegion": "",
        "deliveryZipCode": "",
        "discountAmount": 0.0,
        "discountGroup": "",
        "documentDate": "2021-09-20T00:00:00",
        "documentId": "",
        "documentType": "Invoice",
        "dutyAmountTaxable": 0.0,
        "dutyAmountTaxfree": 0.0,
        "extraFields": {
          "dynamicfield-1": "value1",
          "dynamicfield-2": "value2",
          "dynamicfield-2": 0
        },
        "feeAmountTaxable": 0.0,
        "feeAmountTaxfree": 0.0,
        "group": "",
        "id": "12345678",
        "invoiceAddress": "",
        "invoiceAddress2": "",
        "invoiceCity": "",
        "invoiceCountry": "",
        "invoiceCustomer": "12345678",
        "invoiceEmail": "",
        "invoiceName": "",
        "invoicePhone": "",
        "invoiceRegion": "",
        "invoiceZipCode": "",
        "orderDate": "2021-12-01T00:00:00",
        "ourReference": "CQP",
        "paymentMethod": "",
        "priceGroup": "1",
        "relatedOrder": "",
        "salesRep": "CQP",
        "shippingDate": "2021-12-01T00:00:00",
        "status": "Archived",
        "totalPrice": 1000.0,
        "type": "Order",
        "vatAmount": 0.0
      },
      "id": "12345678",
      "lines": [
        {
          "discountPercentage": 0.0,
          "extraFields": {
            "dynamicfield-1": "value1",
            "dynamicfield-2": "value2",
            "dynamicfield-2": 0
          },
          "lineNumber": 10000,
          "orderId": "12345678",
          "product": "12345678",
          "quantityDelivered": 1.0,
          "quantityInvoiced": 1.0,
          "quantityOrdered": 1.0,
          "quantityToDeliver": 1.0,
          "text": "",
          "totalPrice": 1000.0,
          "unit": "STK",
          "unitPrice": 1000.0,
          "variant": ""
        }
      ],
      "offsetId": "1",
      "postingDate": "2021-12-01T00:00:00",
      "type": "Invoice"
    }
  ]
}

Error Responses

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

Condition: Order ID and Document ID missing. Code: 404 NOT FOUND

Last updated

Logo

Copyright Chainbox 2008-2023