Skip to main content
All CollectionsIntegrationsAPI
Create order(s) using the API
Create order(s) using the API
Andreas Viklund avatar
Written by Andreas Viklund
Updated over 2 years ago

In the developer's guide, you will find all the fields, both required and recommended, for creating an order in Gordon. It's possible to create orders in two ways, either individually or in bulk.

Create one order

The value in 'external_ref' needs to be unique for each new order. Posting data with the same external_ref will update an existing order.

POST /api/orders

{
"external_ref" : "A1",
"customer-name" : "Andreas Viklund",
"email" : "andreas.viklund@gordondelivery.com",
"mobile" : "+46 70 228 68 10"
"address" : "Segeltorpsvägen 42"
"zip" : "12553"
"city" : "Älvsjö",
"description" : "",
"notes" : "Knock please",
"deliverygroup" : "Gordon Store",
"deliverydate" : "2023-02-25",
"time-window" : "14:00 - 16:00",
"inventory" : [
{
"quantity" : 1,
"name" : "En låda mat"
}
]
}


Responses

{
"external_ref" : ”A1",
"tracking_id" : "0Zj7YGCUr",
"status" : "OK",
"deliverygroup" : "gordon stockholm"
}

{
"status" : "error",
"message" : "Unable to find deliverygroup,
"external_ref" : "A1"
}

{
"status" : "error",
"message" : "Missing required fields: address, zip, city"
}

Create multiple orders

In order to upload several orders in the same request, you need to update the endpoint. Orders are then added to an array. There's no limit to how many orders you can create with one request.

POST /api/orders/bulk

[
{
"external_ref" : "A1",
"customer-name" : "Andreas Viklund",
"email" : "andreas.viklund@gordondelivery.com",
"mobile" : "+46 70 228 68 10"
"address" : "Segeltorpsvägen 42"
"zip" : "12553"
"city" : "Älvsjö",
"description" : "",
"notes" : "Knock please",
"deliverygroup" : "Gordon Store",
"deliverydate" : "2023-02-25",
"time-window" : "14:00 - 16:00",
"inventory" : [
{
"quantity" : 1,
"name" : "En låda mat"
}
]
},
{ ...
}
]

Responses

{
"external_ref" : ”A1",
"status" : "OK",
"deliverygroup" : "gordon stockholm"
}

{
"status" : "error"
"message" : "Unable to find deliverygroup",
"external_ref" : "A1"
}

{
"status" : "error",
"message" : "Missing required fields: address, zip, city"
}
Did this answer your question?