Order API reference
Last updatedCreate order#
Endpoint: POST *base*/order
Authentication: API Key
This will insert a new order directly into Centra bypassing any needs of a payment. This API could be used to directly import orders from external systems. The API-plugin needs to have "Allow Order Create" set as true
to allow this call to be made.
Remember that payments for these orders will not be handled at all by Centra. You must make sure the payments are handled and captured elsewhere.
Parameters
Here are the parameters allowed to create an order. There are some fields specific for DTC and Wholesale defined below.
invoiceAddress deliveryAddress address
objectoptionalFor B2B the address object is not required as it will then use default address of the B2B-account. If invoiceAddress
and deliveryAddress
are the same, address
can be used instead.
email
stringrequiredCustomer e-mail
firstName lastName
stringoptionalb2cCustomer name
tele cell
stringoptionalb2cCustomer telephone / cellphone
attn
stringoptionalb2bAttention (addressing memorandum)
address coaddress city zipcode
stringoptionalStreet Address
state
stringoptionalCountry state, might be required by the country
country
stringrequiredISO-Alpha-2 (SE
, US
, GB
etc)
pricelistId
intoptionalID of pricelist to use for the order, if not provided, the pricelist for the current country will be used.
pricelist
stringoptionalName of pricelist to use for the order. Will only be used if pricelistId
is not provided. If not provided, the pricelist for the current country will be used.
marketId
intoptionalID of the market to use for the order. If not provided, the market for the current country will be used.
market
stringoptionalName of the market to use for the order. Will only be used if marketId
is not provided. If not provided, the market for the current country will be used.
customerRegister
booleanoptionalb2cDefault false
. If true
, the order will attach to the customer registered with the same e-mail provided in the API-call.
If customerRegister
is false
, the order will be created as a auto-created one and will not be visible by the signed in customer having the same e-mail.
customerId
intoptionalb2cIf this one is set, the customer ID will be used as the way to attach the order to a customer, independently of the e-mail provided.
customerSetNewPassword
booleanoptionalb2cDefault false
. Will flag the customer so the customer will receive a password reset e-mail when they try to sign in. This can be used when migrating customers over from another system.
createdFromOrigin
objectoptionalSpecifies the origin that the order was created from. If used, it needs to refer to an internal object in Centra.
type
stringrequiredType of origin the order was created from. Allowed types: return
, order
and plugin
id
intrequiredID of internal origin of the origin type. If Return #123 was used to create the order, id
should be 123
.
extraAttributes
objectoptionalObject for sending in custom order attributes.
attributeName_elementName
anyoptionalList of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.
accountId
intoptionalb2bAccount ID for B2B-customer. Required if order is placed for B2B.
buyerId
intoptionalb2bBuyer ID for B2B-customer. If not provided, the default buyer of the account will be used.
buyerName
stringoptionalb2bName of the buyer that placed the order.
deliveryWindow
stringoptionalb2bName of the Delivery Window being used when placing the order. Depending if the products are set to preorder or not, the order might extract stock or not.
products
objectrequiredContains the products for the order.
qty
intrequiredQuantity ordered for this product.
id
intoptionalID specific to the product size.
Either id
, ean
or sku
must be used.
ean
stringoptionalEAN of product item.
Either id
, ean
or sku
must be used.
sku
stringoptionalSKU of product item. Should either be the Size SKU or a combination of Product SKU + Variant SKU + Size SKU.
Either id
, ean
or sku
must be used.
unitPrice
decimal2 (0.00)optionalUnit price used for the sale of this product. If not set, the pricelist value (in combination with current campaign discounts set up in Centra) will be used.
originalPrice
decimal2 (0.00)optionalThe original unit price used for the product. Will calculate what discount the customer got when the order was placed. If not set, the price from the current pricelist will be used.
comment
stringoptionalA specific comment for the product. Can be used to define a specific date for each product, or a customized comment. Will show up on delivery notes and pack-lists.
itemText
objectoptionalAbility to define every column specifying the product information. Very useful when importing old orders for products not in Centra.
sku
stringoptionalThe SKU for this product.
brand
stringoptionalThe Brand name for this product.
product
stringoptionalProduct name.
variant
stringoptionalThe variant name of the product.
size
stringoptionalThe size name for this product. To make sure all visual representations in Centra looks good, please make sure this size exists on the sizechart selected for the product you used inside id
, ean
or sku
.
localizedProdSize
objectoptionalThe localized size information for this product size. It contains the localized size localizedSize
and localized size chart name localizationDefinitionName
.
shippingList
stringoptionalShipping option URI, for example: ups-standard
, without this one, the default shipping option for the products and country will be used.
shippingValue
decimal2 (0.00)optionalShipping cost, for example: 12.43
, without this one, the default shipping cost for the products and country will be used.
voucherValue
decimal2 (0.00)optionalVoucher value, should be a positive value or zero, even though the value ends up reducing the order value.
orderNumber
intoptionalExplictly set the order number for the order. Will only work if the order does not already exist in Centra.
sendEmail
booleanoptionalSend order confirmation or not, if not provided, the store settings will be used.
adjustStock
booleanoptionalDefault true
. Extract products from stock and fail with error if stock does not exist. If deliveryWindow
is set as preorder this setting will not matter.
forceCreate
booleanoptionalDefault false
. Create the order even though products did not exist. These products will be marked as back ordered.
comment
stringoptionalText to place inside the "Other Information" field. Might show up on pack-lists and delivery notes depending on store settings.
internalComment
stringoptionalText for the "Internal comment"-field. Will only be shown internally in Centra.
poNumber
stringoptionalb2bPO number used when placing the order. Will be visible on delivery notes and invoices.
orderDate
date/datetimeoptionalThe time when the order was placed. Timezone is based on the location of the organization's Centra settings.
deliveryDate
date/datetimeoptionalExpected time of delivery.
cancelDate
date/datetimeoptionalDate when order should be cancelled if not confirmed.
warehouseGroup
stringoptionalUsed to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.
createOnly
booleanoptionalDefault false
. Only prepare the order with all data, can be finalized later using :doc:completeOrder </reference/stable/order-api/complete-order>
.
internalOrder
booleanoptionalDefault false
. Mark the order as internal, will show up in reports as an internal order.
payment
objectoptionalWill contain information that should be inserted in regards to how the payment was handled outside of Centra.
id
intoptionalThe ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.
auth / capture
objectoptionalInformation about the authorization and capture of the order. Authorization was the reservation of the order, capture is when the value also has been charged. You can add separate information via payment.auth
and payment.capture
objects.
response
stringoptionalThe response string from the payment type. Will be shown verbose inside Centra.
status
intrequiredIf the authorization/capture went through or not. 0
means pending, 1
means success, 2
means failed.
transaction
stringoptionalThe transaction ID of the authorization/capture.
method
stringoptionalWill be shown on reports to summarize what payment method was used.
amount
decimal2 (0.00)requiredThe amount that was authorized.
external_url
stringoptionalIf an external invoice was created, insert the URL to the invoice here.
applyVouchers
booleanoptionalDefault true
. If Centra should calculate the voucher value depending on automatic voucher rules.
voucherCodes
arrayoptionalArray of voucher codes to apply on the order.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
POST <base>/order HTTP/1.1
Content-type: application/json
{
"invoiceAddress": {
"country": "SE",
"firstName": "John",
"lastName": "Smith",
"address": "12 Alto Road",
"coaddress": "c/o Peter",
"zipcode": "90212",
"city": "San Francisco",
"email": "x@example.com"
},
"deliveryAddress": {
"country": "US",
"firstName": "John",
"lastName": "Smith",
"address": "1500 California St",
"coaddress": "c/o Peter",
"zipcode": "90210",
"city": "San Francisco",
"state": "CA"
},
"products": [
{
"qty": 2,
"ean": "ABCDEFGHIJKL",
"unitPrice": 14.11,
"originalPrice": 100.11,
"itemText" : {
"sku": "SPECIAL-SKU-FOR-THIS-ONE",
"product": "A special product",
"variant": ""
}
},
{
"qty": 1,
"sku": "SKUASKUBSKUC",
"unitPrice": 12.11,
"originalPrice": 50.22,
"localizedProdSize": {
"localizationDefinitionName": "Test order api definition name",
"localizedSize": "Test order api size"
}
}
],
"payment": {
"id": 36,
"auth": {
"status": 1,
"transaction": "894751945132",
"method": "cc",
"amount": 26.22
},
"capture": {
"status": 1,
"transaction": "154342468439",
"method": "cc",
"amount": 26.22
}
},
"voucherCodes": ["MyFirstGiftcard", "New10PercentOff"]
}
The response will return an array of orders when the call was successful (unless you used createOnly
set as true
). This is because the order might have been split into different orders depending on rules inside Centra.
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalWill return if createOnly
was set as true
.
orders
array of intoptionalList of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response examples
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"orders": [
1234
]
}
If createOnly
is set to true
, the response looks like this:
1
2
3
4
{
"status": "ok",
"order": 1234
}
Error example
Errors will always be returned with "status" as "no" it will also contain a code and a message with more details the codes and their general meaning is as follows
Code | Description |
---|---|
-1 | Some of the provided products are not possible to add to the order, product status, market or pricelist might not be properly configured inside centra. |
-2 | Stock error, one or more products are missing stock |
-3 | Order is empty |
-4 | One or more required fields are missing |
-5 | An order with the provided order number already exists |
-6 | Customer registration failed |
-7 | General error, see message for details |
1
2
3
4
5
{
"status": "no",
"code": -7,
"msg": "Message about why the order failed to be created."
}
Batch create orders#
Endpoint: POST *base*/orders
Authentication: API Key
You are able to insert multiple orders at the same time by changing the endpoint from <base>/order
to <base>/orders
and sending data for each order inside an object with defined keys. You will get back responses for each order using the same defined keys you sent.
Parameters
The request consists of a JSON object with names for each element. The content of each element should be an order object, specified in Create Order. The name for each element is then used in the response to map against either a success response or an error for each order.
foo bar etc ...
order objectrequiredThe name of each element could be anything you like. The content of each element are exactly like the parameters for :ref:Create Order <create-order-parameters>
.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
POST <base>/orders HTTP/1.1
Content-type: application/json
{
"x123": {
"invoiceAddress": {
"country": "SE",
"firstName": "John",
"lastName": "Smith",
"address": "12 Alto Road",
"coaddress": "c/o Peter",
"zipcode": "90212",
"city": "San Francisco",
"email": "x@example.com"
},
"deliveryAddress": {
"country": "US",
"firstName": "John",
"lastName": "Smith",
"address": "1500 California St",
"coaddress": "c/o Peter",
"zipcode": "90210",
"city": "San Francisco",
"state": "CA"
},
"products": [
{
"qty": 2,
"ean": "ABCDEFGHIJKL",
"upc": "123456",
"unitPrice": 14.11,
"originalPrice": 100.11,
"itemText" : {
"sku": "SPECIAL-SKU-FOR-THIS-ONE",
"product": "A special product",
"variant": ""
}
},
{
"qty": 1,
"sku": "SKUASKUBSKUC",
"unitPrice": 12.11,
"originalPrice": 50.22
}
]
},
"a1": {
"...": "..."
}
}
Response
200
Content-type: application/json
foo bar etc ...
objectrequiredObject with fields for each order using the names from the request.
status
stringrequiredok
if success, else no
.
order
ntoptionalWill return if createOnly
was set as true
.
orders
array of intoptionalList of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"x123": {
"status": "ok",
"orders": [
1234
]
},
"a1": {
"status": "ok",
"orders": [
1235
]
}
}
Response if createOnly
is true
:
1
2
3
4
5
6
7
8
9
10
{
"x123": {
"status": "ok",
"order": 1234
},
"a1": {
"status": "ok",
"order": 1235
}
}
Error examples
Errors will always be returned with "status" as "no" it will also contain a code and a message with more details the codes and their general meaning is as follows
Code | Description |
---|---|
-1 | Some of the provided products are not possible to add to the order, product status, market or pricelist might not be properly configured inside centra. |
-2 | Stock error, one or more products are missing stock |
-3 | Order is empty |
-4 | One or more required fields are missing |
-5 | An order with the provided order number already exists |
-6 | Customer registration failed |
-7 | General error, see message for details |
1
2
3
4
5
6
7
8
9
10
11
12
{
"x123": {
"status": "no",
"code": -7,
"msg": "Message about why the order failed to be created."
},
"a1": {
"status": "no",
"code": -7,
"msg": "Message about why the order failed to be created."
}
}
Since you can insert multiple orders at the same time, some orders might succeed where others fail. Here's an example with two orders that failed and one that succeeded:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"x123": {
"status": "no",
"code": -7,
"msg": "Message about why the order failed to be created."
},
"a1": {
"status": "no",
"code": -7,
"msg": "Message about why the order failed to be created."
},
"a2": {
"status": "ok",
"orders": [
1235
]
}
}
Complete order#
Endpoint: POST *base*/order/*orderId*
Authentication: API Key
If Create Order was used with createOnly
set as true
, the order will only be prepared but not finalized. By using the Complete Order-endpoint you can finalize the order to be placed properly as a second step from creating the order. This might be necessary if you first need to make sure the order can be placed (Create Order) and then finalize it after you've verified the payment (Complete Order).
You can use this endpoint multiple times for the same order, for example to save details on payment auth and capture at different times.
The Create Order call is the one validating that the products exists in stock, so if the Complete Order-call is made much later than the Create Order-call, there might be products back ordered inside the finalized order.
Parameters
The following parameters are explained in the Create Order-call, but are also supported when completing the order.
payment
objectoptionalWill contain information that should be inserted in regards to how the payment was handled outside of Centra.
id
intrequiredThe ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.
auth capture
objectoptionalInformation about the authorization and capture of the order. Authorization was the reservation of the order, capture is when the value also has been charged.
response
stringoptionalThe response string from the payment type. Will be shown verbose inside Centra.
status
intrequiredIf the authorization/capture went through or not. 0
means pending, 1
means success, 2
means failed.
transaction
stringoptionalThe transaction ID of the authorization/capture.
method
stringoptionalWill be shown on reports to summarize what payment method was used.
amount
decimal2 (0.00)requiredThe amount that was authorized.
external_url
stringoptionalIf an external invoice was created, insert the URL to the invoice here.
buyerName
stringoptionalName of the buyer that placed the order.
internalComment
stringoptionalText for the "Internal comment"-field. Will only be shown internally in Centra.
poNumber
stringoptionalPO number used when placing the order. Will be visible on delivery notes and invoices.
orderDate
date/datetimeoptionalThe time when the order was placed. Timezone is based on the location of the organization's Centra settings.
deliveryDate
date/datetimeoptionalExpected time of delivery.
cancelDate
date/datetimeoptionalDate when order should be cancelled if not confirmed.
warehouseGroup
stringoptionalUsed to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
POST <base>/order/123 HTTP/1.1
Content-type: application/json
{
"comment": "Completed order, here is a comment"
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
orders
array of stringoptionalList of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
6
{
"orders": [
"44"
],
"status": "ok"
}
Error example
1
2
3
4
{
"status": "no",
"msg": "Message about why the order failed to be completed."
}
Get orders#
Endpoint: GET *base*/orders?[&limit=5][&offset=5][&order=83651][&customer_id=1][&xml=1]
Authentication: API Key
This will fetch the orders allowed for the plugin being set up.
Price information returned by this endpoint depends on the plugin settings. Refer to the documentation for details.
Parameters
limit
intoptionalLimit amount of orders returned. Default: 20.
offset
intoptionalOffset how far in to start returning orders.
order
intoptionalReturn a specific order.
customer_id
intoptionalReturn orders for specified customer id.
newer_than
date/datetimeoptionalReturn order newer than date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
older_than
date/datetimeoptionalReturn order newer than date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/orders?newer_than=2019-01-01+12:11:39&limit=10 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
orders
arrayrequiredArray of orders returned.
orderId
stringoptionalID of the order.
orderStatus
stringoptionalStatus of the order.
selectionId
stringoptionalSelection ID of the order.
orderDate
datetimeoptionalDate when order was created.
products
arrayoptionalProducts inside the order.
lineId
stringoptionalID of the specific product item in this order.
qty
intoptionalQuantity of this specific product item.
isBundle
booleanoptionalFlag showing if product is bundle
isPartOfBundle
intoptionalBundle id
bundle
arrayoptionalArray of containing items for bundle
localizedSize
objectoptionalThe localized size information for this product size. It contains the localized size localizedSize
and localized size chart name localizationDefinitionName
.
taxBreakdown
arrayoptionalLists all tax rules applied to the order.
description
stringoptionalText description of tax rule. ex: VAT
taxPercent
floatoptionalPercentage of tax. ex 25
value
floatoptionalHow much tax. ex 20
paymentPlugin
stringoptionalPayment plugin type, e.g. adyen_drop_in
, klarna_checkout_v1
, paypal_v1
, etc.
paymentType
stringoptionalPayment method type, one of: cc, inv, 3rd, free, prepaid. Where cc = credit card, inv = invoice, 3rd = third party. Value is not unique, more than one payment method can have
paymentDescription
stringoptionalPayment method description from plugin configuration.
paymentReference
stringoptionalPayment reference ID from external service provider. Can be null.
paymentMethod
stringoptionalPayment method ID - unique name of payment provider. Can be null.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"orders": [
{
"orderId": "83651",
"selectionId": "7dee9426b07b13ec452f87a3b67aa6be",
"orderDate": "2012-02-04 15:16:13",
"cancelDate": "2012-08-04 15:16:13",
"preferredDeliveryDate": "2012-05-04 15:16:13",
"estimatedDeliveryDate": "2012-05-04 15:16:13",
"orderStore": "retail",
"orderCurrency": "EUR",
"customerId": "12345",
"accountId": "",
"deliveryName": "Someones Name",
"deliveryCompany": "",
"deliveryEmail": "deliveries@example.com",
"deliveryCell": "+4912345678",
"deliveryTele": "",
"deliveryAddress": "Examplestreet 1",
"deliveryCoaddress": "",
"deliveryZipcode": "12345",
"deliveryCity": "Somecity",
"deliveryState": "",
"deliveryCountry": "DE",
"billingName": "Someones Name",
"billingCompany": "",
"billingEmail": "billing@example.com",
"billingTele": "",
"billingAddress": "Examplestreet 1",
"billingCoaddress": "",
"billingZipcode": "12345",
"billingCity": "Somecity",
"billingState": "",
"billingCountry": "DE",
"billingVAT": "",
"poNumber": "",
"shippingList": "standard",
"suspect": 0,
"internalOrder": 0,
"hold": 0,
"waitingForPayment": 0,
"shippingValue": 25,
"voucherValue": 0,
"grandTotalValue": 3978.75,
"grandTotalTaxValue": 795.75,
"taxAdded": 0,
"taxDeducted": 0,
"internalComment": "",
"otherComment": "",
"marketId": 1,
"pricelistId": 1,
"ipAddress": "127.0.0.1",
"paymentPlugin": "klarna_checkout_v1",
"paymentType": "free",
"paymentDescription": "Klarna checkout v3",
"paymentReference": "12345678-1234-1234-864e-6ef2621c4ab6",
"paymentMethod": "klarna",
"defaultCarrier": "",
"shipments": [
{
"shipmentId": "16-1",
"shippedDate": "0000-00-00 00:00:00",
"carrier": "",
"service": "",
"trackingId": "",
"trackingUrl": "",
"returnSlipTracking": "",
}
],
"totalItemsPriceTax": -202.88,
"totalItemsPrice": 811.5,
"totalItemsWithoutTax": 608.62,
"taxBreakdown": [
{
"description": "VAT",
"taxPercent": 25,
"value": 795.75
}
],
"products": [
{
"lineId": "43243",
"sku": "S123K345U1",
"variantSku": "",
"sizeSku": "",
"ean": "1234567890123",
"upc": "123456",
"name": "Product #1",
"variant": "White",
"brand": "Brand",
"size": "XS",
"qty": 1,
"originalPrice": 500.5,
"price": 450.5,
"weight": 2,
"weightUnit": "kg",
"countryOfOrigin": "DE",
"harmCode": "12345",
"comment": "",
"otherComment": "",
"taxPercent": 0,
"priceDiscount": 50.0,
"priceDiscountAsPercent": 0,
"taxValue": 112.63,
"totalPrice": 450.5,
"anyDiscount": false,
"priceEachWithoutTax": 337.87,
"priceEachReduction": 0,
"warehouses": [
{
"name": "Default",
"itemQty": 1
}
],
"isBundle": false,
"isPartOfBundle": "217"
},
{
"lineId": "43244",
"sku": "S123K345U2",
"variantSku": "",
"sizeSku": "",
"ean": "1234567890124",
"upc": "123456",
"name": "Product #2",
"variant": "Blue",
"brand": "Brand",
"size": "XS",
"qty": 2,
"originalPrice": 200.5,
"price": 180.5,
"weight": 1.5,
"weightUnit": "kg",
"countryOfOrigin": "CI",
"harmCode": "12345",
"comment": "",
"taxPercent": 25,
"priceDiscount": 0,
"priceDiscountAsPercent": 0,
"taxValue": 90.25,
"totalPrice": 361,
"anyDiscount": false,
"priceEachWithoutTax": 270.75,
"priceEachReduction": 0,
"warehouses": [
{
"name": "Default",
"itemQty": 2
}
],
"isBundle": true,
"bundle": [
{
"lineId": "43243",
"sku": "S123K345U1",
"variantSku": "",
"sizeSku": "",
"ean": "1234567890123",
"upc": "123456",
"name": "Product #1",
"variant": "White",
"brand": "Brand",
"size": "XS",
"qty": 1,
"originalPrice": 500.5,
"price": 450.5,
"weight": 2,
"weightUnit": "kg",
"countryOfOrigin": "DE",
"harmCode": "12345",
"comment": "",
"otherComment": "",
"taxPercent": 0,
"priceDiscount": 50.0,
"priceDiscountAsPercent": 0,
"taxValue": 112.63,
"totalPrice": 450.5,
"anyDiscount": false,
"priceEachWithoutTax": 337.87,
"priceEachReduction": 0,
"warehouses": [
{
"name": "Default",
"itemQty": 1
}
],
"isBundle": false,
"isPartOfBundle": "217"
},
]
}
],
"totalItemsDiscount": 38.11,
"discounts": {
"anyDiscount": false,
"discount": "0.00 USD",
"discountAsNumber": 0,
"vouchers": [
{
"voucher": "vip123",
"name": "Some voucher",
"priceOff": "-150.00 USD",
"priceOffAsANumber": -150.0,
"description": "This is VIP code description",
"isCredit": false,
"originalPriceOff": "-150.00 USD",
"originalPriceOffAsNumber": -150.0
}
],
"automaticDiscounts": [
{
"automaticDiscount": "12345",
"name": "Some discount",
"priceOff": "0.00 USD",
"priceOffAsANumber": 0
}
]
}
}
]
}
Update order#
Endpoint: PUT *base*/orders
Authentication: API Key
Update information on the order.
Parameters
order
intrequiredOrder ID to update.
internalComment
stringoptionalAppend some text to the internal comment field.
replaceInternalComment
booleanoptionalDefault false
. Replace the full content of the internal comment field with the internalComment
.
comment
stringoptionalAppend some text to the comment field.
replaceComment
booleanoptionalDefault false
. Replace the full content of the comment field with the comment
.
extraAttributes
objectoptionalObject for sending in custom order attributes.
attributeName_elementName
anyoptionalList of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
7
PUT <base>/orders HTTP/1.1
Content-type: application/json
{
"order": 83651,
"internalComment": "test"
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intrequiredOrder ID that was updated
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
{
"status": "ok",
"order": 83651
}
Error example
1
2
3
4
5
{
"status": "no",
"msg": "order in wrong market",
"order": 83651
}
Create shipment#
Endpoint: POST *base*/shipments
Authentication: API Key
This will create a shipment and per default try to capture from the payment provider, shipment will not be created if the capture fails.
You have the ability to turn off capture to make it possible to edit the shipment after it has been created. However, if you explicitly turn off capture using "capture": false
, we will not capture the money for the order automatically, and the Complete shipment call MUST be made and verified that it was successful until you can ship any products.
Parameters
order
intrequiredOrder ID to create shipment on.
products
objectrequiredKey is lineID
from the Get orders response and value is the quantity
.
Example: {"products":{"1441":2}}
will create a shipment of 2 products from item 1441
.
key in object
stringrequiredlineID
from the Get orders response referring to a specific product item in the order.
value in object
intrequiredQuantity of the item that should be shipped.
gtg
booleanoptionalDefault: false
. Mark the shipment as good to go.
capture
booleanoptionalDefault: true
. If Centra should capture the shipment amount from the payment provider.
Should not be turned off unless you are capturing the money somewhere else.
shipped
booleanoptionalMark the shipment as sent. Default: false
.
carrier
stringoptionalCarrier used for shipping. Only used if shipped
is true
.
service
stringoptionalService level used for shipping. Only used if shipped
is true
.
packages
intoptionalNumber of packages in shipment. Only used if shipped
is true
.
tracking
stringoptionalTracking number for shipment. Only used if shipped
is true
.
returnSlipTracking
stringoptionalReturn slip tracking number for shipment. Only used if shipped
is true
.
sendEmail
booleanoptionalDecide if Shipping Confirmation e-mail should be sent. If not defined, Store setting "Send Shipping Confirmation" will be used instead. Only used if shipped
is true
.
deductPreviousCosts
booleanoptionalUsed together with the capture
param, necessary when your order is split into multiple shipments. If the first shipment you created and captured contained the shipping cost, you can use this param to skip it in the subsequent shipments. This is necessary, since the payment providers will not allow you to capture more than was authorised, so you can only charge the shipping cost once.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
7
8
9
10
POST <base>/shipments HTTP/1.1
Content-type: application/json
{
"order": 83651,
"products": {
"43243": 1,
"43244": 2
}
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalOrder ID that the shipment was created on.
shipment
stringoptionalThe shipment ID for the create shipment.
deliveryNote
stringoptionalURL to a PDF delivery note for the shipment.
proforma
stringoptionalURL to a PDF proforma for the shipment.
invoice
stringoptionalURL to a PDF invoice for the shipment. Will only be set if an invoice exists.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
6
7
8
9
10
11
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"order": 83651,
"shipment": "83651-1",
"deliveryNote": "http://.../delivery-note.pdf",
"proforma": "http://.../proforma.pdf",
"invoice": "http://.../invoice.pdf"
}
Error examples
1
2
3
4
5
{
"status": "no",
"msg": "order does not exist",
"order": "1337"
}
1
2
3
4
5
{
"msg": "can not capture order",
"status": "no",
"order": "5"
}
Get shipments#
Endpoint: GET *base*/shipments?[&limit=5][&order=83651]
Authentication: API Key
Calling this endpoint without specifying a specific order
will list all Good to Go-shipments that are not sent, oldest first. When fetching a shipment for a specific order
, it will be returned no matter what status the shipment is.
Price information returned by this endpoint depends on the plugin settings. Refer to the documentation for details.
Parameters
limit
intoptionalLimit amount of shipments returned. For statuses inprogress
and completed
a positive value between 1 and 100.
order
intoptionalReturn shipments for a specific order.
xml
booleanoptionalResponse in xml format instead of json.
offset
intoptionalOffset how far in to start returning orders.
status
stringoptionalDefault value: goodtogo
. Allowed values: inprogress
, goodtogo
, completed
newer_than
date/datetimeoptionalOnly return shipments newer than provided date
older_than
date/datetimeoptionalOnly return shipments older than provided date
Request example
GET <base>/shipments?limit=5 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
shipments
arrayrequiredArray of shipments returned.
orderId
stringoptionalID of the order.
shipmentId
stringoptionalID of the shipment.
selectionId
stringoptionalSelection ID of the order.
orderDate
datetimeoptionalDate when order was created.
shouldCapture
booleanoptionalIf the shipment needs to be captured before being shipped.
deliveryNote
stringoptionalURL to a PDF delivery note for the shipment.
shippingTerms
objectoptionalShipping Terms object selected on this shipment.
id
intoptionalId of the specific shipping terms object.
name
stringoptionalName of the specific shipping terms object.
description
stringoptionalDescription of the specific shipping terms object.
paymentTerms
objectoptionalPayment Terms object selected on this shipment.
id
intoptionalID of the specific payment terms object.
name
stringoptionalName of the specific payment terms object.
description
stringoptionalDescription of the specific payment terms object.
proforma
stringoptionalURL to a PDF proforma for the shipment.
defaultCarrier
stringoptionalName of the carrier for this shipment.
deliveryService
stringoptionalName of the delivery service for this shipment.
invoices
arrayoptionalURLs to PDF invoices for the shipment. Will only be set if any invoices exists.
products
arrayoptionalProducts inside the shipment.
lineId
stringoptionalID of the specific product item in this shipment.
qty
intoptionalQuantity of this specific product item.
isBundle
booleanoptionalFlag showing if product is bundle
isPartOfBundle
intoptionalBundle id
bundle
arrayoptionalArray of containing items for bundle
taxBreakdown
arrayoptionalLists all tax rules applied to the order.
description
stringoptionalText description of tax rule. ex: VAT
taxPercent
floatoptionalPercentage of tax. ex 25
value
floatoptionalHow much tax. ex 20
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"shipments": [
{
"orderId": "83651",
"selectionId": "ff805e6dc70f905553e2225c6977a27a",
"orderDate": "2012-02-04 15:16:13",
"cancelDate": "2012-08-04 15:16:13",
"preferredDeliveryDate": "2012-05-04 15:16:13",
"estimatedDeliveryDate": "2012-05-04 15:16:13",
"orderStore": "retail",
"orderCurrency": "EUR",
"shipmentId": "83651-1",
"customerId": "11627",
"accountId": "0",
"billingName": "Someones Name",
"billingCompany": "",
"billingAddress": "Examplestreet 1",
"billingCoaddress": "",
"billingCity": "Somecity",
"billingState": "",
"billingZipcode": "12345",
"billingCountry": "DE",
"billingEmail": "someone@example.com",
"billingTele": "",
"deliveryName": "Someones Name",
"deliveryCompany": "",
"deliveryEmail": "someone@example.com",
"deliveryCell": "+4912345678",
"deliveryTele": "",
"deliveryAddress": "Examplestreet 1",
"deliveryCoaddress": "",
"deliveryZipcode": "12345",
"deliveryCity": "Somecity",
"deliveryState": "",
"deliveryCountry": "DE",
"billingVAT": "",
"poNumber": "",
"shippingList": "standard",
"shippingTerms": {
"id": 5,
"name": "ShippingTermName",
"description": "ShippingTermDescription"
},
"paymentTerms": {
"id": 10,
"name": "PaymentTermName",
"description": "PaymentTermDescription"
},
"proforma": "http://.../proforma?shipment=83651-1",
"deliveryNote": "http://../delnote?shipment=83651-1",
"defaultCarrier": "Delivery Carrier",
"deliveryService": "Delivery Service",
"shipmentDate": "2019-07-01 12:56:00",
"trackingNumber": "123456789",
"trackingUrl": "https://www.dhl.com.pl/exp-en/express/tracking.html?AWB=123456789",
"returnSlipTracking": "123456789",
"invoices": [
"https://online.klarna.com/invoice_public_show.yaws/invoice.pdf?invno=&orgno="
],
"suspect": 0,
"hold": 0,
"paid": 1,
"shouldCapture": 0,
"shippingValue": 25,
"voucherValue": 0,
"grandTotalValue": 3978.75,
"grandTotalTaxValue": 795.75,
"taxAdded": 0,
"taxDeducted": 0,
"internalComment": "",
"otherComment": "",
"taxBreakdown": [
{
"description": "VAT",
"taxPercent": 25,
"value": 795.75
}
],
"products": [
{
"lineId": "43243",
"sku": "S123K456U1",
"variantSku": "",
"sizeSku": "",
"name": "Product #1",
"variant": "White",
"size": "XS",
"ean": "1234567890123",
"upc": "123456",
"qty": 1,
"originalPrice": 500.5,
"price": 450.5,
"weight": 2,
"weightUnit": "kg",
"countryOfOrigin": "DE",
"harmCode": "12345",
"comment": "",
"warehouses": [
{
"name": "Default warehouse",
"itemQty": "1"
}
],
"isBundle": false,
"isPartOfBundle": "217"
},
{
"lineId": "43244",
"sku": "S123K456U2",
"variantSku": "",
"sizeSku": "",
"name": "Product #2",
"variant": "Blue",
"size": "XS",
"ean": "1234567890124",
"upc": "123456",
"qty": 2,
"originalPrice": 200.5,
"price": 180.5,
"weight": 1.5,
"weightUnit": "kg",
"countryOfOrigin": "CI",
"harmCode": "12345",
"comment": "",
"isBundle": true,
"bundle": [
{
"lineId": "43243",
"sku": "S123K456U1",
"variantSku": "",
"sizeSku": "",
"name": "Product #1",
"variant": "White",
"size": "XS",
"ean": "1234567890123",
"upc": "123456",
"qty": 1,
"originalPrice": 500.5,
"price": 450.5,
"weight": 2,
"weightUnit": "kg",
"countryOfOrigin": "DE",
"harmCode": "12345",
"comment": "",
"warehouses": [
{
"name": "Default warehouse",
"itemQty": "1"
}
],
"isBundle": false,
"isPartOfBundle": "217"
},
]
}
]
}
]
}
Update shipment#
Endpoint: PUT *base*/shipments/*shipmentId*
Authentication: API Key
This will modify the products on the shipment, keeping the same shipmentId
. This function is designed for creation and modification of new shipments, meaning it will not work on existing shipments which:
- Have been shipped,
- Have been captured or paid, or
- Have any returns.
The only exception to this rule is setting GTG (Good to Go) or setting serial numbers on serializable product lines. This you can do at any point.
To be able to use this call, you need to create a shipment using "capture": false
so the create shipment call is not trying to capture the money.
If the automatic capture when creating shipments is disabled, to avoid sending shipments that has not been captured you need to Capture Shipment before you ship it.
If you need to remove the shipment, use the Delete Shipment method.
Parameters
shipmentId
stringrequiredThe ID from shipment
when creating or updating a shipment.
gtg
booleanoptionalDefault 0
. Update shipment with Good to Go.
products
objectoptionalKey is lineID
from the Get orders response and value is the quantity
.
Example: {"products":{"1441":3}}
will update a shipment to 3 products from item 1441
.
key in object
stringrequiredlineID
from the Get orders response referring to a specific product item in the order.
value in object
intrequiredQuantity of the item that should be set for the shipment.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
PUT <base>/shipments/23123 HTTP/1.1
Content-type: application/json
{
"gtg":1,
"products": {
"43243": 1,
"43244": 2,
"43245": {
"serialNumber": "newSerialNumber",
"qty": 5
}
}
}
Response
200
Content-type: application/json
Response is explained in the Create Shipment Response.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
"status": "ok",
"shipment": {
"orderId": "83651",
"selectionId": "ff805e6dc70f905553e2225c6977a27a",
"orderDate": "2012-02-04 15:16:13",
"cancelDate": "2012-08-04 15:16:13",
"preferredDeliveryDate": "2012-05-04 15:16:13",
"estimatedDeliveryDate": "2012-05-04 15:16:13",
"orderStore": "retail",
"orderCurrency": "EUR",
"shipmentId": "83651-1",
"customerId": "11627",
"accountId": "0",
"deliveryName": "Someones Name",
"deliveryCompany": "",
"deliveryEmail": "tetete@ttet.com",
"deliveryCell": "+4912345678",
"deliveryTele": "",
"deliveryAddress": "Examplestreet 1",
"deliveryCoaddress": "",
"deliveryZipcode": "12345",
"deliveryCity": "Somecity",
"deliveryState": "",
"deliveryCountry": "DE",
"billingVAT": "",
"poNumber": "",
"shippingList": "standard",
"proforma": "http://.../proforma?shipment=83651-1",
"deliveryNote": "http://../delnote?shipment=83651-1",
"invoices": [
"https://online.klarna.com/invoice_public_show.yaws/invoice.pdf?invno=<>&orgno="
],
"suspect": 0,
"hold": 0,
"paid": 1,
"shouldCapture": 0,
"shippingValue": 25,
"voucherValue": 0,
"grandTotalValue": 3978.75,
"grandTotalTaxValue": 795.75,
"internalComment": "",
"otherComment": "",
"products": [
{
"lineId": "43243",
"sku": "B405916999",
"variantSku": "",
"sizeSku": "",
"name": "Product #1",
"variant": "White",
"size": "XS",
"ean": "7332577534606",
"upc": "123456",
"qty": 1,
"originalPrice": 500.5,
"price": 450.5,
"weight": 2,
"weightUnit": "kg",
"countryOfOrigin": "DE",
"harmCode": "345345435",
"comment": ""
},
{
"lineId": "43244",
"sku": "C00622469B",
"variantSku": "",
"sizeSku": "",
"name": "Product #2",
"variant": "Blue",
"size": "XS",
"ean": "7332577652942",
"upc": "123456",
"qty": 2,
"originalPrice": 200.5,
"price": 180.5,
"weight": 1.5,
"weightUnit": "kg",
"countryOfOrigin": "CI",
"harmCode": "423432",
"comment": ""
}
]
}
}
Error example
1
2
3
4
5
{
"status": "no",
"msg": "shipment is sent and can not be updated",
"shipment": "4-1"
}
1
2
3
4
5
{
"status": "no",
"msg": "shipment is paid and can not be updated",
"shipment": "4-1"
}
1
2
3
4
5
{
"status": "no",
"msg": "shipment is captured and can not be updated",
"shipment": "4-1"
}
1
2
3
4
5
{
"status": "no",
"msg": "shipment has refunds and can not be updated",
"shipment": "4-1"
}
Complete shipment#
Endpoint: PUT *base*/shipment
Authentication: API Key
This will insert back the tracking number and carrier information to Centra. An email will be sent out to the customer with the tracking information.
Remember, for the Shipment to be completed, it has to be paid, Good-to-go, and shipped.
You can select if you want to capture the order, this is often used if the shipments are already created inside Centra. You will get an error as response if the capture did not go through.
Parameters
order
intrequiredOrder ID to which the shipment belongs.
shipment
intrequiredShipment ID for the shipment to complete.
capture
booleanoptionalDefault: true
. Try to capture the order. Ignored if the capture was already made earlier for the shipment.
gtg
booleanoptionalGood-to-go. Indicates the items are packed and ready to leave the Warehouse. Required for shipment to complete.
shipped
booleanoptionalIndicates the items have been shipped. Required for shipment to complete.
carrier
stringoptionalCarrier used for shipping.
service
stringoptionalService level used for shipping.
packages
intoptionalNumber of packages in shipment.
tracking
stringoptionalTracking number for shipment.
returnSlipTracking
stringoptionalReturn slip tracking number for shipment.
sendEmail
booleanoptionalDecide if Shipping Confirmation e-mail should be sent. If not defined, Store setting "Send Shipping Confirmation" will be used instead.
internalComment
stringoptionalAppend some text to internal comment field.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
PUT <base>/shipment HTTP/1.1
Content-type: application/json
{
"order": "83651",
"shipment": "83651-1",
"carrier": "Fedex",
"service": "Express",
"packages": 1,
"tracking": "TRTTET5",
"returnSlipTracking": "TRTTET6",
"capture": 1
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalOrder ID that was completed.
shipment
stringoptionalShipment ID that was completed.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
{
"status": "ok",
"order": 83651,
"shipment": "83651-1"
}
Error example
1
2
3
4
5
6
{
"status": "no",
"msg": "capture failed",
"order": 83651,
"shipment": "83651-1"
}
Capture shipment#
Endpoint: PUT *base*/capture
Authentication: API Key
This will capture the payment for a shipment. You can use this on a shipment that has "shouldCapture": true
from Get shipments.
Parameters
shipment
stringrequiredThe shipmentId
from Get shipments or Create shipment.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
PUT <base>/capture HTTP/1.1
Content-type: application/json
{
"shipment": "83651-1"
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalOrder ID that was captured.
shipment
stringoptionalOShipment ID that was captured.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
{
"status": "ok",
"order": 83651,
"shipment": "83651-1"
}
Error example
1
2
3
4
5
6
{
"status": "no",
"msg": "capture failed",
"order": 83651,
"shipment": "83651-1"
}
Delete shipment#
Endpoint: DELETE *base*/shipments/*shipmentId*[?xml=1]
Authentication: API Key
This will delete the shipment completely. Will only work if the shipment does not have any invoices or credit notes connected to it.
Parameters
shipmentId
stringoptionalThe shipmentId
from Get shipments or Create shipment.
xml
booleanoptionalResponse in xml format instead of json.
Request example
DELETE <base>/shipments/*shipmentId* HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalOrder ID for the shipment that was deleted.
shipment
stringoptionalShipment ID for the shipment that was deleted.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
6
{
"status": "ok",
"msg": "shipment removed",
"order": 8,
"shipment": "8-1"
}
Error example
1
2
3
4
5
{
"status": "no",
"msg": "shipment has invoices or creditnotes and could not be deleted.",
"shipment": "3-1"
}
Update Check First#
Endpoint: POST *base*/check-first
Authentication: API Key
This will update the status of a check-first warehouse on an order.
Updating a check first for an order is irreversible. Once an order has been accepted or rejected, it can no longer be changed.
Parameters
orderNumber
intrequiredOrder ID to update the Check first.
warehouseId
intrequiredWarehouse ID associated with the Check first order.
accepted
boolrequiredWhether to accept or reject the Check First warehouse. true
to accept, false
to reject.
Request example
1
2
3
4
5
6
7
8
POST <base>/check-first HTTP/1.1
Content-type: application/json
{
"orderNumber": 123,
"warehouseId": 321,
"accepted": true
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
msg
string|objectoptionalIf status
returns no
, this value should send back a message why it failed.
orderNumber
stringoptionalError message describing an issue with the provided order number.
warehouseId
stringoptionalError message describing an issue with the provided warehouse id.
accepted
stringoptionalError message describing an issue with the provided accepted value.
Response example
1
2
3
4
5
6
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok"
}
Error examples
1
2
3
4
5
6
7
8
{
"status": "no",
"msg": {
"orderNumber": "invalid value",
"warehouseId": "required",
"accepted": "invalid value"
}
}
1
2
3
4
{
"msg": "order does not exist",
"status": "no"
}
1
2
3
4
{
"msg": "failed to allocate stock",
"status": "no"
}
Update allocation request#
Endpoint: PUT *base*/allocation-request
Authentication: API Key
This will update the status of an allocation request, which is pending for approval or rejection.
In Order API Plugin settings Allow access to the following endpoints
Order API should have access to Update allocation request (PUT /allocation-request)
endpoint.
Updating allocation request for an order is irreversible. Once an order has been accepted or rejected, it can no longer be changed.
Parameters
id
intrequiredAllocation request ID.
status
stringrequiredWhether to accept or reject the allocation request for warehouse.
Accepted values:confirmed
to accept, rejected
to reject.
Request example
1
2
3
4
5
6
7
PUT <base>/allocation-request HTTP/1.1
Content-type: application/json
{
"id": 67,
"status": "confirmed"
}
Response
200
Content-type: application/json
status
stringrequiredtrue
if success. false
if failed.
errorMessages
arrayoptionalIf status
returns false
, this value will be not empty with a message why it failed.
Response example
1
2
3
4
5
6
7
HTTP/1.1 200 OK
Content-type: application/json
{
"success": true,
"errorMessages": []
}
Error examples
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"You can't update allocation request, which is in status confirmed."
]
}
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"You can't update allocation request, which is in status rejected."
]
}
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"Allocation request not found"
]
}
1
2
3
4
5
6
{
"success": false,
"errorMessages": [
"Warehouse doesn't have sufficient stock to allocate the request."
]
}
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"Failed to allocate stock from the warehouse."
]
}
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": {
"status": "invalid value, expected 'confirmed' or 'rejected'"
}
}
Missing access to endpoint:
1
2
3
4
5
6
HTTP/1.1 403 Forbidden
Content-type: application/json
{
"status": "Not Allowed"
}
Get allocation requests of an order#
Endpoint: GET *base*/allocation-requests
Authentication: API Key
This will fetch all allocation requests for orders. It only applies to the "Direct, then confirm" flow, where at least one such warehouse is used for the stock allocation.
Allocation request can have the following statuses:
allocated
- items are allocated from this warehouse, but a webhook was not sent yet, should transition to sent
right away,
failed
- allocation request wasn't sent in a webhook, but it can still be confirmed through Order API,
sent
- request was sent, but products are allocated from another warehouse. If this warehouse will confirm the request, re-allocation will be done if there is sufficient stock at the moment of confirmation.
timed-out
- allocation request reached expiration date, items are re-allocated, but this request can be confirmed (if the allocation flow has not yet reached the end),
outdated
- allocation request is outdated and cannot be accepted anymore, please ignore it,
confirmed
- Centra received a confirmation, the allocation is now final,
rejected
- Centra received a rejection. If stock had been allocated from this warehouse, it has moved on to the next one.
In Order API Plugin settings Allow access to the following endpoints
Order API should have access to the Get allocation requests (GET /allocation-requests)
endpoint.
Parameters
status
stringoptionalBy default, only "pending" (actionable) allocation requests will be returned.
Accepts one or multiple comma-separated statuses listed above, or all
to include all possible statuses.
order
intoptionalShow allocation requests for a specific order number. Also accepts a comma-separated list of numbers.
warehouse
intoptionalShow allocation requests for a specific warehouse ID. Also accepts a comma-separated list of IDs.
page
intoptionalPage number, starting from 1
. Each page contains up to 100
entries.
Request example
GET <base>/*base*/allocation-requests HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success. no
if failed.
errorMessages
arrayoptionalIf status
returns no
, this value will be not empty with a message why it failed.
allocation_requests
arrayoptionalArray with allocation requests json objects.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"allocation_requests": [
{
"id": 1140,
"status": "outdated",
"warehouseId": 27,
"warehouseName": "Store 1",
"expirationDate": "2024-02-14T16:00:00+01:00",
"order": {
"id": "5cdb865329d982314aab6c5b84ac1201",
"number": 1103
},
"lines": [
{
"lineId": 1484,
"quantity": 1,
"stockItemId": 121
},
{
"lineId": 1485,
"quantity": 1,
"stockItemId": 120
},
{
"lineId": 1486,
"quantity": 2,
"stockItemId": 116
}
],
"createdAt": "2024-02-13T16:00:00+01:00"
},
{
"id": 1141,
"status": "sent",
"warehouseId": 27,
"warehouseName": "Store 1",
"expirationDate": "2024-02-14T16:02:25+01:00",
"order": {
"id": "5cdb865329d982314aab6c5b84ac1201",
"number": 1103
},
"lines": [
{
"lineId": 1484,
"quantity": 1,
"stockItemId": 121
},
{
"lineId": 1485,
"quantity": 1,
"stockItemId": 120
},
{
"lineId": 1486,
"quantity": 2,
"stockItemId": 116
}
],
"createdAt": "2024-02-13T16:02:25+01:00"
}
]
}
Error examples
Unknown status:
1
2
3
4
5
6
7
8
9
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "no",
"errorMessages": {
"status": "Expected \"status\" to be a single or a comma-separated list of request statuses, or \"all\", got \"?\""
}
}
Missing access to endpoint:
1
2
3
4
5
6
HTTP/1.1 403 Forbidden
Content-type: application/json
{
"status": "Not Allowed"
}
Create return#
Endpoint: POST *base*/return
Authentication: API Key
This will create return for given shipment and items. Return will be created even if some of the provided items cannot be returned.
Parameters
shipment
stringrequiredThe shipmentId
from Get shipments or Create shipment.
products
objectoptionalKey is lineID
from the Get shipments and value is the quantity
.
Example: {"products":{"1441":2}}
will create a return of 2 products from item 1441
.
key in object
stringrequiredlineID
from the Get shipments referring to a specific product item in the order.
value in object
intrequiredQuantity of the item that should be returned.
returnStock
booleanoptionalInsert returned items into stock. If not provided Default stock action on return
setting on the store will be used.
handlingCost
floatoptionalHandling cost.
handlingCostFromShipment
booleanoptionalDefault false
. Set to true
to use Handling cost from Shipment. You cannot provide handlingCost at the same time this option is used.
shippingCost
floatoptionalShipping cost.
shippingCostFromShipment
booleanoptionalDefault false
. Set to true
to use Shipping cost from Shipment. You cannot provide shippingCost at the same time this option is used.
returnCost
floatoptionalReturn cost. If the return itself should have a cost to it. Providing a value here will deduct the amount of money to refund.
voucherValue
floatoptionalVoucher value, should always be positive value.
voucherValueFromShipment
booleanoptionalDefault false
. Set to true
to use Voucher value from Shipment. You cannot provide voucherValue at the same time this option is used.
comment
stringoptionalAdditional comment for return, for reference.
xml
booleanoptionalResponse in xml format instead of json.
createdAt
date/datetimeoptionalAdditional datetime one of the format YYYY-MM-DD
or YYYY-MM-DD HH:MM:SS
like 2015-12-24 13:25:01
. Timezone is system-wide and decided by the company using Centra.
refund
objectoptionalRefund object.
Example: {"refund":{"refundPayment": true}}
will make refund from return.
refundPayment
booleanoptionalIf this is set to true the payment provider will get a refund request to pay back the money to the customer. The amount that will be refunded is the amount for the products, the handling, shipping and return costs. If the refund is successful against the payment provider, the returnCompleted
will be true
in the response.
sendEmail
booleanoptionalSend refund email. Default value is false
.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
POST <base>/return HTTP/1.1
Content-type: application/json
{
"shipment": "120276-1",
"returnStock": 1,
"comment": "Return created with Order Api",
"products": {
"268871": "1",
"268870": "1"
}
}
Request exampleincluding refund
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
POST <base>/return HTTP/1.1
Content-type: application/json
{
"shipment": "120276-1",
"returnStock": 1,
"comment": "Return created with Order Api",
"products": {
"268871": "1",
"268870": "1"
},
"refund": {
"refundPayment": true,
"sendEmail": true
}
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
order
intoptionalOrder ID that was captured.
return
intoptionalReturn ID that was created.
returnCompleted
booleanoptionalIf the return was completed directly on creation, this can only happen if a successful refund was made when return was created.
returnedItems
arrayoptionalArray of Line IDs of returned Products.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
6
7
8
{
"status": "ok",
"return": 5397,
"returnCompleted": false,
"returnedItems": [
"268871"
]
}
Response example including refund
1
2
3
4
5
6
7
8
9
10
11
{
"status": "ok",
"return": 5397,
"returnCompleted": true,
"returnedItems": [
"268871"
],
"refund": {
"status": "ok"
}
}
Error example
1
2
3
4
{
"status": "no",
"msg": "return could not be created."
}
Get returns#
Endpoint: GET *base*/returns?[&limit=5][&page=2][&return=23]
Authentication: API Key
Will list all returns, newest first.
Parameters
limit
intoptionalLimit the number of returns returned.
page
intoptionalNumber of page of results to return.
return
intoptionalOnly show a return with given ID.
shipment
stringoptionalOnly show a return with given shipment number.
order
intoptionalOnly fetch returns for a specific order.
selection
intoptionalOnly fetch returns for a specific selection.
customer_id
intoptionalOnly fetch returns for a specific customer.
newer_than
date/datetimeoptionalOnly fetch returns created after given date or datetime (inclusive). Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
older_than
date/datetimeoptionalOnly fetch returns created before given date or datetime (exclusive). Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/returns?limit=2 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
returns
arrayrequiredArray of fetched returns.
returnId
intoptionalID of the return.
completed
booleanoptionalWhether the return was completed or not.
shipment
stringoptionalNumber of the shipment.
shipmentId
intoptionalID of the shipment.
orderId
intoptionalID of the order.
selectionId
stringoptionalSelection ID of the order.
customerId
intoptionalCustomer ID of the order.
date
datetimeoptionalDate when return was created.
returnCost
floatoptionalCost of the return.
shippingCost
floatoptionalCost of shipping returned.
handlingCost
floatoptionalHandling cost of the return.
voucherValue
floatoptionalVoucher value included in the return.
taxValue
floatoptionalTax value of the return, zero if deducted.
taxDeduction
floatoptionalTax deduction in the return.
currency
stringoptionalCurrency code in which order and also return was made.
baseCurrencyRate
floatoptionalExchange rate between currency
and baseCurrency
above.
returnToStock
booleanoptionalWhether the return was marked as returned back to stock.
comment
stringoptionalOptional description added to the return.
createdFrom
stringoptionalInforms where this return originated, i.e. "Order API".
products
arrayoptionalProducts inside the return.
returnLineId
intoptionalID of the specific product item in this return.
shipmentLineId
intoptionalID of the related shipment line.
orderLineId
intoptionalID of the related order line.
productId
intoptionalID of the product.
variantId
intoptionalID of the product variant.
productName
stringoptionalName of the product.
productBrand
stringoptionalBrand name of the product.
variantName
stringoptionalName of the product variant.
size
stringoptionalSize description, if any.
sku
stringoptionalProduct SKU.
variantSku
stringoptionalProduct variant SKU.
sizeSku
stringoptionalSize SKU.
ean
stringoptionalEAN of the item.
upc
stringoptionalUPC of the item.
upc
stringoptionalUPC of the item.
quantity
intoptionalQuantity of this specific product item returned.
price
floatoptionalUnit price as seen on shipment.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"returns": [
{
"returnId": 385,
"completed": false,
"shipment": "20059-1",
"shipmentId": 8039,
"orderId": 20059,
"selectionId": "8bf93dd57e9ebf9291c8c3a5f0cb63bf",
"customerId": 416715,
"date": "2019-07-11 14:34:32",
"marketId": 1,
"pricelistId": 1,
"returnCost": 0,
"shippingCost": 0,
"handlingCost": 0,
"voucherValue": 0,
"taxValue": 21.41,
"taxDeduction": 0,
"currency": "EUR",
"baseCurrency": "SEK",
"baseCurrencyRate": 10.6453,
"returnToStock": true,
"comment": "Godkänd retur",
"createdFrom": "Order API",
"products": [
{
"returnLineId": 555,
"shipmentLineId": 30672,
"orderLineId": 60288,
"productId": 159,
"variantId": 372,
"productName": "Muffin man",
"productBrand": "Handcrafted",
"variantName": "Big cart",
"size": "One Size",
"sku": "MUF1042",
"variantSku": "",
"sizeSku": "",
"ean": "7340112910426",
"upc": "123456",
"quantity": 1,
"price": 124.1
}
]
},
{
"returnId": 384,
"shipment": "20179-1",
"shipmentId": 8094,
"orderId": 20179,
"selectionId": "ae6eb1befe5d6f850a016932ca4276dc",
"customerId": 734042,
"date": "2019-07-11 14:33:56",
"marketId": 1,
"pricelistId": 1,
"returnCost": 0,
"shippingCost": 0,
"handlingCost": 0,
"voucherValue": 0,
"taxValue": 9.08,
"taxDeduction": 0,
"currency": "GBP",
"baseCurrency": "SEK",
"baseCurrencyRate": 11.61479,
"returnToStock": true,
"comment": null,
"createdFrom": "Order API",
"products": [
{
"returnLineId": 553,
"shipmentLineId": 30800,
"orderLineId": 60669,
"productId": 196,
"variantId": 430,
"productName": "Plush Guitar",
"productBrand": "",
"variantName": "Pink",
"size": null,
"sku": "PNKG8484",
"variantSku": "",
"sizeSku": "",
"ean": "7340082321862",
"upc": "123456",
"quantity": 1,
"price": 54.5
}
]
}
]
}
Update return#
Endpoint: PUT *base*/returns/*returnId*
Authentication: API Key
Update information on Return.
Parameters
returnId
stringrequiredThe ID from return
when creating or updating a return.
completed
booleanoptionalSet to true
/false
to change Return status to Complete/Pending.
refundPayment
booleanoptionalIf this is set to true the payment provider will get a refund request to pay back the money to the customer. The amount that will be refunded is the amount for the products, the handling, shipping and return costs. If the refund is successful against the payment provider, the returnCompleted
will be true
in the response.
sendEmail
booleanoptionalSend refund email. Default value is false
.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
PUT <base>/returns/2 HTTP/1.1
Content-type: application/json
{
"completed": true
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
return
objectrequiredObject of fetched return.
returnId
intoptionalID of the return.
completed
booleanoptionalWhether the return was completed or not.
shipment
stringoptionalNumber of the shipment
shipmentId
intoptionalID of the shipment
orderId
intoptionalID of the order
selectionId
stringoptionalSelection ID of the order
customerId
intoptionalSelection ID of the order
date
datetimeoptionalDate when return was created.
returnCost
floatoptionalCost of the return.
shippingCost
floatoptionalCost of shipping returned
handlingCost
floatoptionalHandling cost of the return.
voucherValue
floatoptionalVoucher value included in the return.
taxValue
floatoptionalTax value of the return, zero if deducted.
taxDeduction
floatoptionalTax deduction in the return.
currency
stringoptionalCurrency code in which order and also return was made.
baseCurrency
stringoptionalCode of the currency used as base in this store.
baseCurrencyRate
floatoptionalExchange rate between currency
and baseCurrency
above.
returnToStock
booleanoptionalWhether the return was marked as returned back to stock.
comment
stringoptionalOptional description added to the return.
createdFrom
stringoptionalInforms where this return originated, i.e. "Order API".
products
arrayoptionalProducts inside the return.
returnLineId
intoptionalID of the specific product item in this return.
shipmentLineId
intoptionalID of the related shipment line.
orderLineId
intoptionalID of the related order line.
productId
intoptionalID of the product.
variantId
intoptionalID of the product variant.
productName
stringoptionalName of the product.
productBrand
stringoptionalBrand name of the product.
variantName
stringoptionalName of the product variant.
size
stringoptionalSize description, if any.
sku
stringoptionalProduct SKU.
variantSku
stringoptionalProduct variant SKU.
sizeSku
stringoptionalSize SKU
ean
stringoptionalEAN of the item.
upc
stringoptionalUPC of the item.
upc
stringoptionalUPC of the item.
quantity
intoptionalQuantity of this specific product item returned.
price
floatoptionalUnit price as seen on shipment
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
"status": "ok",
"return": {
"returnId": 18,
"completed": false,
"shipment": "44-1",
"shipmentId": 1142,
"orderId": 44,
"selectionId": "be337d27e16564cadad0a340b8bc1fbe",
"customerId": 31,
"date": "2020-01-07 17:00:29",
"marketId": 1,
"pricelistId": 1,
"returnCost": 5,
"shippingCost": 5.55,
"handlingCost": 9,
"voucherValue": 0,
"taxValue": 21.91,
"taxDeduction": 0,
"currency": "SEK",
"baseCurrency": "SEK",
"baseCurrencyRate": 1,
"returnToStock": false,
"comment": null,
"createdFrom": "Order API",
"products": [
{
"returnLineId": 17,
"shipmentLineId": 2681,
"orderLineId": 112,
"productId": 7,
"variantId": 2460,
"productName": "Test Product STOCK",
"productBrand": null,
"variantName": null,
"size": null,
"sku": "TPSTOCK",
"variantSku": "",
"sizeSku": "",
"ean": "StockTestEAN",
"upc": "123456",
"quantity": 1,
"price": 100
}
]
}
}
Error example
1
2
3
4
{
"status": "no",
"msg": "Return with id=100500 does not exist"
}
Get products#
Endpoint: GET *base*/products
Authentication: API Key
This will return product data from Centra with categories.
Parameters
sku
stringoptionalGet products with a specific SKU.
modified
date/datetimeoptionalGet all products modified after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
created
date/datetimeoptionalGet all products added after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
ean
stringoptionalGet a product with specified EAN code.
productId variantId stockItemId
intoptionalFilter products based on product, variant and stock item IDs.
limit
intoptionalYou will get this amount of products, and a "next" parameter in return if there are multiple pages. This will go a lot faster to fetch, instead of fetching all products at once.
include
stringoptionalinclude=attributes
will also make the products include the custom attributes defined for each product and variant.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
GET <base>/products HTTP/1.1
Content-type: application/json
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
products
arrayrequiredList of the products.
products
arrayoptionalList of the products.
sku
stringoptionalSKU for this product.
product
stringoptionalThe internal name for this product.
productId
intoptionalID for this product.
name
stringoptionalThe externally facing name for this product.
variantSku
stringoptionalSKU for this variant.
variantId
intoptionalID for this variant.
sizeSku
stringoptionalSKU for this size.
stockItemId
intoptionalID for this specific stock item.
ean
stringoptionalThe EAN for this product item size.
weight
decimal2 (0.00)optionalThe weight specified for this product.
weightUnit
stringoptionalThe unit used for the weight.
kg
lb
size
stringoptionalName of the size for this specific product item.
active
booleanoptionalIf the product item is active or not.
folder
stringoptionalString with names of the folders the product belongs to.
Like this: Collection / Jackets
.
countryOfOrigin
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc)
store
stringoptionalStore name product is related to.
categories
array|stringoptionalArray with names of the categories the product belongs to.
Like this: ["Collection / Jackets\/Outerwear", "..."]
.
images
array|stringoptionalURLs with the images connected to this product item.
Like this: ["https://xxx.centracdn.net/x/y/z.jpg", "https://..."]
.
prices
arrayoptionalArray of the pricelists for this product.
id
intoptionalID of the pricelist.
pricelist
stringoptionalName of the pricelist.
price
stringoptionalPrice for the product in this pricelist.
currency
stringoptionalISO code of the currency for this pricelist.
campaigns
arrayoptionalList of campaigns this product is connected to in this pricelist.
id
intoptionalID of the campaign.
campaign
stringoptionalName of the campaign.
price
decimal2 (0.00)optionalThe price when this campaign is applied to the price. Currency will always be the same as in the pricelist.
previous
stringoptionalWill contain a URL to the previous page.
next
stringoptionalWill contain a URL to the next page.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
"status": "ok",
"products": [
{
"sku": "M411-740",
"productId": 232,
"variantSku": "",
"variantId": 1211,
"sizeSku": "",
"brand": "Odd Molly",
"collection": "Molly Prefall 2011",
"product": "bakers cross 3\/4 blouse",
"variant": "LITE ROSE",
"size": "3",
"stockItemId": 3424,
"ean": "",
"weight": 0.17,
"weightUnit": "kg",
"countryOfOrigin": "PT",
"harmCode": "6206300090",
"harmDescription": "Cotton - blouse",
"active": 0,
"folder": "Folder 1 / Folder 2"
"name": "Bakers Cross",
"description": "",
"shortDescription": "",
"comment": "",
"store": "Retail",
"categories": [
"Collection \/ Jackets\/Outerwear",
"New Arrivals"
],
"images": [
"https:\/\/...\/images\/1_0d2f67cd05.jpg",
"https:\/\/...\/images\/1_318da2ad06.jpg",
"https:\/\/...\/images\/1_c4e1c20d34.jpg"
],
"prices": [
{
"id": "36",
"price": "329.00",
"pricelist": "EUR Europe",
"currency": "EUR",
"campaigns": [
{
"id": "40",
"campaign": "OUTLET 50% NY",
"price": 164.5
}
]
},
{
"id": "35",
"price": "269.00",
"pricelist": "GBP",
"currency": "GBP",
"campaigns": [
{
"id": "40",
"campaign": "OUTLET 50% NY",
"price": 134.5
}
]
}
]
},
{
"sku": "M411-740",
"productId": 232,
"variantSku": "",
"variantId": 1211,
"sizeSku": "",
"brand": "Odd Molly",
"collection": "Molly Prefall 2011",
"product": "bakers cross 3\/4 blouse",
"variant": "LITE ROSE",
"size": "4",
"stockItemId": 3425,
"ean": "",
"weight": 0.17,
"weightUnit": "kg",
"countryOfOrigin": "PT",
"harmCode": "6206300090",
"harmDescription": "Cotton - blouse",
"active": 0,
"name": "Bakers Cross",
"description": "",
"shortDescription": "",
"comment": "",
"store": "Retail",
"categories": [
"Collection \/ Jackets\/Outerwear",
"New Arrivals"
],
"images": [
"https:\/\/...\/images\/1_0d2f67cd05.jpg",
"https:\/\/...\/images\/1_318da2ad06.jpg",
"https:\/\/...\/images\/1_c4e1c20d34.jpg"
]
"prices": [
{
"id": "36",
"price": "329.00",
"pricelist": "EUR Europe",
"currency": "EUR",
"campaigns": [
{
"id": "40",
"campaign": "OUTLET 50% NY",
"price": 164.5
}
]
},
{
"id": "35",
"price": "269.00",
"pricelist": "GBP",
"currency": "GBP",
"campaigns": [
{
"id": "40",
"campaign": "OUTLET 50% NY",
"price": 134.5
}
]
}
]
}
],
"previous": "?limit=10&page=2",
"next": "?limit=10&page=3"
}
Get stock#
Endpoint: GET *base*/stock
Authentication: API Key
This will return product data from Centra with stock info. The values of the stock depends on the connected warehouses for the API-plugin.
Parameters
sku
stringoptionalGet products with a specific SKU.
modified
date/datetimeoptionalGet all products modified after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
stock_modified
date/datetimeoptionalGet all products which had stock changes after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
created
date/datetimeoptionalGet all products added after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
ean
stringoptionalGet a product with specified EAN code.
upc
stringoptionalGet a product with specified UPC code.
productId variantId stockItemId
intoptionalGet a product with specified productId, variantId or stockItemId.
limit
intoptionalYou will get this amount of products, and a "next" parameter in return if there are multiple pages. This will go a lot faster to fetch, instead of fetching all products at once.
include
stringoptionalinclude=attributes
will also make the products include the custom attributes defined for each product and variant.
exclude
stringoptionalexclude=physicalStock
will exclude fetching physical stock which will speed up the fetching of the stock values.
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/stock?[&limit=2][&sku=DCG001][&modified=2016-01-01+12:10:11][&created=2011-01-01] HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
products
arrayoptionalList of the products.
sku
stringoptionalSKU for this product.
product
stringoptionalThe internal name for this product.
productId
intoptionalThe ID for this product.
variantSku
stringoptionalSKU for this variant.
variantId
intoptionalID for this variant.
sizeSku
stringoptionalSKU for this size.
stockItemId
intoptionalID for this specific stock item.
ean
stringoptionalThe EAN for this product item size.
upc
stringoptionalThe UPC for this product item size.
weight
decimal2 (0.00)optionalThe weight specified for this product.
weightUnit
stringoptionalThe unit used for the weight.
kg
lb
size
stringoptionalName of the size for this specific product item.
active
booleanoptionalIf the product item is active or not.
countryOfOrigin
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc)
physicalStock
intoptionalThe amount of items in the physical stock. If an order is placed without being shipped, the physical stock of the product does not change. However, as soon as a shipment is completed, the physical stock will decrease.
physicalStock = allocatedStock + availableStock
allocatedStock
intoptionalThe amount of items in the physical stock that is currently allocated against orders.
availableStock
intoptionalThe amount of items in the physical stock that is currently available to sell.
previous
stringoptionalWill contain a URL to the previous page.
next
stringoptionalWill contain a URL to the next page.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
"status": "ok",
"products": [
{
"sku": "12019005",
"productId": 10,
"variantSku": "A",
"variantId": 9,
"sizeSku": "X",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLACK",
"variant": "SVART",
"size": "ONE SIZE",
"stockItemId": 3131,
"ean": "1234567890123",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"countryOfOrigin": "",
"harmCode": "87120030",
"harmDescription": "Cyklar",
"active": 1,
"physicalStock": 5,
"allocatedStock": 1,
"availableStock": 4
},
{
"sku": "12028008",
"productId": 11,
"variantSku": "B",
"variantId": 10,
"sizeSku": "Y",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Man 0 speed BROWN",
"variant": "BRUN",
"size": "ONE SIZE",
"stockItemId": 3132,
"ean": "9876543210123",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"countryOfOrigin": "",
"harmCode": "87120030",
"harmDescription": "CYKEL",
"active": 1,
"physicalStock": 141,
"allocatedStock": 10,
"availableStock": 131
}
],
"previous": "?limit=2&page=2",
"next": "?limit=2&page=3"
}
Update stock#
Endpoint: POST *base*/stock
Authentication: API Key
This updates the physicalStock
quantities in Centra. This is the number of products in stock including those that are reserved for orders.
You cannot set the quantity below the number that is reserved for orders, the value specified in allocatedStock
from :ref:Get stock <order-api-get-stock>
. In the case the stock update contains a lower amount than the allocated stock, Centra will set the quantity to allocatedStock
which the lowest possible value without affecting any reserved orders.
The request will not return any error message, but an email notification can be sent to a Centra-administrator from the plugin settings.
Parameters
products
arrayrequiredArray of products to update stock on
product
stringrequiredString to update a product item. Use ean
, upc
or a combination of sku
, variantSku
and sizeSku
to update the quantity for each product.
quantity
intrequiredThe quantity of the physical stock for the item.
costPrice
stringoptionalThe internal cost price for this item.
costPriceCurrency
stringoptionalISO code for the currency for the cost price. USD
, EUR
, SEK
, etc.
xml
booleanoptionalResponse in xml format instead of json.
Request example
The example above uses EAN, this is the same field as the Get stock product field ean
. The example below uses SKU by combining the Get stock fields sku
, variantSku
and sizeSku
:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
POST <base>/stock HTTP/1.1
Content-type: application/json
{
"products": [
{
"product": "12312378901", # <- Combined product number (SKU) "123123" + variant number "789" + size number "01"
"quantity": 54
},
{
"product": "9876543210123", # <- Size-level EAN "9876543210123"
"quantity": 55
},
{
"product": "5432167890123",
"quantity": 1
}
]
}
Optionally you can also include a cost / pcs value for the items.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
POST <base>/stock HTTP/1.1
Content-type: application/json
{
"products":[
{
"product": "1234567890123",
"quantity": 54,
"costPrice": 12.54,
"costPriceCurrency": "SEK"
},
{
"product": "9876543210123",
"quantity": 55,
"costPrice": 8.12,
"costPriceCurrency": "EUR"
},
{
"product": "5432167890123",
"quantity": 1,
"costPrice": 54.24,
"costPriceCurrency": "USD"
}
]
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
msg
stringoptionalIf status
returns no
, this value should send back a message why it failed.
errors
objectoptionalIf status
returns no
, this object might contain information about products that could not be updated.
productsNotFound
array of stringoptionalThis will be an array with the product identifiers that could not be updated from the request.
Like this: ["43242342", "43243294", "432432232"]
productsAreBundles
array of stringoptionalThis will be an array with the product identifiers that are bundled products. This means that they can not be updated directly, since they are based on products the bundle is connected to.
Like this: ["43242342", "43243294", "432432232"]
Response example
1
2
3
{
"status":"ok"
}
Error example
1
2
3
4
5
6
7
8
9
10
{
"status": "no",
"msg": "Some of the products were not updated",
"errors": {
"productsNotFound": [
"9876543210123",
"5432167890123"
]
}
}
List Customers#
Endpoint: GET *base*/customers
Authentication: API Key
Return list of the customers.
Parameters
limit
intoptionalLimit amount of customers returned.
offset
intoptionalOffset how far in to start returning customers.
email
stringoptionalReturn a specific customer.
created
date/datetimeoptionalGet all customers added after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
modified
date/datetimeoptionalGet all customers modified after a certain date. Allowed formats YYYY-mm-dd
and YYYY-mm-dd HH:MM:SS
. Timezone is system-wide and decided by the company using Centra.
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/customers?limit=5&offset=5 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
customers
arrayoptionalArray of customers returned.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
"status": "ok",
"customers": [
{
"customerId": "1",
"email": "max.buch@example.com",
"firstName": "Max",
"lastName": "Buch",
"address1": "",
"address2": "",
"zipCode": "",
"city": "",
"state": "",
"country": "SE",
"phoneNumber": "",
"newsletter": true,
"gender": "",
"registered": false,
"consents": [
{
"key": "test_key1",
"name": "Consent1",
"consented": false,
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ",
"language": "",
"version": "",
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
}
],
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
},
{
"customerId": "6",
"email": "felix.parker@example.com",
"firstName": "Felix",
"lastName": "Parker",
"address1": "",
"address2": "Forest st. 102",
"zipCode": "95131",
"city": "San Jose",
"state": "CA",
"country": "US",
"phoneNumber": "",
"newsletter": false,
"gender": "",
"registered": true,
"consents": [],
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
}
]
}
Get customer#
Endpoint: GET *base*/customers/*customerId*
Authentication: API Key
Return customer by specified ID.
Parameters
customerId
intrequiredThe customerID
from :ref:List customers <order-api-list-customers>
.
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
GET <base>/customers/4234 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
customer
objectrequiredThe customer object.
customerId
stringoptionalID of the customer.
email
stringoptionalEmail for the customer.
address1 address2 zipCode city state
stringoptionalThe address of the customer
country
stringoptionalThe country of the customer. ISO-Alpha-2 (SE
, US
, GB
etc).
consents
arrayoptionalList of consents the customer has accepted. These consents are mostly created from external systems that can select their own data in these fields.
key
stringoptionalThe key for this specific consent.
name
stringoptionalName of consent.
consented
booleanoptionalIf the customer has consented to this or not.
text
stringoptionalThe description of this consent.
language
stringoptionalThe language for this consent. No restrictions on the format of the language code.
created
datetimeoptionalDate when the customer was created.
newsletter
booleanoptionalIf the customer has opt-ed in for newsletters.
modified
datetimeoptionalDate when the customer was modified.
registered
booleanoptionalIf the customer was registered, which means it is allowed to sign in.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
"status": "ok",
"customer": {
"customerId": "4",
"email": "jon.snow@example.com",
"firstName": "Jon",
"lastName": "Snow",
"address1": "Time Square 55",
"address2": "",
"zipCode": "2456",
"city": "Tampa",
"state": "LA",
"country": "US",
"phoneNumber": "096456192",
"newsletter": true,
"gender": "",
"registered": false,
"consents": [
{
"key": "test_key1",
"name": "Consent1",
"consented": true,
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ",
"language": "",
"version": "1",
"created": "2018-03-15 20:40:36",
"modified": "2018-03-15 20:40:36"
},
{
"key": "test_key2",
"name": "Consent2",
"consented": false,
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ",
"language": "EN",
"version": "",
"created": "2018-03-15 20:41:14",
"modified": "2018-03-15 20:41:14"
}
],
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
}
}
Update customer#
Endpoint: PUT *base*/customers/*customerId*
Authentication: API Key
Update customer information.
Parameters
customerId
intrequiredThe customerID
from :ref:List customers <order-api-list-customers>
.
firstName lastName ...
customer objectoptionalThe customer object
xml
booleanoptionalResponse in xml format instead of json.
Request example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
PUT <base>/customers/4234 HTTP/1.1
Content-type: application/json
{
"firstName": "Benjamin",
"lastName": "Simon",
"address1": "",
"address2": "New Address2",
"zipCode": "10500",
"city": "BRIGHTON",
"country": "US",
"state": "CA",
"phoneNumber": "9004505123",
"gender": "",
"consents": [
{
"key": "firts_con",
"consented": true
},
{
"key": "second_con",
"consented": false,
"version": "1.0",
"language": "EN"
}
]
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
customer
objectrequiredCustomer object. The customer object is explained in :ref:Get Customer Parameters <order-api-get-customer-response>
.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{
"status": "ok",
"customer": {
"customerId": "1",
"email": "benjamin.simon@example.com",
"firstName": "Benjamin",
"lastName": "Simon",
"address1": "",
"address2": "New Address2",
"zipCode": "10500",
"city": "BRIGHTON",
"state": "CA",
"country": "US",
"phoneNumber": "9004505123",
"newsletter": true,
"gender": "",
"registered": false,
"consents": [
{
"key": "test_key1",
"name": "Consent1",
"consented": false,
"text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ",
"language": "",
"version": "",
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
},
{
"key": "firts_con",
"name": "",
"consented": true,
"text": "",
"language": "",
"version": "",
"created": "2018-03-21 12:17:54",
"modified": "2018-03-21 12:17:54"
},
{
"key": "second_con",
"name": "",
"consented": false,
"text": "",
"language": "EN",
"version": "1.0",
"created": "2018-03-21 12:17:54",
"modified": "2018-03-21 12:17:54"
}
],
"created": "2018-03-15 20:42:59",
"modified": "2018-03-15 20:42:59"
}
}
Error example
1
2
3
4
{
"status": "no",
"msg": "The customer was not found."
}
Anonymize customer#
Endpoint: PUT *base*/anonymize-customer/*customerId*
Authentication: API Key
This endpoint will anonymize all personal data for a customer identifed by the customer id.
This is irrevocable. Personal data will be permanently deleted. This may include financial data. Invoices due to legal requirements will NOT be anonymized.
Parameters
customerId
intrequiredThe customerID
from :ref:List customers <order-api-list-customers>
.
Request example
PUT <base>/anonymize-customer/123 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
msg
stringoptionalThe response if the anonymization was successful or an error if status
is no
.
Response example
1
2
3
4
{
"status": "ok",
"msg": "The personal data has been anonymized."
}
Error example
If the customer was not found:
1
2
3
4
{
"status": "no",
"msg": "The customer was not found."
}
If the customer was already anonymized:
1
2
3
4
{
"status": "no",
"msg": "The personal data was already anonymized."
}
List supplier orders#
Endpoint: GET *base*/supplier-orders
Authentication: API Key
Get all confirmed supplier orders visible by the plugin.
Parameters
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-orders HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
orders
arrayoptionalArray of orders returned
orderId
stringrequiredID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.
ETD
datetimeoptionalEstimated time of delivery for the customer.
productsQty
intoptionalThe total quantity of products in this supplier order.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{
"status": "ok",
"orders": [
{
"orderId": "957",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 20000
},
{
"orderId": "957",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 10000
}
]
}
Get supplier order#
Endpoint: GET *base*/supplier-orders/*supplierOrderId*
Authentication: API Key
List the products inside a supplier order.
Parameters
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-orders/*supplierOrderId* HTTP/1.1
Response
200
Content-type: application/json
status
booleanrequiredok
if success, else no
.
order
objectrequiredInformation about this specific supplier order.
orderId
stringrequiredID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.
ETD
datetimeoptionalEstimated time of delivery for the customer.
productsQty
intoptionalThe total quantity of products in this supplier order.
products
arrayoptionalThe product items in this supplier order. Most of the fields are described in the :ref:Get stock response <order-api-get-stock-response>
but the following ones are specific to supplier orders:
quantity
intoptionalThe amount of product items ordered.
cost
stringoptionalThe cost / pcs for this item.
costCurrency
stringoptionalThe currency code for the cost / pcs. ISO-Alpha-2 (SE
, US
, GB
etc).
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
"status": "ok",
"order": {
"orderId": "957",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 20000,
"products": [
{
"sku": "12019005",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLACK",
"variant": "SVART",
"size": "ONE SIZE",
"ean": "898989891212",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 122
"cost": "9.40",
"costCurrency": "USD"
},
{
"sku": "12019007",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLUE",
"variant": "BLUE",
"size": "ONE SIZE",
"ean": "898989891213",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 342,
"cost": "12.40",
"costCurrency": "EUR"
}
]
}
}
List supplier deliveries#
Endpoint: GET *base*/supplier-deliveries
Authentication: API Key
Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.
Deliveries will be listed when these requirements are fulfilled:
- Delivery created on a confirmed Supplier Order.
- Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
- Delivery is not accepted yet.
- Delivery has items in it.
Parameters
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-deliveries HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
deliveries
arrayoptionalArray of deliveries returned
id
stringoptionalInternal ID for the supplier order delivery.
deliveryId
stringoptionalID of the supplier order delivery. This is the ID communicated externally.
orderId
stringoptionalID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order delivery was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETD
datetimeoptionalEstimated time of delivery for the customer.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"status": "ok",
"deliveries": [
{
"id": "364",
"orderId": "957",
"deliveryId": "957-1",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 20000
},
{
"id": "365",
"orderId": "957",
"deliveryId": "957-2",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 10000
}
]
}
Get supplier delivery#
Endpoint: GET *base*/supplier-deliveries/*supplierDeliveryId*
Authentication: API Key
Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.
Deliveries will be listed when these requirements are fulfilled:
- Delivery created on a confirmed Supplier Order.
- Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
- Delivery is not accepted yet.
- Delivery has items in it.
Parameters
xml
booleanoptionalResponse in xml format instead of json.
Request example
Both id
and deliveryId
from List supplier deliveries can be used to fetch a supplier delivery.
GET <base>/supplier-deliveries/*supplierDeliveryId* HTTP/1.1
Response
200
Content-type: application/json
status
booleanrequiredok
if success, else no
.
delivery
objectrequiredInformation about this specific supplier order delivery.
id
stringoptionalInternal ID for the supplier order delivery.
deliveryId
stringoptionalID of the supplier order delivery. This is the ID communicated externally.
orderId
stringoptionalID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order delivery was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETD
datetimeoptionalEstimated time of delivery for the customer.
productsQty
intoptionalThe total quantity of products in this supplier order.
products
arrayoptionalThe product items in this supplier order delivery. Most of the fields are described in the :ref:Get stock response <order-api-get-stock-response>
but the following ones are specific to supplier order deliveries:
quantity
intoptionalThe amount of product items attached to this delivery.
cost
stringoptionalThe cost / pcs for this item.
costCurrency
stringoptionalThe currency code for the cost / pcs. ISO-Alpha-2 (SE
, US
, GB
etc).
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
"status": "ok",
"delivery": {
"id": "364",
"orderId": "957",
"deliveryId": "957-1",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 20000,
"products": [
{
"sku": "12019005",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLACK",
"variant": "SVART",
"size": "ONE SIZE",
"ean": "898989891212",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 122
"cost": "9.40",
"costCurrency": "USD"
},
{
"sku": "12019007",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLUE",
"variant": "BLUE",
"size": "ONE SIZE",
"ean": "898989891213",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 342,
"cost": "12.40",
"costCurrency": "EUR"
}
]
}
}
Get supplier delivery details#
Endpoint: GET *base*/supplier-deliveries/*supplierDeliveryId*/details
Authentication: API Key
Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.
Deliveries will be listed when these requirements are fulfilled:
- Delivery created on a confirmed Supplier Order.
- Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
- Delivery is not accepted yet.
- Delivery has items in it.
Parameters
xml
booleanoptionalResponse in xml format instead of json.
Request example
Both id
and deliveryId
from List supplier deliveries can be used to fetch a supplier delivery.
GET <base>/supplier-deliveries/*supplierDeliveryId* HTTP/1.1
Response
200
Content-type: application/json
status
booleanrequiredok
if success, else no
.
delivery
objectrequiredInformation about this specific supplier order delivery.
id
stringoptionalInternal ID for the supplier order delivery.
deliveryId
stringoptionalID of the supplier order delivery. This is the ID communicated externally.
orderId
stringoptionalID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order delivery was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETD
datetimeoptionalEstimated time of delivery for the customer.
productsQty
intoptionalThe total quantity of products in this supplier order.
orders
arrayoptionalThe list of orders that has reserved products for this supplier order delivery.
orderId
stringoptionalThe order ID for the customer order.
accountId
stringoptionalThe account ID for the customer.
accountName
stringoptionalThe name of the account.
buyer
stringoptionalThe name of the buyer from account placing the order.
carrier
stringoptionalThe preferred carrier for this account.
service
stringoptionalThe preferred carrier service for this account.
paymentTerms
stringoptionalThe payment terms defined for this order.
shippingTerms
stringoptionalThe shipping terms defined for this order.
poNumber
stringoptionalPO number used when placing the order.
deliveryName deliveryCompany deliveryEmail deliveryCell deliveryTele deliveryAddress deliveryCoaddress deliveryZipcode deliveryCity deliveryState
stringoptionalThe address the order should be delivered to.
deliveryCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
products
arrayoptionalThe product items in this supplier order delivery. Most of the fields are described in the :ref:Get stock response <order-api-get-stock-response>
but the following ones are specific to supplier order deliveries:
quantity
intoptionalThe amount of product items reserved from this supplier order delivery to the customer order.
cost
stringoptionalThe cost / pcs for this item.
costCurrency
stringoptionalThe currency code for the cost / pcs. ISO-Alpha-2 (SE
, US
, GB
etc).
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"status": "ok",
"delivery": {
"id": "364",
"orderId": "957",
"deliveryId": "957-1",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 20000,
"orders": [
{
"orderId": "83982",
"accountId": "478",
"accountName": "Internal ROW",
"buyer": "Internal ROW, John ",
"carrier": "",
"service": "",
"other": "Other Comment",
"paymentTerms": "30 Net",
"shippingTerms": "Ex. Works",
"poNumber": "Pre Spring 17",
"deliveryName": "John Doe",
"deliveryCompany": "A Company",
"deliveryEmail": "info@example.com",
"deliveryCell": "",
"deliveryTele": "0",
"deliveryAddress": "Skogsgatan 123",
"deliveryCoaddress": "C/O: Warehouse",
"deliveryZipcode": "12345",
"deliveryCity": "Stockholm",
"deliveryState": "0",
"deliveryCountry": "SE",
"products": [
{
"sku": "12019005",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLACK",
"variant": "SVART",
"size": "ONE SIZE",
"ean": "898989891212",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 122
"cost": "9.40",
"costCurrency": "USD"
},
{
"sku": "12019007",
"variantSku": "A",
"sizeSku": "",
"brand": "Kronan",
"collection": "ALL",
"product": "Bike Lady 0 speed BLUE",
"variant": "BLUE",
"size": "ONE SIZE",
"ean": "898989891213",
"upc": "123456",
"weight": 22,
"weightUnit": "kg",
"quantity": 342,
"cost": "12.40",
"costCurrency": "EUR"
}
]
},
{ "orderId": "..."}
]
}
}
Accept supplier delivery#
Endpoint: POST *base*/supplier-deliveries/*supplierDeliveryId*
Endpoint: POST *base*/supplier-deliveries/*supplierDeliveryId*/sku
Authentication: API Key
Will accept the delivery with the proper quantities in the physical delivery. This will be inserted into the preferred warehouse.
This can only be done once per supplier delivery.
It is possible to over deliver or under deliver when accepting the delivery. This will be visible inside Centra when delivery was accepted.
In case of under delivery a new delivery containing the undelivered products will be created.
Parameters
products
objectrequiredKey is from the :ref:Get supplier delivery <order-api-get-supplier-delivery>
and value is the quantity
.
key in object
stringrequiredUse ean
from the :ref:Get supplier delivery <order-api-get-supplier-delivery>
referring to a specific product item in the supplier order delivery.
If the endpoint used is /sku
, the combination of sku
, variantSku
and sizeSku
should be used instead.
Example: {"products":{"1441":2}}
will create a shipment of 2 products from item 1441
.
value in object
intrequiredQuantity of the item that should be accepted.
insertStock
booleanoptionalDefault true
. Flag that defines whether to insert items to warehouse stock.
"insertStock": true
insert items to warehouse stock"insertStock": false
do not insert items to warehouse stock
xml
booleanoptionalResponse in xml format instead of json.
Request example
Both id
and deliveryId
from List supplier deliveries can be used to accept a supplier delivery.
1
2
3
4
5
6
7
8
9
10
POST <base>/supplier-delivery/364 HTTP/1.1
Content-type: application/json
{
"products": {
"73213213123": 32,
"73213213124": 12,
},
"insertStock": false
}
Accept using SKU instead of EAN
Append /sku to the URL and switch from EAN to SKU for the product keys.
1
2
3
4
5
6
7
8
9
POST <base>/supplier-delivery/364/sku HTTP/1.1
Content-type: application/json
{
"products": {
"PRODSKUVARIANTSKUSIZESKU": 32,
"PRODSKUVARIANTSKUSIZESKU2": 12,
}
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
additionalDelivery
objectoptionalIf not all products from the supplier order delivery was accepted, this is the new created delivery for the remaining products of the supplier order delivery.
id
stringoptionalInternal ID for the created supplier order delivery.
deliveryId
stringoptionalID of the supplier order delivery. This is the ID communicated externally.
orderId
stringoptionalID of the supplier order.
supplierCountry
stringoptionalISO-Alpha-2 (SE
, US
, GB
etc).
created
datetimeoptionalThe date this supplier order delivery was created.
ETA
datetimeoptionalEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETD
datetimeoptionalEstimated time of delivery for the customer.
productsQty
intoptionalThe total quantity of products remaining in the accepted supplier order delivery.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"status":"ok",
"additionalDelivery": {
"id": "365",
"orderId": "957",
"deliveryId": "957-2",
"supplierName": "Falca",
"supplierCountry": "ES",
"created": "2019-01-28 01:15",
"ETD": "2019-03-31 15:15",
"ETA": "2019-04-05 20:15",
"message": "Text entered by centra admin",
"productsQty": 19891
}
}
Create voucher#
Endpoint: POST *base*/voucher
Authentication: API Key
This will create a simple voucher of percentoff
or priceoff
type
Parameters
name
stringrequiredName of the voucher.
code
stringoptionalCode of the voucher. Will be generated a random one if not passed.
startDate
stringoptionalStart date of the voucher in Y-m-d
format. Will be set to current one if not passed.
stopDate
stringrequiredStop date of the voucher in Y-m-d
format.
type
enumrequiredType of the voucher. One of percentoff
or priceoff
value
floatoptionalValue of the voucher. Is required if percentoff
is a voucher type
valueByPricelist
objectoptionalValues by pricelist of the voucher, where price list ID is a key and discount is a value. Is required if priceoff
is a voucher type.
store
intrequiredStore id for voucher
markets
int|arrayrequiredMarkets for voucher
limit
intoptionalLimit of the voucher usage, where 0
means unlimited. Is 0
if not passes.
status
booleanrequiredIs voucher active
or inactive
conversionHtml
stringoptionalConversion html of the voucher
Request examples
1
2
3
4
5
6
7
8
9
10
11
POST <base>/voucher HTTP/1.1
{
"name": "Welcome 10%",
"stopDate": "2022-07-09",
"type": "percentoff",
"value": 10,
"store": 1,
"markets": 1,
"status": true
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
POST <base>/voucher HTTP/1.1
{
"name": "Welcome!",
"stopDate": "2022-07-09",
"type": "priceoff",
"valueByPricelist": {
"19": 100,
"20": 10
},
"store": 1,
"markets": 1,
"status": true
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
voucher
intoptionalID of a created voucher
code
stringoptionalCode of a created voucher
Response example
1
2
3
4
5
{
"status": "ok",
"voucher": 13,
"code": "quooquadi_t6uqwecifin"
}
Errors example
Required fields are not passed
1
2
3
4
5
6
7
8
9
10
11
{
"status": "no",
"msg": {
"name": "required",
"stopDate": "required",
"type": "required",
"store": "required",
"markets": "required",
"status": "required"
}
}
Market does not exist for a provided store
1
2
3
4
5
6
{
"status": "no",
"msg": {
"markets": "Market 2 not found."
}
}
Neither value
nor valueByPricelist
provided
1
2
3
4
5
6
{
"status": "no",
"msg": {
"value": "One of 'value' or 'valueByPricelist' should be provided."
}
}
Clone voucher#
Endpoint: PUT *base*/voucher/*id*/clone
Authentication: API Key
This will clone a voucher with updated provided information
Parameters
name
stringoptionalName of the voucher.
code
stringoptionalCode of the voucher. Will be generated a random one if not passed.
stopDate
stringrequiredStop date of the voucher in Y-m-d
format.
conversionHtml
stringoptionalConversion html of the voucher
Request example
1
2
3
4
5
6
7
PUT <base>/voucher/3/clone HTTP/1.1
{
"name": "Welcome 10%",
"code": "new-welcome-10",
"stopDate": "2022-07-09"
}
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
voucher
intoptionalId of a new voucher
code
stringoptionalCode of a new voucher
Response example
1
2
3
4
5
{
"status": "ok",
"voucher": 4,
"code": "new-welcome-10"
}
Errors example
Required fields are not passed
1
2
3
4
5
6
7
{
"status": "no",
"voucher": "4",
"msg": {
"stopDate": "required"
}
}
Voucher not found
1
2
3
4
5
6
7
{
"status": "no",
"voucher": "3",
"msg": {
"voucher": "Voucher not found"
}
}
Auto vouchers not supported
1
2
3
4
5
6
7
{
"status": "no",
"voucher": "3",
"msg": {
"voucher": "Auto vouchers not supported"
}
}
Voucher does not belong to this store
1
2
3
4
5
6
7
{
"status": "no",
"voucher": "3",
"msg": {
"voucher": "Voucher does not belong to this store"
}
}
Get voucher#
Endpoint: GET *base*/vouchers/*id*
Authentication: API Key
Return active/inactive voucher by specified ID. Cancelled vouchers are ignored.
Parameters
id
intrequiredVoucher id.
xml
booleanoptionalResponse in xml format instead of json.
Request example
GET <base>/vouchers/1 HTTP/1.1
Response
200
Content-type: application/json
status
stringrequiredok
if success, else no
.
voucher
objectrequiredThe voucher object.
id
intoptionalID of the voucher.
name
stringoptionalName for the voucher.
code
stringoptionalCode of the voucher
startDate
dateoptionalThe date in Y-m-d
format when the voucher starts being active
stopDate
dateoptionalThe date in Y-m-d
format when the voucher stops being active
type
stringoptionalType of the voucher e.g. priceoff
, percentoff
value
floatoptionalValue of the voucher. Exists for percentoff
voucher type
valueByPrcelist
objectoptionalValue of the voucher for each price list. Contains id of price list to value. Exists for priceoff
voucher type
store
intoptionalStore the voucher is valid for
markets
arrayoptionalList of the markets voucher is valid for
limit
intoptionalThe voucher max usage limit
status
stringoptionalStatus of the voucher. One of active
, inactive
priority
intoptionalThe voucher priority
conversionHtml
stringoptionalConversion html for voucher
createdAt
datetimeoptionalThe date in Y-m-d H-i-s
format when the voucher was created.
Response example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"status": "ok",
"voucher": {
"id": 1,
"name": "Welcome 10%",
"code": "welcome10",
"conversionHtml": "",
"startDate": "2020-06-26",
"stopDate": "2020-07-09",
"type": "percentoff",
"value": "10",
"store": 1,
"markets": [
1
],
"limit": 1,
"status": "active",
"priority": 1,
"createdAt": "2020-06-25 12:00:00"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
"status": "ok",
"voucher": {
"id": 1,
"name": "Welcome 10",
"code": "welcome10",
"conversionHtml": "",
"startDate": "2020-06-26",
"stopDate": "2020-07-09",
"type": "priceoff",
"value": null,
"valueByPricelist": {
"1": 10,
"2": 44,
"3": 13,
"4": 130,
},
"store": 1,
"markets": [
1
],
"limit": 1,
"status": "active",
"priority": 1,
"createdAt": "2020-06-25 12:00:00"
}
}