API Reference
Create 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 addressobjectoptionalFor 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.
emailstringrequiredCustomer e-mail
firstName lastNamestringoptionalCustomer name
tele cellstringoptionalCustomer telephone / cellphone
attnstringoptionalAttention (addressing memorandum)
address coaddress city zipcodestringoptionalStreet Address
statestringoptionalCountry state, might be required by the country
countrystringrequiredISO-Alpha-2 (SE, US, GB etc)
pricelistIdintoptionalID of pricelist to use for the order, if not provided, the pricelist for the current country will be used.
priceliststringoptionalName 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.
marketIdintoptionalID of the market to use for the order. If not provided, the market for the current country will be used.
marketstringoptionalName 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.
customerRegisterbooleanoptionalDefault 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.
customerIdintoptionalIf 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.
customerSetNewPasswordbooleanoptionalDefault 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.
createdFromOriginobjectoptionalSpecifies the origin that the order was created from. If used, it needs to refer to an internal object in Centra.
typestringrequiredType of origin the order was created from. Allowed types: return,
order and plugin
idintrequiredID of internal origin of the origin type. If Return #123 was used to create
the order, id should be 123.
extraAttributesobjectoptionalObject for sending in custom order attributes.
attributeName_elementNameanyoptionalList of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.
accountIdintoptionalAccount ID for B2B-customer. Required if order is placed for B2B.
buyerIdintoptionalBuyer ID for B2B-customer. If not provided, the default buyer of the account will be used.
buyerNamestringoptionalName of the buyer that placed the order.
deliveryWindowstringoptionalName 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.
productsobjectrequiredContains the products for the order.
qtyintrequiredQuantity ordered for this product.
idintoptionalID specific to the product size. Either id, ean or sku must be
used.
eanstringoptionalEAN of product item. Either id, ean or sku must be used.
skustringoptionalSKU 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.
unitPricedecimal2 (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.
originalPricedecimal2 (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.
commentstringoptionalA 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.
itemTextobjectoptionalAbility to define every column specifying the product information. Very useful when importing old orders for products not in Centra.
skustringoptionalThe SKU for this product.
brandstringoptionalThe Brand name for this product.
productstringoptionalProduct name.
variantstringoptionalThe variant name of the product.
sizestringoptionalThe 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.
localizedProdSizeobjectoptionalThe localized size information for this product size. It contains the
localized size localizedSize and localized size chart name
localizationDefinitionName.
shippingListstringoptionalShipping option URI, for example: ups-standard, without this one, the
default shipping option for the products and country will be used.
shippingValuedecimal2 (0.00)optionalShipping cost, for example: 12.43, without this one, the default shipping
cost for the products and country will be used.
voucherValuedecimal2 (0.00)optionalVoucher value, should be a positive value or zero, even though the value ends up reducing the order value.
orderNumberintoptionalExplictly set the order number for the order. Will only work if the order does not already exist in Centra.
sendEmailbooleanoptionalSend order confirmation or not, if not provided, the store settings will be used.
adjustStockbooleanoptionalDefault 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.
forceCreatebooleanoptionalDefault false. Create the order even though products did not exist. These
products will be marked as back ordered.
commentstringoptionalText to place inside the "Other Information" field. Might show up on pack-lists and delivery notes depending on store settings.
internalCommentstringoptionalText for the "Internal comment"-field. Will only be shown internally in Centra.
poNumberstringoptionalPO number used when placing the order. Will be visible on delivery notes and invoices.
orderDatedate/datetimeoptionalThe time when the order was placed. Timezone is based on the location of the organization's Centra settings.
deliveryDatedate/datetimeoptionalExpected time of delivery.
cancelDatedate/datetimeoptionalDate when order should be cancelled if not confirmed.
warehouseGroupstringoptionalUsed to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.
createOnlybooleanoptionalDefault false. Only prepare the order with all data, can be finalized later using :doc:completeOrder </reference/stable/order-api/complete-order>.
internalOrderbooleanoptionalDefault false. Mark the order as internal, will show up in reports as an
internal order.
paymentobjectoptionalWill contain information that should be inserted in regards to how the payment was handled outside of Centra.
idintrequiredThe ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.
auth / captureobjectoptionalInformation 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.
responsestringoptionalThe response string from the payment type. Will be shown verbose inside Centra.
statusintrequiredIf the authorization/capture went through or not. 0 means pending, 1
means success, 2 means failed.
transactionstringoptionalThe transaction ID of the authorization/capture.
methodstringoptionalWill be shown on reports to summarize what payment method was used.
amountdecimal2 (0.00)requiredThe amount that was authorized.
external_urlstringoptionalIf an external invoice was created, insert the URL to the invoice here.
applyVouchersbooleanoptionalDefault true. If Centra should calculate the voucher value depending on
automatic voucher rules.
voucherCodesarrayoptionalArray of voucher codes to apply on the order.
Request example
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
statusstringrequiredok if success, else no.
orderintoptionalWill return if createOnly was set as true.
ordersarray 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.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response examples
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok",
"orders": [
1234
]
}
If createOnly is set to true, the response looks like this:
{
"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 |
{
"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
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.
statusstringrequiredok if success, else no.
orderntoptionalWill return if createOnly was set as true.
ordersarray 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.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response examples
{
"x123": {
"status": "ok",
"orders": [1234]
},
"a1": {
"status": "ok",
"orders": [1235]
}
}
Response if createOnly is true:
{
"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 |
{
"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:
{
"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.
paymentobjectoptionalb2b b2cWill contain information that should be inserted in regards to how the payment was handled outside of Centra.
idintrequiredThe ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.
auth captureobjectoptionalInformation about the authorization and capture of the order. Authorization was the reservation of the order, capture is when the value also has been charged.
responsestringoptionalThe response string from the payment type. Will be shown verbose inside Centra.
statusintrequiredIf the authorization/capture went through or not. 0 means pending, 1
means success, 2 means failed.
transactionstringoptionalThe transaction ID of the authorization/capture.
methodstringoptionalWill be shown on reports to summarize what payment method was used.
amountdecimal2 (0.00)requiredThe amount that was authorized.
external_urlstringoptionalIf an external invoice was created, insert the URL to the invoice here.
buyerNamestringoptionalb2bName of the buyer that placed the order.
internalCommentstringoptionalText for the "Internal comment"-field. Will only be shown internally in Centra.
poNumberstringoptionalb2bPO number used when placing the order. Will be visible on delivery notes and invoices.
orderDatedate/datetimeoptionalThe time when the order was placed. Timezone is based on the location of the organization's Centra settings.
deliveryDatedate/datetimeoptionalExpected time of delivery.
cancelDatedate/datetimeoptionalDate when order should be cancelled if not confirmed.
warehouseGroupstringoptionalUsed to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
POST <base>/order/123 HTTP/1.1
Content-type: application/json
{
"comment": "Completed order, here is a comment"
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
ordersarray of stringrequiredList of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"orders": ["44"],
"status": "ok"
}
Error example
{
"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
limitintoptionalLimit amount of orders returned. Default: 20.
offsetintoptionalOffset how far in to start returning orders.
orderintoptionalReturn a specific order.
customer_idintoptionalReturn orders for specified customer id.
newer_thandate/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_thandate/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.
xmlbooleanoptionalResponse 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
statusstringrequiredok if success, else no.
ordersarrayrequiredArray of orders returned.
orderIdstringrequiredID of the order.
orderStatusstringrequiredStatus of the order.
selectionIdstringrequiredSelection ID of the order.
orderDatedatetimerequiredDate when order was created.
productsarrayrequiredProducts inside the order.
lineIdstringrequiredID of the specific product item in this order.
qtyintrequiredQuantity of this specific product item.
isBundlebooleanrequiredFlag showing if product is bundle
isPartOfBundleintrequiredBundle id
bundlearrayrequiredArray of containing items for bundle
localizedSizeobjectrequiredThe localized size information for this product size. It contains the
localized size localizedSize and localized size chart name
localizationDefinitionName.
taxBreakdownarrayrequiredLists all tax rules applied to the order.
descriptionstringrequiredText description of tax rule. ex: VAT
taxPercentfloatrequiredPercentage of tax. ex 25
valuefloatrequiredHow much tax. ex 20
paymentPluginstringrequiredPayment plugin type, e.g. adyen_drop_in, klarna_checkout_v1, paypal_v1,
etc.
paymentTypestringrequiredPayment 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
paymentDescriptionstringrequiredPayment method description from plugin configuration.
paymentReferencestringrequiredPayment reference ID from external service provider. Can be null.
paymentMethodstringrequiredPayment method ID - unique name of payment provider. Can be null.
Response example
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
orderintrequiredOrder ID to update.
internalCommentstringoptionalAppend some text to the internal comment field.
replaceInternalCommentbooleanoptionalDefault false. Replace the full content of the internal comment field with
the internalComment.
commentstringoptionalAppend some text to the comment field.
replaceCommentbooleanoptionalDefault false. Replace the full content of the comment field with the
comment.
extraAttributesobjectoptionalObject for sending in custom order attributes.
attributeName_elementNameanyoptionalList of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
PUT <base>/orders HTTP/1.1
Content-type: application/json
{
"order": 83651,
"internalComment": "test"
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
orderintrequiredOrder ID that was updated
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"status": "ok",
"order": 83651
}
Error example
{
"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
orderintrequiredOrder ID to create shipment on.
productsobjectrequiredKey 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 objectstringrequiredlineID from the Get orders response referring to a
specific product item in the order.
value in objectintrequiredQuantity of the item that should be shipped.
gtgbooleanoptionalDefault: false. Mark the shipment as good to go.
capturebooleanoptionalDefault: 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.
shippedbooleanoptionalMark the shipment as sent. Default: false.
carrierstringoptionalCarrier used for shipping. Only used if shipped is true.
servicestringoptionalService level used for shipping. Only used if shipped is true.
packagesintoptionalNumber of packages in shipment. Only used if shipped is true.
trackingstringoptionalTracking number for shipment. Only used if shipped is true.
returnSlipTrackingstringoptionalReturn slip tracking number for shipment. Only used if shipped is
true.
sendEmailbooleanoptionalDecide 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.
deductPreviousCostsbooleanoptionalUsed 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.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
POST <base>/shipments HTTP/1.1
Content-type: application/json
{
"order": 83651,
"products": {
"43243": 1,
"43244": 2
}
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
orderintrequiredOrder ID that the shipment was created on.
shipmentstringrequiredThe shipment ID for the create shipment.
deliveryNotestringoptionalURL to a PDF delivery note for the shipment.
proformastringoptionalURL to a PDF proforma for the shipment.
invoicestringoptionalURL to a PDF invoice for the shipment. Will only be set if an invoice exists.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
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
{
"status": "no",
"msg": "order does not exist",
"order": "1337"
}
{
"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
limitintoptionalLimit amount of shipments returned. For statuses inprogress and completed
a positive value between 1 and 100.
orderintoptionalReturn shipments for a specific order.
xmlbooleanoptionalResponse in xml format instead of json.
offsetintoptionalOffset how far in to start returning orders.
statusstringoptionalDefault value: goodtogo. Allowed values: inprogress, goodtogo,
completed
newer_thandate/datetimeoptionalOnly return shipments newer than provided date
older_thandate/datetimeoptionalOnly return shipments older than provided date
Request example
GET <base>/shipments?limit=5 HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
shipmentsarrayrequiredArray of shipments returned.
orderIdstringrequiredID of the order.
shipmentIdstringrequiredID of the shipment.
selectionIdstringrequiredSelection ID of the order.
orderDatedatetimerequiredDate when order was created.
shouldCapturebooleanrequiredIf the shipment needs to be captured before being shipped.
deliveryNotestringoptionalURL to a PDF delivery note for the shipment.
shippingTermsobjectoptionalShipping Terms object selected on this shipment.
idintrequiredId of the specific shipping terms object.
namestringrequiredName of the specific shipping terms object.
descriptionstringrequiredDescription of the specific shipping terms object.
paymentTermsobjectoptionalPayment Terms object selected on this shipment.
idintrequiredID of the specific payment terms object.
namestringrequiredName of the specific payment terms object.
descriptionstringrequiredDescription of the specific payment terms object.
proformastringoptionalURL to a PDF proforma for the shipment.
defaultCarrierstringoptionalName of the carrier for this shipment.
deliveryServicestringoptionalName of the delivery service for this shipment.
invoicesarrayoptionalURLs to PDF invoices for the shipment. Will only be set if any invoices exists.
productsarrayoptionalProducts inside the shipment.
lineIdstringrequiredID of the specific product item in this shipment.
qtyintrequiredQuantity of this specific product item.
isBundlebooleanrequiredFlag showing if product is bundle
isPartOfBundleintrequiredBundle id
bundlearrayrequiredArray of containing items for bundle
taxBreakdownarrayrequiredLists all tax rules applied to the order.
descriptionstringrequiredText description of tax rule. ex: VAT
taxPercentfloatrequiredPercentage of tax. ex 25
valuefloatrequiredHow much tax. ex 20
Response example
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
shipmentIdstringrequiredThe ID from shipment when creating or updating a shipment.
gtgbooleanoptionalDefault 0. Update shipment with Good to Go.
productsobjectoptionalKey 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 objectstringrequiredlineID from the Get orders response referring to a
specific product item in the order.
value in objectintrequiredQuantity of the item that should be set for the shipment.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
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
{
"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
{
"status": "no",
"msg": "shipment is sent and can not be updated",
"shipment": "4-1"
}
{
"status": "no",
"msg": "shipment is paid and can not be updated",
"shipment": "4-1"
}
{
"status": "no",
"msg": "shipment is captured and can not be updated",
"shipment": "4-1"
}
{
"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
orderintrequiredOrder ID to which the shipment belongs.
shipmentintrequiredShipment ID for the shipment to complete.
capturebooleanrequiredDefault: true. Try to capture the order. Ignored if the capture was
already made earlier for the shipment.
gtgbooleanrequiredGood-to-go. Indicates the items are packed and ready to leave the Warehouse. Required for shipment to complete.
shippedbooleanrequiredIndicates the items have been shipped. Required for shipment to complete.
carrierstringoptionalCarrier used for shipping.
servicestringoptionalService level used for shipping.
packagesintoptionalNumber of packages in shipment.
trackingstringoptionalTracking number for shipment.
returnSlipTrackingstringoptionalReturn slip tracking number for shipment.
sendEmailbooleanoptionalDecide if Shipping Confirmation e-mail should be sent. If not defined, Store setting "Send Shipping Confirmation" will be used instead.
internalCommentstringoptionalAppend some text to internal comment field.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
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
statusstringrequiredok if success, else no.
orderintrequiredOrder ID that was completed.
shipmentstringrequiredShipment ID that was completed.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"status": "ok",
"order": 83651,
"shipment": "83651-1"
}
Error example
{
"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
shipmentstringrequiredb2b b2cThe shipmentId from Get shipments or Create
shipment.
xmlbooleanoptionalb2b b2cResponse in xml format instead of json.
Request example
PUT <base>/capture HTTP/1.1
Content-type: application/json
{
"shipment": "83651-1"
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
orderintrequiredOrder ID that was captured.
shipmentstringrequiredOShipment ID that was captured.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"status": "ok",
"order": 83651,
"shipment": "83651-1"
}
Error example
{
"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
shipmentIdstringoptionalThe shipmentId from Get shipments or Create
shipment.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
DELETE <base>/shipments/*shipmentId* HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
orderintrequiredOrder ID for the shipment that was deleted.
shipmentstringrequiredShipment ID for the shipment that was deleted.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"status": "ok",
"msg": "shipment removed",
"order": 8,
"shipment": "8-1"
}
Error example
{
"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
orderNumberintrequiredOrder ID to update the Check first.
warehouseIdintrequiredWarehouse ID associated with the Check first order.
acceptedboolrequiredWhether to accept or reject the Check First warehouse. true to accept,
false to reject.
Request example
POST <base>/check-first HTTP/1.1
Content-type: application/json
{
"orderNumber": 123,
"warehouseId": 321,
"accepted": true
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
msgstring|objectoptionalIf status returns no, this value should send back a message why it
failed.
orderNumberstringoptionalError message describing an issue with the provided order number.
warehouseIdstringoptionalError message describing an issue with the provided warehouse id.
acceptedstringoptionalError message describing an issue with the provided accepted value.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"status": "ok"
}
Error examples
{
"status": "no",
"msg": {
"orderNumber": "invalid value",
"warehouseId": "required",
"accepted": "invalid value"
}
}
{
"msg": "order does not exist",
"status": "no"
}
{
"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
idintrequiredAllocation request ID.
statusstringrequiredWhether to accept or reject the allocation request for warehouse. Accepted
values:confirmed to accept, rejected to reject.
Request example
PUT <base>/allocation-request HTTP/1.1
Content-type: application/json
{
"id": 67,
"status": "confirmed"
}
Response
200 Content-type: application/json
statusstringrequiredtrue if success. false if failed.
errorMessagesarrayoptionalIf status returns false, this value will be not empty with a message
why it failed.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"success": true,
"errorMessages": []
}
Error examples
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"You can't update allocation request, which is in status confirmed."
]
}
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"You can't update allocation request, which is in status rejected."
]
}
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"Allocation request not found"
]
}
{
"success": false,
"errorMessages": [
"Warehouse doesn't have sufficient stock to allocate the request."
]
}
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": [
"Failed to allocate stock from the warehouse."
]
}
HTTP/1.1 200 OK
Content-type: application/json
{
"success": false,
"errorMessages": {
"status": "invalid value, expected 'confirmed' or 'rejected'"
}
}
Missing access to endpoint:
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
statusstringoptionalBy 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.
orderintoptionalShow allocation requests for a specific order number. Also accepts a comma-separated list of numbers.
warehouseintoptionalShow allocation requests for a specific warehouse ID. Also accepts a comma-separated list of IDs.
pageintoptionalPage 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
statusstringrequiredok if success. no if failed.
errorMessagesarrayoptionalIf status returns no, this value will be not empty with a message why
it failed.
allocation_requestsarrayoptionalArray with allocation requests json objects.
Response example
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:
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:
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
shipmentstringrequiredThe shipmentId from Get shipments or Create
shipment.
productsobjectoptionalKey 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 objectstringrequiredlineID from the Get shipments referring to a specific
product item in the order.
value in objectintrequiredQuantity of the item that should be returned.
returnStockbooleanoptionalInsert returned items into stock. If not provided Default stock action on return setting on the store will be used.
handlingCostfloatoptionalHandling cost.
handlingCostFromShipmentbooleanoptionalDefault false. Set to true to use Handling cost from Shipment. You cannot
provide handlingCost at the same time this option is used.
shippingCostfloatoptionalShipping cost.
shippingCostFromShipmentbooleanoptionalDefault false. Set to true to use Shipping cost from Shipment. You cannot
provide shippingCost at the same time this option is used.
returnCostfloatoptionalReturn cost. If the return itself should have a cost to it. Providing a value here will deduct the amount of money to refund.
voucherValuefloatoptionalVoucher value, should always be positive value.
voucherValueFromShipmentbooleanoptionalDefault false. Set to true to use Voucher value from Shipment. You cannot
provide voucherValue at the same time this option is used.
commentstringoptionalAdditional comment for return, for reference.
xmlbooleanoptionalResponse in xml format instead of json.
createdAtdate/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.
refundobjectoptionalRefund object.
Example: {"refund":{"refundPayment": true}} will make refund from return.
refundPaymentbooleanoptionalIf 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.
sendEmailbooleanoptionalSend refund email. Default value is false.
Request example
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
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
statusstringrequiredok if success, else no.
orderintoptionalOrder ID that was captured.
returnintoptionalReturn ID that was created.
returnCompletedbooleanoptionalIf the return was completed directly on creation, this can only happen if a successful refund was made when return was created.
returnedItemsarrayoptionalArray of Line IDs of returned Products.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"status": "ok",
"return": 5397,
"returnCompleted": false,
"returnedItems": ["268871"]
}
Response example including refund
{
"status": "ok",
"return": 5397,
"returnCompleted": true,
"returnedItems": ["268871"],
"refund": {
"status": "ok"
}
}
Error example
{
"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
limitintoptionalLimit the number of returns returned.
pageintoptionalNumber of page of results to return.
returnintoptionalOnly show a return with given ID.
shipmentstringoptionalOnly show a return with given shipment number.
orderintoptionalOnly fetch returns for a specific order.
selectionintoptionalOnly fetch returns for a specific selection.
customer_idintoptionalOnly fetch returns for a specific customer.
newer_thandate/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_thandate/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.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/returns?limit=2 HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
returnsarrayrequiredArray of fetched returns.
returnIdintrequiredID of the return.
completedbooleanrequiredWhether the return was completed or not.
shipmentstringrequiredNumber of the shipment.
shipmentIdintrequiredID of the shipment.
orderIdintrequiredID of the order.
selectionIdstringrequiredSelection ID of the order.
customerIdintrequiredCustomer ID of the order.
datedatetimerequiredDate when return was created.
returnCostfloatrequiredCost of the return.
shippingCostfloatrequiredCost of shipping returned.
handlingCostfloatrequiredHandling cost of the return.
voucherValuefloatrequiredVoucher value included in the return.
taxValuefloatrequiredTax value of the return, zero if deducted.
taxDeductionfloatrequiredTax deduction in the return.
currencystringrequiredCurrency code in which order and also return was made.
baseCurrencyRatefloatrequiredExchange rate between currency and baseCurrency above.
returnToStockbooleanrequiredWhether the return was marked as returned back to stock.
commentstringrequiredOptional description added to the return.
createdFromstringrequiredInforms where this return originated, i.e. "Order API".
productsarrayrequiredProducts inside the return.
returnLineIdintrequiredID of the specific product item in this return.
shipmentLineIdintrequiredID of the related shipment line.
orderLineIdintrequiredID of the related order line.
productIdintrequiredID of the product.
variantIdintrequiredID of the product variant.
productNamestringrequiredName of the product.
productBrandstringrequiredBrand name of the product.
variantNamestringrequiredName of the product variant.
sizestringrequiredSize description, if any.
skustringrequiredProduct SKU.
variantSkustringrequiredProduct variant SKU.
sizeSkustringrequiredSize SKU.
eanstringrequiredEAN of the item.
upcstringrequiredUPC of the item.
upcstringrequiredUPC of the item.
quantityintrequiredQuantity of this specific product item returned.
pricefloatrequiredUnit price as seen on shipment.
Response example
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
returnIdstringrequiredThe ID from return when creating or updating a return.
completedbooleanoptionalSet to true/false to change Return status to Complete/Pending.
refundPaymentbooleanoptionalIf 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.
sendEmailbooleanoptionalSend refund email. Default value is false.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
PUT <base>/returns/2 HTTP/1.1
Content-type: application/json
{
"completed": true
}
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
returnobjectrequiredObject of fetched return.
returnIdintrequiredID of the return.
completedbooleanrequiredWhether the return was completed or not.
shipmentstringrequiredNumber of the shipment
shipmentIdintrequiredID of the shipment
orderIdintrequiredID of the order
selectionIdstringrequiredSelection ID of the order
customerIdintrequiredSelection ID of the order
datedatetimerequiredDate when return was created.
returnCostfloatrequiredCost of the return.
shippingCostfloatrequiredCost of shipping returned
handlingCostfloatrequiredHandling cost of the return.
voucherValuefloatrequiredVoucher value included in the return.
taxValuefloatrequiredTax value of the return, zero if deducted.
taxDeductionfloatrequiredTax deduction in the return.
currencystringrequiredCurrency code in which order and also return was made.
baseCurrencystringrequiredCode of the currency used as base in this store.
baseCurrencyRatefloatrequiredExchange rate between currency and baseCurrency above.
returnToStockbooleanrequiredWhether the return was marked as returned back to stock.
commentstringrequiredOptional description added to the return.
createdFromstringrequiredInforms where this return originated, i.e. "Order API".
productsarrayrequiredProducts inside the return.
returnLineIdintrequiredID of the specific product item in this return.
shipmentLineIdintrequiredID of the related shipment line.
orderLineIdintrequiredID of the related order line.
productIdintrequiredID of the product.
variantIdintrequiredID of the product variant.
productNamestringrequiredName of the product.
productBrandstringrequiredBrand name of the product.
variantNamestringrequiredName of the product variant.
sizestringrequiredSize description, if any.
skustringrequiredProduct SKU.
variantSkustringrequiredProduct variant SKU.
sizeSkustringrequiredSize SKU
eanstringrequiredEAN of the item.
upcstringrequiredUPC of the item.
upcstringrequiredUPC of the item.
quantityintrequiredQuantity of this specific product item returned.
pricefloatrequiredUnit price as seen on shipment
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
Response example
{
"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
{
"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
skustringoptionalGet products with a specific SKU.
modifieddate/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.
createddate/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.
eanstringoptionalGet a product with specified EAN code.
productId variantId stockItemIdintoptionalFilter products based on product, variant and stock item IDs.
limitintoptionalYou 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.
includestringoptionalinclude=attributes will also make the products include the custom
attributes defined for each product and variant.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/products HTTP/1.1
Content-type: application/json
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
productsarrayrequiredList of the products.
productsarrayrequiredList of the products.
skustringrequiredSKU for this product.
productstringrequiredThe internal name for this product.
productIdintrequiredID for this product.
namestringrequiredThe externally facing name for this product.
variantSkustringrequiredSKU for this variant.
variantIdintrequiredID for this variant.
sizeSkustringrequiredSKU for this size.
stockItemIdintrequiredID for this specific stock item.
eanstringrequiredThe EAN for this product item size.
weightdecimal2 (0.00)requiredThe weight specified for this product.
weightUnitstringrequiredThe unit used for the weight. * kg * lb
sizestringrequiredName of the size for this specific product item.
activebooleanrequiredIf the product item is active or not.
folderstringrequiredString with names of the folders the product belongs to.
Like this: Collection / Jackets.
countryOfOriginstringrequiredISO-Alpha-2 (SE, US, GB etc)
storestringrequiredStore name product is related to.
categoriesarray|stringrequiredArray with names of the categories the product belongs to.
Like this: ["Collection / Jackets\/Outerwear", "...">.
imagesarray|stringrequiredURLs with the images connected to this product item.
Like this: ["https://xxx.centracdn.net/x/y/z.jpg", "https://..."].
pricesarrayrequiredArray of the pricelists for this product.
idintrequiredID of the pricelist.
priceliststringrequiredName of the pricelist.
pricestringrequiredPrice for the product in this pricelist.
currencystringrequiredISO code of the currency for this pricelist.
campaignsarrayrequiredList of campaigns this product is connected to in this pricelist.
idintrequiredID of the campaign.
campaignstringrequiredName of the campaign.
pricedecimal2 (0.00)requiredThe price when this campaign is applied to the price. Currency will always be the same as in the pricelist.
previousstringoptionalWill contain a URL to the previous page.
nextstringoptionalWill contain a URL to the next page.
Response example
{
"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
skustringoptionalGet products with a specific SKU.
modifieddate/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_modifieddate/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.
createddate/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.
eanstringoptionalGet a product with specified EAN code.
upcstringoptionalGet a product with specified UPC code.
productId variantId stockItemIdintoptionalGet a product with specified productId, variantId or stockItemId.
limitintoptionalYou 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.
includestringoptionalinclude=attributes will also make the products include the custom
attributes defined for each product and variant.
excludestringoptionalexclude=physicalStock will exclude fetching physical stock which will
speed up the fetching of the stock values.
xmlbooleanoptionalResponse 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
statusstringrequiredok if success, else no.
productsarrayrequiredList of the products.
skustringrequiredSKU for this product.
productstringrequiredThe internal name for this product.
productIdintrequiredThe ID for this product.
variantSkustringrequiredSKU for this variant.
variantIdintrequiredID for this variant.
sizeSkustringrequiredSKU for this size.
stockItemIdintrequiredID for this specific stock item.
eanstringrequiredThe EAN for this product item size.
upcstringrequiredThe UPC for this product item size.
weightdecimal2 (0.00)requiredThe weight specified for this product.
weightUnitstringrequiredThe unit used for the weight. * kg * lb
sizestringrequiredName of the size for this specific product item.
activebooleanrequiredIf the product item is active or not.
countryOfOriginstringrequiredISO-Alpha-2 (SE, US, GB etc)
physicalStockintrequiredThe 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
allocatedStockintrequiredThe amount of items in the physical stock that is currently allocated against orders.
availableStockintrequiredThe amount of items in the physical stock that is currently available to sell.
previousstringoptionalWill contain a URL to the previous page.
nextstringoptionalWill contain a URL to the next page.
Response example
{
"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
productsarrayrequiredArray of products to update stock on
productstringrequiredString to update a product item. Use ean, upc or a combination of
sku, variantSku and sizeSku to update the quantity for each
product.
quantityintrequiredThe quantity of the physical stock for the item.
costPricestringoptionalThe internal cost price for this item.
costPriceCurrencystringoptionalISO code for the currency for the cost price. USD, EUR, SEK, etc.
xmlbooleanoptionalResponse 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:
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.
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
statusstringrequiredok if success, else no.
msgstringoptionalIf status returns no, this value should send back a message why it
failed.
errorsobjectoptionalIf status returns no, this object might contain information about
products that could not be updated.
productsNotFoundarray of stringoptionalThis will be an array with the product identifiers that could not be updated from the request.
Like this: ["43242342", "43243294", "432432232">
productsAreBundlesarray 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
{
"status": "ok"
}
Error example
{
"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
limitintoptionalLimit amount of customers returned.
offsetintoptionalOffset how far in to start returning customers.
emailstringoptionalReturn a specific customer.
createddate/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.
modifieddate/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.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/customers?limit=5&offset=5 HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
customersarrayrequiredArray of customers returned.
Response example
{
"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
customerIdintrequiredThe customerID from :ref:List customers <order-api-list-customers>.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/customers/4234 HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
customerobjectrequiredThe customer object.
customerIdstringrequiredID of the customer.
emailstringrequiredEmail for the customer.
address1 address2 zipCode city statestringrequiredThe address of the customer
countrystringrequiredThe country of the customer. ISO-Alpha-2 (SE, US, GB etc).
consentsarrayrequiredList of consents the customer has accepted. These consents are mostly created from external systems that can select their own data in these fields.
keystringrequiredThe key for this specific consent.
namestringrequiredName of consent.
consentedbooleanrequiredIf the customer has consented to this or not.
textstringrequiredThe description of this consent.
languagestringrequiredThe language for this consent. No restrictions on the format of the language code.
createddatetimerequiredDate when the customer was created.
newsletterbooleanrequiredIf the customer has opt-ed in for newsletters.
modifieddatetimerequiredDate when the customer was modified.
registeredbooleanrequiredIf the customer was registered, which means it is allowed to sign in.
Response example
{
"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
customerIdintrequiredThe customerID from :ref:List customers <order-api-list-customers>.
firstName lastName ...customer objectrequiredThe customer object
xmlbooleanoptionalResponse in xml format instead of json.
Request example
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
statusstringrequiredok if success, else no.
customerobjectrequiredCustomer object. The customer object is explained in :ref:Get Customer Parameters <order-api-get-customer-response>.
Response example
{
"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
{
"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
customerIdintrequiredb2b b2cThe 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
statusstringrequiredok if success, else no.
msgstringoptionalThe response if the anonymization was successful or an error if status is
no.
Response example
{
"status": "ok",
"msg": "The personal data has been anonymized."
}
Error example
If the customer was not found:
{
"status": "no",
"msg": "The customer was not found."
}
If the customer was already anonymized:
{
"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
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-orders HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
ordersarrayrequiredArray of orders returned
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.
ETDdatetimerequiredEstimated time of delivery for the customer.
productsQtyintrequiredThe total quantity of products in this supplier order.
Response example
{
"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
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-orders/*supplierOrderId* HTTP/1.1
Response
200 Content-type: application/json
statusbooleanrequiredok if success, else no.
orderobjectrequiredInformation about this specific supplier order.
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.
ETDdatetimerequiredEstimated time of delivery for the customer.
productsQtyintrequiredThe total quantity of products in this supplier order.
productsarrayrequiredThe 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:
quantityintrequiredThe amount of product items ordered.
coststringrequiredThe cost / pcs for this item.
costCurrencystringrequiredThe currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB
etc).
Response example
{
"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
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/supplier-deliveries HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
deliveriesarrayrequiredArray of deliveries returned
idstringrequiredInternal ID for the supplier order delivery.
deliveryIdstringrequiredID of the supplier order delivery. This is the ID communicated externally.
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order delivery was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETDdatetimerequiredEstimated time of delivery for the customer.
Response example
{
"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
xmlbooleanoptionalResponse in xml format instead of json.
Request example
Both id and deliveryId from [List supplier deliveries>(#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
statusbooleanrequiredok if success, else no.
deliveryobjectrequiredInformation about this specific supplier order delivery.
idstringrequiredInternal ID for the supplier order delivery.
deliveryIdstringrequiredID of the supplier order delivery. This is the ID communicated externally.
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order delivery was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETDdatetimerequiredEstimated time of delivery for the customer.
productsQtyintrequiredThe total quantity of products in this supplier order.
productsarrayrequiredThe 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:
quantityintrequiredThe amount of product items attached to this delivery.
coststringrequiredThe cost / pcs for this item.
costCurrencystringrequiredThe currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB
etc).
Response example
{
"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
xmlbooleanoptionalResponse 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
statusbooleanrequiredok if success, else no.
deliveryobjectrequiredInformation about this specific supplier order delivery.
idstringrequiredInternal ID for the supplier order delivery.
deliveryIdstringrequiredID of the supplier order delivery. This is the ID communicated externally.
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order delivery was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETDdatetimerequiredEstimated time of delivery for the customer.
productsQtyintrequiredThe total quantity of products in this supplier order.
ordersarrayrequiredThe list of orders that has reserved products for this supplier order delivery.
orderIdstringrequiredThe order ID for the customer order.
accountIdstringrequiredThe account ID for the customer.
accountNamestringrequiredThe name of the account.
buyerstringrequiredThe name of the buyer from account placing the order.
carrierstringrequiredThe preferred carrier for this account.
servicestringrequiredThe preferred carrier service for this account.
paymentTermsstringrequiredThe payment terms defined for this order.
shippingTermsstringrequiredThe shipping terms defined for this order.
poNumberstringrequiredPO number used when placing the order.
deliveryName deliveryCompany deliveryEmail deliveryCell deliveryTele deliveryAddress deliveryCoaddress deliveryZipcode deliveryCity deliveryStatestringrequiredThe address the order should be delivered to.
deliveryCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
productsarrayrequiredThe 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:
quantityintrequiredThe amount of product items reserved from this supplier order delivery to the customer order.
coststringrequiredThe cost / pcs for this item.
costCurrencystringrequiredThe currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB
etc).
Response example
{
"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
productsobjectrequiredb2b b2cKey is from the :ref:Get supplier delivery <order-api-get-supplier-delivery> and value is the quantity.
key in objectstringrequiredUse 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 objectintrequiredQuantity of the item that should be accepted.
insertStockbooleanoptionalDefault 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
xmlbooleanoptionalResponse in xml format instead of json.
Request example
Both id and deliveryId from [List supplier deliveries>(#list-supplier-deliveries) can be used to accept a supplier delivery.
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.
POST <base>/supplier-delivery/364/sku HTTP/1.1
Content-type: application/json
{
"products": {
"PRODSKUVARIANTSKUSIZESKU": 32,
"PRODSKUVARIANTSKUSIZESKU2": 12,
}
}
Response
200 Content-type: application/json
statusstringrequiredb2b b2cok if success, else no.
additionalDeliveryobjectoptionalb2b b2cIf 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.
idstringrequiredInternal ID for the created supplier order delivery.
deliveryIdstringrequiredID of the supplier order delivery. This is the ID communicated externally.
orderIdstringrequiredID of the supplier order.
supplierCountrystringrequiredISO-Alpha-2 (SE, US, GB etc).
createddatetimerequiredThe date this supplier order delivery was created.
ETAdatetimerequiredEstimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.
ETDdatetimerequiredEstimated time of delivery for the customer.
productsQtyintrequiredThe total quantity of products remaining in the accepted supplier order delivery.
Response example
{
"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
namestringrequiredName of the voucher.
codestringoptionalCode of the voucher. Will be generated a random one if not passed.
startDatestringoptionalStart date of the voucher in Y-m-d format. Will be set to current one if not
passed.
stopDatestringrequiredStop date of the voucher in Y-m-d format.
typeenumrequiredType of the voucher. One of percentoff or priceoff
valuefloatoptionalValue of the voucher. Is required if percentoff is a voucher type
valueByPricelistobjectoptionalValues 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.
storeintrequiredStore id for voucher
marketsint|arrayrequiredMarkets for voucher
limitintoptionalLimit of the voucher usage, where 0 means unlimited. Is 0 if not passes.
statusbooleanrequiredIs voucher active or inactive
conversionHtmlstringoptionalConversion html of the voucher
Request examples
POST <base>/voucher HTTP/1.1
{
"name": "Welcome 10%",
"stopDate": "2022-07-09",
"type": "percentoff",
"value": 10,
"store": 1,
"markets": 1,
"status": true
}
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
statusstringrequiredok if success, else no.
voucherintoptionalID of a created voucher
codestringoptionalCode of a created voucher
Response example
{
"status": "ok",
"voucher": 13,
"code": "quooquadi_t6uqwecifin"
}
Errors example
Required fields are not passed
{
"status": "no",
"msg": {
"name": "required",
"stopDate": "required",
"type": "required",
"store": "required",
"markets": "required",
"status": "required"
}
}
Market does not exist for a provided store
{
"status": "no",
"msg": {
"markets": "Market 2 not found."
}
}
Neither value nor valueByPricelist provided
{
"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
namestringoptionalb2b b2cName of the voucher.
codestringoptionalb2b b2cCode of the voucher. Will be generated a random one if not passed.
stopDatestringrequiredb2b b2cStop date of the voucher in Y-m-d format.
conversionHtmlstringoptionalb2b b2cConversion html of the voucher
Request example
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
statusstringrequiredok if success, else no.
voucherintoptionalId of a new voucher
codestringoptionalCode of a new voucher
Response example
{
"status": "ok",
"voucher": 4,
"code": "new-welcome-10"
}
Errors example
Required fields are not passed
{
"status": "no",
"voucher": "4",
"msg": {
"stopDate": "required"
}
}
Voucher not found
{
"status": "no",
"voucher": "3",
"msg": {
"voucher": "Voucher not found"
}
}
Auto vouchers not supported
{
"status": "no",
"voucher": "3",
"msg": {
"voucher": "Auto vouchers not supported"
}
}
Voucher does not belong to this store
{
"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
idintrequiredVoucher id.
xmlbooleanoptionalResponse in xml format instead of json.
Request example
GET <base>/vouchers/1 HTTP/1.1
Response
200 Content-type: application/json
statusstringrequiredok if success, else no.
voucherobjectrequiredThe voucher object.
idintrequiredID of the voucher.
namestringrequiredName for the voucher.
codestringrequiredCode of the voucher
startDatedaterequiredThe date in Y-m-d format when the voucher starts being active
stopDatedaterequiredThe date in Y-m-d format when the voucher stops being active
typestringrequiredType of the voucher e.g. priceoff, percentoff
valuefloatrequiredValue of the voucher. Exists for percentoff voucher type
valueByPrcelistobjectrequiredValue of the voucher for each price list. Contains id of price list to value.
Exists for priceoff voucher type
storeintrequiredStore the voucher is valid for
marketsarrayrequiredList of the markets voucher is valid for
limitintrequiredThe voucher max usage limit
statusstringrequiredStatus of the voucher. One of active, inactive
priorityintrequiredThe voucher priority
conversionHtmlstringrequiredConversion html for voucher
createdAtdatetimerequiredThe date in Y-m-d H-i-s format when the voucher was created.
Response example
{
"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"
}
}
{
"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"
}
}