Create or Modify Order¶
An order is merchant’s intention that Logitrail should ship certain products to a recipient (customer).
The easiest way to submit orders to Logitrail is via Checkout Integration but orders can be submitted also via API calls.
Order JSON Object¶
While creating an order or modifying an existing order, the following JSON object structure is used.
|
If a string, merchant’s order ID. Can be also JSON hash of ID + time:
|
|
Customer (recipient) details. See section “Customer Details” below. |
|
Product details in the order. See section “Product Details” below. |
|
Destination, where the order should be actually shipped. See “Destinations” below. |
|
Earliest date when the shipment should arrive at the customer. |
|
Latest date when the shipment should arrive at the customer. |
|
Array of tags to set to the order. |
|
Language of the order ( |
|
Apply the specified pricelist for the order. See Shipping Fee Rules |
|
Currency code (default EUR) |
Customer Details¶
Customer details are used in multiple phases of the order fulfillment process:
Logitrail sends the delivery notification for the customer via e-mail and SMS
Customer’s name and details are printed on the package slip
Arrival notification is sent via e-mail, SMS and/or as a letter
Customer’s preferred pickup points are saved and suggested in later checkouts
|
Customer’s last (family) name. |
|
Customer’s first name |
|
Organization name (for business customers) |
|
Address line (street address) |
|
Postal code |
|
City |
|
2-letter country code of the address. Defaults to |
|
Customer’s email address. |
|
Customer’s phone number in international format. |
|
Customer’s EORI Number. |
|
Customer’s VAT ID |
(*) = Required field.
Product Details¶
Each product in the order should be provided in an array of objects in
products or products_all properties.
|
Quantity of the product items ordered. (required) |
|
Merchant’s ID of the product. (required) |
|
Unit price of the order item. Note: Price is not updated to the product profile, it must be given in each order item separately. |
|
Tax percentage. Note: not updated to the product profile. |
|
Name of the product. (required if not existing product) |
|
EAN (GTIN) barcode of the product. |
|
Possible values are |
|
Best before date restriction for the products that should be sent to the customer. See Handling Best Before Dates. |
|
Weight of the product (in grams) |
|
Dimensions of the product (in millimeters), given as a string
|
|
10-digit TARIC Code of the product. See https://en.wikipedia.org/wiki/TARIC_code |
|
Manufacturing Country of the product. See https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 |
|
Free text information about the line item. |
Note that given properties are used to update the product database. You may skip name and gtin
properties if you are sure that a product with merchants_id already exists in the database. See
products for details.
currency, unit_price and tax_percent are persisted only each order item and NOT updated to the product database.
Destinations¶
The destination of the order should be described in destination parameter.
<24-digit-hex> |
The pickup point ID where the customer picks the shipment up. See Pickup Points for details. |
|
The shipment should be sent to the customer’s address as a letter. |
|
The shipment should be sent to the customer’s address as a parcel/courier delivery. |
Create Order¶
Endpoint |
|
Method |
POST |
This endpoint is used to create a new order. A new order is always created
to passive status and should be confirmed with a separate call.
Request Parameters¶
The request body should contain a JSON object describing the order. See section “Order JSON Object” above.
Response¶
Status: HTTP 201 Created
JSON object with following parameters.
|
|
|
Logitrail’s ID for the order (24-digit hex) |
Update Order¶
Endpoint |
|
Method |
POST |
This endpoint is used to update an existing order details.
Request Parameters¶
URL placeholder {id} should be replaced with the Logitrail’s ID of the order.
The request body should contain a JSON object describing the order. See section “Order JSON Object” above.
Response¶
Status: HTTP 200 OK
JSON object with following parameters.
|
|
|
Logitrail’s ID for the order (24-digit hex) |
Confirm Order¶
A created order must be confirmed with a separate API call. See Confirm Order.
Error Responses¶
See Error Handling for generic documentation regarding error responses.
code values¶
Code |
HTTP Code |
Reason + how to fix |
|
The order is requested to be confirmed ( |
|
|
400 |
|
|
400 |
At least one product item contains |
|
400 |
At least one product item contains |