API – Order

General Online Reference

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help

CreateOrder [POST]

The CreateOrder operation creates a new order in the shop.Input

The operation takes the following input:

  • an authentication key
  • an order

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid
  • the order header must be valid, ie.:
    • the customer cannot be null
    • the currency cannot be null
    • the site cannot be null
    • the payment method cannot be null
    • the payment method must be valid for the chosen country
    • the payment method must be valid for the chosen B2B group (if any)
    • the shipping method cannot be null
    • the shipping method must be valid for the chosen country
    • the shipping method must be valid for the chosen B2B group (if any)
  • the order must contain at least one order line
  • each order line must be valid, ie.:
    • the product cannot be null
    • the product must be valid (ie. exist for the site and not be hidden/deactivated)
    • the quantity cannot be null – and must be positive

The order CREATE permission is required to perform this operation.

Output

When successful the operation returns an order.

The result will contain the unique order number assigned to the new order.

Remarks

The new order will be created without an order state – this has to be set manually via the shop administration site. It will be treated as incomplete by the shop (see the CompleteOrder service operation).

The order line quantity is not validated against minimum (or maximum) buy amounts.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/CreateOrder

Code examples

C# (Console)

 

 

PHP



GetOrders [GET]

The GetOrders operation retrieves a list of orders from the shop created within a certain date interval.

Input
The operation takes the following input:
  • an authentication key
  • a date interval, specified with a start date and an end date
Validation
The following validation will determine whether the operation succeeds:
  • the authentication key must be valid
  • the start date cannot be null

The order READ permission is required to perform this operation.

Output
When successful the operation returns a list of orders.
All orders are retrieved – regardless of status. Only orders created within the specified date interval are returned.
Request and response format.

Code examples

C# (Console)


 

PHP


GetOrder [GET]

The GetOrder operation retrieves an order from the shop based on a unique order number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an order number (id) for the order

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order number cannot be null

The order READ permission is required to perform this operation.

Output

When successful the operation returns an order.

Request and response format

Code examples

C# (Console)

PHP



DeleteOrder [DELETE]

The DeleteOrder operation deletes an order from the shop based on a unique order number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an order number (id) for the order

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order number cannot be null

The order DELETE permission is required to perform this operation.

Output

When successful the operation returns true. If the order was not found it returns false instead.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/DeleteOrder

Code examples

C# (Console)

PHP



CompleteOrder [PUT]

The CompleteOrder operation completes an order in the shop based on a unique order number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an order number (id) for the order

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order number cannot be null

The order UPDATE permission is required to perform this operation.

Output

When successful the operation returns true.  If the order was not found (or no order number was specified) it returns false instead.

Remarks

Marking orders as complete should be used to indicate whether orders are ready for processing, eg. that payment has been confirmed.

Request and response format
http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/CompleteOrder

Code examples

C# (Console)

PHP



GetOrdersByCustomerNumber [GET]

The GetOrdersByCustomerNumber operation retrieves a list of orders from the shop created by a customer with a certain customer number.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a string, specifying the customer number

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the customer number cannot be null

The order READ permission is required to perform this operation.

Output

When successful the operation returns a list of orders.

All orders are retrieved – regardless of status. Only orders created by a customer with the given customer number are returned.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/GetOrdersByCustomerNumber

GetOrdersInModifiedInterval [GET]

The GetOrders operation retrieves a list of orders from the shop created within a certain date interval that have been modified.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • a date interval, specified with a start date and an end date

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the start date cannot be null

The order READ permission is required to perform this operation.

Output

When successful the operation returns a list of orders.

All orders are retrieved. Only orders created within the specified date interval that have been modified are returned.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/GetOrdersInModifiedInterval



GetOrderStates [GET]

The GetOrderStates operation retrieves a list of all order states from the shop.

Input

The operation takes the following input:

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)

The order READ permission is required to perform this operation.

Output

When successful the operation returns a list of order states.

All order states are retrieved.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/GetOrderStates


SetOrderComment [PUT]

The SetOrderComment operation sets the comment on an existing order by the order id.
The operation returns a bool true for success.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an integer specifying the order id
  • a string containing the wanted comment

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order id cannot be null

The order UPDATE permission is required to perform this operation.

Output

When successful the operation returns a boolean of true.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/SetOrderComment


SetOrderState [PUT]

The SetOrderState operation sets the state of an existing order by the order id.
The operation returns a bool true for success.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an integer specifying the order id
  • an integer specifying the order state id

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order id cannot be null
  • the order state id cannot be null

The order UPDATE permission is required to perform this operation.

Output

When successful the operation returns a boolean of true.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/SetOrderState


SetTrackNumber [PUT]

The SetTrackNumber operation sets the track number on an existing order by the order id.
The operation returns a bool true for success.

Input

The operation takes the following input:

  • an authentication key (see Authentication for details)
  • an integer specifying the order id
  • a string specifying the track number

Validation

The following validation will determine whether the operation succeeds:

  • the authentication key must be valid (see Authentication for details)
  • the order id cannot be null

The order UPDATE permission is required to perform this operation.

Output

When successful the operation returns a boolean of true.

Request and response format

http://4221117.shop53.dandomain.dk/admin/webapi/endpoints/v1_0/OrderService/help/operations/SetTrackNumber


 


Du finder dokumentationen til DanDomain Webshop her: https://webshop-help.dandomain.dk x