API reference

Last updated

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 addressobjectoptional

For 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.

emailstringrequired

Customer e-mail

firstName lastNamestringoptionalb2c

Customer name

tele cellstringoptionalb2c

Customer telephone / cellphone

attnstringoptionalb2b

Attention (addressing memorandum)

address coaddress city zipcodestringoptional

Street Address

statestringoptional

Country state, might be required by the country

countrystringrequired

ISO-Alpha-2 (SE, US, GB etc)

pricelistIdintoptional

ID of pricelist to use for the order, if not provided, the pricelist for the current country will be used.

priceliststringoptional

Name 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.

marketIdintoptional

ID of the market to use for the order. If not provided, the market for the current country will be used.

marketstringoptional

Name 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.

customerRegisterbooleanoptionalb2c

Default 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.

customerIdintoptionalb2c

If 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.

customerSetNewPasswordbooleanoptionalb2c

Default 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.

createdFromOriginobjectoptional

Specifies the origin that the order was created from. If used, it needs to refer to an internal object in Centra.

typestringrequired

Type of origin the order was created from. Allowed types: return, order and plugin

idintrequired

ID of internal origin of the origin type. If Return #123 was used to create the order, id should be 123.

extraAttributesobjectoptional

Object for sending in custom order attributes.

attributeName_elementNameanyoptional

List of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.

accountIdintoptionalb2b

Account ID for B2B-customer. Required if order is placed for B2B.

buyerIdintoptionalb2b

Buyer ID for B2B-customer. If not provided, the default buyer of the account will be used.

buyerNamestringoptionalb2b

Name of the buyer that placed the order.

deliveryWindowstringoptionalb2b

Name 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.

productsobjectrequired

Contains the products for the order.

qtyintrequired

Quantity ordered for this product.

idintoptional

ID specific to the product size. Either id, ean or sku must be used.

eanstringoptional

EAN of product item. Either id, ean or sku must be used.

skustringoptional

SKU 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)optional

Unit 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)optional

The 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.

commentstringoptional

A 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.

itemTextobjectoptional

Ability to define every column specifying the product information. Very useful when importing old orders for products not in Centra.

skustringoptional

The SKU for this product.

brandstringoptional

The Brand name for this product.

productstringoptional

Product name.

variantstringoptional

The variant name of the product.

sizestringoptional

The 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.

localizedProdSizeobjectoptional

The localized size information for this product size. It contains the localized size localizedSize and localized size chart name localizationDefinitionName.

shippingListstringoptional

Shipping option URI, for example: ups-standard, without this one, the default shipping option for the products and country will be used.

shippingValuedecimal2 (0.00)optional

Shipping cost, for example: 12.43, without this one, the default shipping cost for the products and country will be used.

voucherValuedecimal2 (0.00)optional

Voucher value, should be a positive value or zero, even though the value ends up reducing the order value.

orderNumberintoptional

Explictly set the order number for the order. Will only work if the order does not already exist in Centra.

sendEmailbooleanoptional

Send order confirmation or not, if not provided, the store settings will be used.

adjustStockbooleanoptional

Default 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.

forceCreatebooleanoptional

Default false. Create the order even though products did not exist. These products will be marked as back ordered.

commentstringoptional

Text to place inside the "Other Information" field. Might show up on pack-lists and delivery notes depending on store settings.

internalCommentstringoptional

Text for the "Internal comment"-field. Will only be shown internally in Centra.

poNumberstringoptionalb2b

PO number used when placing the order. Will be visible on delivery notes and invoices.

orderDatedate/datetimeoptional

The time when the order was placed. Timezone is based on the location of the organization's Centra settings.

deliveryDatedate/datetimeoptional

Expected time of delivery.

cancelDatedate/datetimeoptional

Date when order should be cancelled if not confirmed.

warehouseGroupstringoptional

Used to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.

createOnlybooleanoptional

Default false. Only prepare the order with all data, can be finalized later using :doc:completeOrder </reference/stable/order-api/complete-order>.

internalOrderbooleanoptional

Default false. Mark the order as internal, will show up in reports as an internal order.

paymentobjectoptional

Will contain information that should be inserted in regards to how the payment was handled outside of Centra.

idintoptional

The ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.

auth / captureobjectoptional

Information 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.

responsestringoptional

The response string from the payment type. Will be shown verbose inside Centra.

statusintrequired

If the authorization/capture went through or not. 0 means pending, 1 means success, 2 means failed.

transactionstringoptional

The transaction ID of the authorization/capture.

methodstringoptional

Will be shown on reports to summarize what payment method was used.

amountdecimal2 (0.00)required

The amount that was authorized.

external_urlstringoptional

If an external invoice was created, insert the URL to the invoice here.

applyVouchersbooleanoptional

Default true. If Centra should calculate the voucher value depending on automatic voucher rules.

voucherCodesarrayoptional

Array of voucher codes to apply on the order.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 POST <base>/order HTTP/1.1 Content-type: application/json { "invoiceAddress": { "country": "SE", "firstName": "John", "lastName": "Smith", "address": "12 Alto Road", "coaddress": "c/o Peter", "zipcode": "90212", "city": "San Francisco", "email": "x@example.com" }, "deliveryAddress": { "country": "US", "firstName": "John", "lastName": "Smith", "address": "1500 California St", "coaddress": "c/o Peter", "zipcode": "90210", "city": "San Francisco", "state": "CA" }, "products": [ { "qty": 2, "ean": "ABCDEFGHIJKL", "unitPrice": 14.11, "originalPrice": 100.11, "itemText" : { "sku": "SPECIAL-SKU-FOR-THIS-ONE", "product": "A special product", "variant": "" } }, { "qty": 1, "sku": "SKUASKUBSKUC", "unitPrice": 12.11, "originalPrice": 50.22, "localizedProdSize": { "localizationDefinitionName": "Test order api definition name", "localizedSize": "Test order api size" } } ], "payment": { "id": 36, "auth": { "status": 1, "transaction": "894751945132", "method": "cc", "amount": 26.22 }, "capture": { "status": 1, "transaction": "154342468439", "method": "cc", "amount": 26.22 } }, "voucherCodes": ["MyFirstGiftcard", "New10PercentOff"] }

The response will return an array of orders when the call was successful (unless you used createOnly set as true). This is because the order might have been split into different orders depending on rules inside Centra.

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Will return if createOnly was set as true.

ordersarray of intoptional

List of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response examples

1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "orders": [ 1234 ] }

If createOnly is set to true, the response looks like this:

1 2 3 4 { "status": "ok", "order": 1234 }

Error example

Errors will always be returned with "status" as "no" it will also contain a code and a message with more details the codes and their general meaning is as follows

CodeDescription
-1Some of the provided products are not possible to add to the order, product status, market or pricelist might not be properly configured inside centra.
-2Stock error, one or more products are missing stock
-3Order is empty
-4One or more required fields are missing
-5An order with the provided order number already exists
-6Customer registration failed
-7General error, see message for details
1 2 3 4 5 { "status": "no", "code": -7, "msg": "Message about why the order failed to be created." }

Batch create orders#

Endpoint: POST *base*/orders
Authentication: API Key

You are able to insert multiple orders at the same time by changing the endpoint from <base>/order to <base>/orders and sending data for each order inside an object with defined keys. You will get back responses for each order using the same defined keys you sent.

Parameters

The request consists of a JSON object with names for each element. The content of each element should be an order object, specified in Create Order. The name for each element is then used in the response to map against either a success response or an error for each order.

foo bar etc ...order objectrequired

The name of each element could be anything you like. The content of each element are exactly like the parameters for :ref:Create Order <create-order-parameters>.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 POST <base>/orders HTTP/1.1 Content-type: application/json { "x123": { "invoiceAddress": { "country": "SE", "firstName": "John", "lastName": "Smith", "address": "12 Alto Road", "coaddress": "c/o Peter", "zipcode": "90212", "city": "San Francisco", "email": "x@example.com" }, "deliveryAddress": { "country": "US", "firstName": "John", "lastName": "Smith", "address": "1500 California St", "coaddress": "c/o Peter", "zipcode": "90210", "city": "San Francisco", "state": "CA" }, "products": [ { "qty": 2, "ean": "ABCDEFGHIJKL", "upc": "123456", "unitPrice": 14.11, "originalPrice": 100.11, "itemText" : { "sku": "SPECIAL-SKU-FOR-THIS-ONE", "product": "A special product", "variant": "" } }, { "qty": 1, "sku": "SKUASKUBSKUC", "unitPrice": 12.11, "originalPrice": 50.22 } ] }, "a1": { "...": "..." } }

Response 200 Content-type: application/json

foo bar etc ...objectrequired

Object with fields for each order using the names from the request.

statusstringrequired

ok if success, else no.

orderntoptional

Will return if createOnly was set as true.

ordersarray of intoptional

List of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "x123": { "status": "ok", "orders": [ 1234 ] }, "a1": { "status": "ok", "orders": [ 1235 ] } }

Response if createOnly is true:

1 2 3 4 5 6 7 8 9 10 { "x123": { "status": "ok", "order": 1234 }, "a1": { "status": "ok", "order": 1235 } }

Error examples

Errors will always be returned with "status" as "no" it will also contain a code and a message with more details the codes and their general meaning is as follows

CodeDescription
-1Some of the provided products are not possible to add to the order, product status, market or pricelist might not be properly configured inside centra.
-2Stock error, one or more products are missing stock
-3Order is empty
-4One or more required fields are missing
-5An order with the provided order number already exists
-6Customer registration failed
-7General error, see message for details
1 2 3 4 5 6 7 8 9 10 11 12 { "x123": { "status": "no", "code": -7, "msg": "Message about why the order failed to be created." }, "a1": { "status": "no", "code": -7, "msg": "Message about why the order failed to be created." } }

Since you can insert multiple orders at the same time, some orders might succeed where others fail. Here's an example with two orders that failed and one that succeeded:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 { "x123": { "status": "no", "code": -7, "msg": "Message about why the order failed to be created." }, "a1": { "status": "no", "code": -7, "msg": "Message about why the order failed to be created." }, "a2": { "status": "ok", "orders": [ 1235 ] } }

Complete order#

Endpoint: POST *base*/order/*orderId*
Authentication: API Key

If Create Order was used with createOnly set as true, the order will only be prepared but not finalized. By using the Complete Order-endpoint you can finalize the order to be placed properly as a second step from creating the order. This might be necessary if you first need to make sure the order can be placed (Create Order) and then finalize it after you've verified the payment (Complete Order).

You can use this endpoint multiple times for the same order, for example to save details on payment auth and capture at different times.

The Create Order call is the one validating that the products exists in stock, so if the Complete Order-call is made much later than the Create Order-call, there might be products back ordered inside the finalized order.

Parameters

The following parameters are explained in the Create Order-call, but are also supported when completing the order.

paymentobjectoptional

Will contain information that should be inserted in regards to how the payment was handled outside of Centra.

idintrequired

The ID of the payment plugin used from Centra. If not used, the order will not be marked with a payment type at all.

auth captureobjectoptional

Information about the authorization and capture of the order. Authorization was the reservation of the order, capture is when the value also has been charged.

responsestringoptional

The response string from the payment type. Will be shown verbose inside Centra.

statusintrequired

If the authorization/capture went through or not. 0 means pending, 1 means success, 2 means failed.

transactionstringoptional

The transaction ID of the authorization/capture.

methodstringoptional

Will be shown on reports to summarize what payment method was used.

amountdecimal2 (0.00)required

The amount that was authorized.

external_urlstringoptional

If an external invoice was created, insert the URL to the invoice here.

buyerNamestringoptional

Name of the buyer that placed the order.

internalCommentstringoptional

Text for the "Internal comment"-field. Will only be shown internally in Centra.

poNumberstringoptional

PO number used when placing the order. Will be visible on delivery notes and invoices.

orderDatedate/datetimeoptional

The time when the order was placed. Timezone is based on the location of the organization's Centra settings.

deliveryDatedate/datetimeoptional

Expected time of delivery.

cancelDatedate/datetimeoptional

Date when order should be cancelled if not confirmed.

warehouseGroupstringoptional

Used to define which allocation rule (previously known as "warehouse group") it should use. Default will use the one set for the market.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 POST <base>/order/123 HTTP/1.1 Content-type: application/json { "comment": "Completed order, here is a comment" }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

ordersarray of stringoptional

List of order numbers created. An order might split up in multiple orders after completing it, this is why you might get multiple orders back.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 6 { "orders": [ "44" ], "status": "ok" }

Error example

1 2 3 4 { "status": "no", "msg": "Message about why the order failed to be completed." }

Get orders#

Endpoint: GET *base*/orders?[&limit=5][&offset=5][&order=83651][&customer_id=1][&xml=1]
Authentication: API Key

This will fetch the orders allowed for the plugin being set up.

Price information returned by this endpoint depends on the plugin settings. Refer to the documentation for details.

Parameters

limitintoptional

Limit amount of orders returned. Default: 20.

offsetintoptional

Offset how far in to start returning orders.

orderintoptional

Return a specific order.

customer_idintoptional

Return orders for specified customer id.

newer_thandate/datetimeoptional

Return 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/datetimeoptional

Return 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.

xmlbooleanoptional

Response 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

statusstringrequired

ok if success, else no.

ordersarrayrequired

Array of orders returned.

orderIdstringoptional

ID of the order.

orderStatusstringoptional

Status of the order.

selectionIdstringoptional

Selection ID of the order.

orderDatedatetimeoptional

Date when order was created.

productsarrayoptional

Products inside the order.

lineIdstringoptional

ID of the specific product item in this order.

qtyintoptional

Quantity of this specific product item.

isBundlebooleanoptional

Flag showing if product is bundle

isPartOfBundleintoptional

Bundle id

bundlearrayoptional

Array of containing items for bundle

localizedSizeobjectoptional

The localized size information for this product size. It contains the localized size localizedSize and localized size chart name localizationDefinitionName.

taxBreakdownarrayoptional

Lists all tax rules applied to the order.

descriptionstringoptional

Text description of tax rule. ex: VAT

taxPercentfloatoptional

Percentage of tax. ex 25

valuefloatoptional

How much tax. ex 20

paymentPluginstringoptional

Payment plugin type, e.g. adyen_drop_in, klarna_checkout_v1, paypal_v1, etc.

paymentTypestringoptional

Payment 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

paymentDescriptionstringoptional

Payment method description from plugin configuration.

paymentReferencestringoptional

Payment reference ID from external service provider. Can be null.

paymentMethodstringoptional

Payment method ID - unique name of payment provider. Can be null.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "orders": [ { "orderId": "83651", "selectionId": "7dee9426b07b13ec452f87a3b67aa6be", "orderDate": "2012-02-04 15:16:13", "cancelDate": "2012-08-04 15:16:13", "preferredDeliveryDate": "2012-05-04 15:16:13", "estimatedDeliveryDate": "2012-05-04 15:16:13", "orderStore": "retail", "orderCurrency": "EUR", "customerId": "12345", "accountId": "", "deliveryName": "Someones Name", "deliveryCompany": "", "deliveryEmail": "deliveries@example.com", "deliveryCell": "+4912345678", "deliveryTele": "", "deliveryAddress": "Examplestreet 1", "deliveryCoaddress": "", "deliveryZipcode": "12345", "deliveryCity": "Somecity", "deliveryState": "", "deliveryCountry": "DE", "billingName": "Someones Name", "billingCompany": "", "billingEmail": "billing@example.com", "billingTele": "", "billingAddress": "Examplestreet 1", "billingCoaddress": "", "billingZipcode": "12345", "billingCity": "Somecity", "billingState": "", "billingCountry": "DE", "billingVAT": "", "poNumber": "", "shippingList": "standard", "suspect": 0, "internalOrder": 0, "hold": 0, "waitingForPayment": 0, "shippingValue": 25, "voucherValue": 0, "grandTotalValue": 3978.75, "grandTotalTaxValue": 795.75, "taxAdded": 0, "taxDeducted": 0, "internalComment": "", "otherComment": "", "marketId": 1, "pricelistId": 1, "ipAddress": "127.0.0.1", "paymentPlugin": "klarna_checkout_v1", "paymentType": "free", "paymentDescription": "Klarna checkout v3", "paymentReference": "12345678-1234-1234-864e-6ef2621c4ab6", "paymentMethod": "klarna", "defaultCarrier": "", "shipments": [ { "shipmentId": "16-1", "shippedDate": "0000-00-00 00:00:00", "carrier": "", "service": "", "trackingId": "", "trackingUrl": "", "returnSlipTracking": "", } ], "totalItemsPriceTax": -202.88, "totalItemsPrice": 811.5, "totalItemsWithoutTax": 608.62, "taxBreakdown": [ { "description": "VAT", "taxPercent": 25, "value": 795.75 } ], "products": [ { "lineId": "43243", "sku": "S123K345U1", "variantSku": "", "sizeSku": "", "ean": "1234567890123", "upc": "123456", "name": "Product #1", "variant": "White", "brand": "Brand", "size": "XS", "qty": 1, "originalPrice": 500.5, "price": 450.5, "weight": 2, "weightUnit": "kg", "countryOfOrigin": "DE", "harmCode": "12345", "comment": "", "otherComment": "", "taxPercent": 0, "priceDiscount": 50.0, "priceDiscountAsPercent": 0, "taxValue": 112.63, "totalPrice": 450.5, "anyDiscount": false, "priceEachWithoutTax": 337.87, "priceEachReduction": 0, "warehouses": [ { "name": "Default", "itemQty": 1 } ], "isBundle": false, "isPartOfBundle": "217" }, { "lineId": "43244", "sku": "S123K345U2", "variantSku": "", "sizeSku": "", "ean": "1234567890124", "upc": "123456", "name": "Product #2", "variant": "Blue", "brand": "Brand", "size": "XS", "qty": 2, "originalPrice": 200.5, "price": 180.5, "weight": 1.5, "weightUnit": "kg", "countryOfOrigin": "CI", "harmCode": "12345", "comment": "", "taxPercent": 25, "priceDiscount": 0, "priceDiscountAsPercent": 0, "taxValue": 90.25, "totalPrice": 361, "anyDiscount": false, "priceEachWithoutTax": 270.75, "priceEachReduction": 0, "warehouses": [ { "name": "Default", "itemQty": 2 } ], "isBundle": true, "bundle": [ { "lineId": "43243", "sku": "S123K345U1", "variantSku": "", "sizeSku": "", "ean": "1234567890123", "upc": "123456", "name": "Product #1", "variant": "White", "brand": "Brand", "size": "XS", "qty": 1, "originalPrice": 500.5, "price": 450.5, "weight": 2, "weightUnit": "kg", "countryOfOrigin": "DE", "harmCode": "12345", "comment": "", "otherComment": "", "taxPercent": 0, "priceDiscount": 50.0, "priceDiscountAsPercent": 0, "taxValue": 112.63, "totalPrice": 450.5, "anyDiscount": false, "priceEachWithoutTax": 337.87, "priceEachReduction": 0, "warehouses": [ { "name": "Default", "itemQty": 1 } ], "isBundle": false, "isPartOfBundle": "217" }, ] } ], "totalItemsDiscount": 38.11, "discounts": { "anyDiscount": false, "discount": "0.00 USD", "discountAsNumber": 0, "vouchers": [ { "voucher": "vip123", "name": "Some voucher", "priceOff": "-150.00 USD", "priceOffAsANumber": -150.0, "description": "This is VIP code description", "isCredit": false, "originalPriceOff": "-150.00 USD", "originalPriceOffAsNumber": -150.0 } ], "automaticDiscounts": [ { "automaticDiscount": "12345", "name": "Some discount", "priceOff": "0.00 USD", "priceOffAsANumber": 0 } ] } } ] }

Update order#

Endpoint: PUT *base*/orders
Authentication: API Key

Update information on the order.

Parameters

orderintrequired

Order ID to update.

internalCommentstringoptional

Append some text to the internal comment field.

replaceInternalCommentbooleanoptional

Default false. Replace the full content of the internal comment field with the internalComment.

commentstringoptional

Append some text to the comment field.

replaceCommentbooleanoptional

Default false. Replace the full content of the comment field with the comment.

extraAttributesobjectoptional

Object for sending in custom order attributes.

attributeName_elementNameanyoptional

List of key-value pairs for every attribute element you want to set. Send it as an empty string to remove the current content.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 7 PUT <base>/orders HTTP/1.1 Content-type: application/json { "order": 83651, "internalComment": "test" }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintrequired

Order ID that was updated

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 { "status": "ok", "order": 83651 }

Error example

1 2 3 4 5 { "status": "no", "msg": "order in wrong market", "order": 83651 }

Create shipment#

Endpoint: POST *base*/shipments
Authentication: API Key

This will create a shipment and per default try to capture from the payment provider, shipment will not be created if the capture fails.

You have the ability to turn off capture to make it possible to edit the shipment after it has been created. However, if you explicitly turn off capture using "capture": false, we will not capture the money for the order automatically, and the Complete shipment call MUST be made and verified that it was successful until you can ship any products.

Parameters

orderintrequired

Order ID to create shipment on.

productsobjectrequired

Key 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 objectstringrequired

lineID from the Get orders response referring to a specific product item in the order.

value in objectintrequired

Quantity of the item that should be shipped.

gtgbooleanoptional

Default: false. Mark the shipment as good to go.

capturebooleanoptional

Default: 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.

:::

shippedbooleanoptional

Mark the shipment as sent. Default: false.

carrierstringoptional

Carrier used for shipping. Only used if shipped is true.

servicestringoptional

Service level used for shipping. Only used if shipped is true.

packagesintoptional

Number of packages in shipment. Only used if shipped is true.

trackingstringoptional

Tracking number for shipment. Only used if shipped is true.

returnSlipTrackingstringoptional

Return slip tracking number for shipment. Only used if shipped is true.

sendEmailbooleanoptional

Decide 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.

deductPreviousCostsbooleanoptional

Used 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.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 7 8 9 10 POST <base>/shipments HTTP/1.1 Content-type: application/json { "order": 83651, "products": { "43243": 1, "43244": 2 } }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Order ID that the shipment was created on.

shipmentstringoptional

The shipment ID for the create shipment.

deliveryNotestringoptional

URL to a PDF delivery note for the shipment.

proformastringoptional

URL to a PDF proforma for the shipment.

invoicestringoptional

URL to a PDF invoice for the shipment. Will only be set if an invoice exists.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 6 7 8 9 10 11 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "order": 83651, "shipment": "83651-1", "deliveryNote": "http://.../delivery-note.pdf", "proforma": "http://.../proforma.pdf", "invoice": "http://.../invoice.pdf" }

Error examples

1 2 3 4 5 { "status": "no", "msg": "order does not exist", "order": "1337" }
1 2 3 4 5 { "msg": "can not capture order", "status": "no", "order": "5" }

Get shipments#

Endpoint: GET *base*/shipments?[&limit=5][&order=83651]
Authentication: API Key

Will list all Good to Go-shipments that are not sent. Oldest first.

Price information returned by this endpoint depends on the plugin settings. Refer to the documentation for details.

Parameters

limitintoptional

Limit amount of shipments returned. For statuses inprogress and completed a positive value between 1 and 100.

orderintoptional

Return shipments for a specific order.

xmlbooleanoptional

Response in xml format instead of json.

offsetintoptional

Offset how far in to start returning orders.

statusstringoptional

Default value: goodtogo. Allowed values: inprogress, goodtogo, completed

newer_thandate/datetimeoptional

Only return shipments newer than provided date

older_thandate/datetimeoptional

Only return shipments older than provided date

Request example

GET <base>/shipments?limit=5 HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

shipmentsarrayrequired

Array of shipments returned.

orderIdstringoptional

ID of the order.

shipmentIdstringoptional

ID of the shipment.

selectionIdstringoptional

Selection ID of the order.

orderDatedatetimeoptional

Date when order was created.

shouldCapturebooleanoptional

If the shipment needs to be captured before being shipped.

deliveryNotestringoptional

URL to a PDF delivery note for the shipment.

shippingTermsobjectoptional

Shipping Terms object selected on this shipment.

idintoptional

Id of the specific shipping terms object.

namestringoptional

Name of the specific shipping terms object.

descriptionstringoptional

Description of the specific shipping terms object.

paymentTermsobjectoptional

Payment Terms object selected on this shipment.

idintoptional

ID of the specific payment terms object.

namestringoptional

Name of the specific payment terms object.

descriptionstringoptional

Description of the specific payment terms object.

proformastringoptional

URL to a PDF proforma for the shipment.

defaultCarrierstringoptional

Name of the carrier for this shipment.

deliveryServicestringoptional

Name of the delivery service for this shipment.

invoicesarrayoptional

URLs to PDF invoices for the shipment. Will only be set if any invoices exists.

productsarrayoptional

Products inside the shipment.

lineIdstringoptional

ID of the specific product item in this shipment.

qtyintoptional

Quantity of this specific product item.

isBundlebooleanoptional

Flag showing if product is bundle

isPartOfBundleintoptional

Bundle id

bundlearrayoptional

Array of containing items for bundle

taxBreakdownarrayoptional

Lists all tax rules applied to the order.

descriptionstringoptional

Text description of tax rule. ex: VAT

taxPercentfloatoptional

Percentage of tax. ex 25

valuefloatoptional

How much tax. ex 20

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "shipments": [ { "orderId": "83651", "selectionId": "ff805e6dc70f905553e2225c6977a27a", "orderDate": "2012-02-04 15:16:13", "cancelDate": "2012-08-04 15:16:13", "preferredDeliveryDate": "2012-05-04 15:16:13", "estimatedDeliveryDate": "2012-05-04 15:16:13", "orderStore": "retail", "orderCurrency": "EUR", "shipmentId": "83651-1", "customerId": "11627", "accountId": "0", "billingName": "Someones Name", "billingCompany": "", "billingAddress": "Examplestreet 1", "billingCoaddress": "", "billingCity": "Somecity", "billingState": "", "billingZipcode": "12345", "billingCountry": "DE", "billingEmail": "someone@example.com", "billingTele": "", "deliveryName": "Someones Name", "deliveryCompany": "", "deliveryEmail": "someone@example.com", "deliveryCell": "+4912345678", "deliveryTele": "", "deliveryAddress": "Examplestreet 1", "deliveryCoaddress": "", "deliveryZipcode": "12345", "deliveryCity": "Somecity", "deliveryState": "", "deliveryCountry": "DE", "billingVAT": "", "poNumber": "", "shippingList": "standard", "shippingTerms": { "id": 5, "name": "ShippingTermName", "description": "ShippingTermDescription" }, "paymentTerms": { "id": 10, "name": "PaymentTermName", "description": "PaymentTermDescription" }, "proforma": "http://.../proforma?shipment=83651-1", "deliveryNote": "http://../delnote?shipment=83651-1", "defaultCarrier": "Delivery Carrier", "deliveryService": "Delivery Service", "shipmentDate": "2019-07-01 12:56:00", "trackingNumber": "123456789", "trackingUrl": "https://www.dhl.com.pl/exp-en/express/tracking.html?AWB=123456789", "returnSlipTracking": "123456789", "invoices": [ "https://online.klarna.com/invoice_public_show.yaws/invoice.pdf?invno=&orgno=" ], "suspect": 0, "hold": 0, "paid": 1, "shouldCapture": 0, "shippingValue": 25, "voucherValue": 0, "grandTotalValue": 3978.75, "grandTotalTaxValue": 795.75, "taxAdded": 0, "taxDeducted": 0, "internalComment": "", "otherComment": "", "taxBreakdown": [ { "description": "VAT", "taxPercent": 25, "value": 795.75 } ], "products": [ { "lineId": "43243", "sku": "S123K456U1", "variantSku": "", "sizeSku": "", "name": "Product #1", "variant": "White", "size": "XS", "ean": "1234567890123", "upc": "123456", "qty": 1, "originalPrice": 500.5, "price": 450.5, "weight": 2, "weightUnit": "kg", "countryOfOrigin": "DE", "harmCode": "12345", "comment": "", "warehouses": [ { "name": "Default warehouse", "itemQty": "1" } ], "isBundle": false, "isPartOfBundle": "217" }, { "lineId": "43244", "sku": "S123K456U2", "variantSku": "", "sizeSku": "", "name": "Product #2", "variant": "Blue", "size": "XS", "ean": "1234567890124", "upc": "123456", "qty": 2, "originalPrice": 200.5, "price": 180.5, "weight": 1.5, "weightUnit": "kg", "countryOfOrigin": "CI", "harmCode": "12345", "comment": "", "isBundle": true, "bundle": [ { "lineId": "43243", "sku": "S123K456U1", "variantSku": "", "sizeSku": "", "name": "Product #1", "variant": "White", "size": "XS", "ean": "1234567890123", "upc": "123456", "qty": 1, "originalPrice": 500.5, "price": 450.5, "weight": 2, "weightUnit": "kg", "countryOfOrigin": "DE", "harmCode": "12345", "comment": "", "warehouses": [ { "name": "Default warehouse", "itemQty": "1" } ], "isBundle": false, "isPartOfBundle": "217" }, ] } ] } ] }

Update shipment#

Endpoint: PUT *base*/shipments/*shipmentId*
Authentication: API Key

This will modify the products on the shipment, keeping the same shipmentId. This function is designed for creation and modification of new shipments, meaning it will not work on existing shipments which:

  • Have been shipped,
  • Have been captured or paid, or
  • Have any returns.

The only exception to this rule is setting GTG (Good to Go) or setting serial numbers on serializable product lines. This you can do at any point.

To be able to use this call, you need to create a shipment using "capture": false so the create shipment call is not trying to capture the money.

If the automatic capture when creating shipments is disabled, to avoid sending shipments that has not been captured you need to Capture Shipment before you ship it.

If you need to remove the shipment, use the Delete Shipment method.

Parameters

shipmentIdstringrequired

The ID from shipment when creating or updating a shipment.

gtgbooleanoptional

Default 0. Update shipment with Good to Go.

productsobjectoptional

Key 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 objectstringrequired

lineID from the Get orders response referring to a specific product item in the order.

value in objectintrequired

Quantity of the item that should be set for the shipment.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 PUT <base>/shipments/23123 HTTP/1.1 Content-type: application/json { "gtg":1, "products": { "43243": 1, "43244": 2, "43245": { "serialNumber": "newSerialNumber", "qty": 5 } } }

Response

200 Content-type: application/json

Response is explained in the Create Shipment Response.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 { "status": "ok", "shipment": { "orderId": "83651", "selectionId": "ff805e6dc70f905553e2225c6977a27a", "orderDate": "2012-02-04 15:16:13", "cancelDate": "2012-08-04 15:16:13", "preferredDeliveryDate": "2012-05-04 15:16:13", "estimatedDeliveryDate": "2012-05-04 15:16:13", "orderStore": "retail", "orderCurrency": "EUR", "shipmentId": "83651-1", "customerId": "11627", "accountId": "0", "deliveryName": "Someones Name", "deliveryCompany": "", "deliveryEmail": "tetete@ttet.com", "deliveryCell": "+4912345678", "deliveryTele": "", "deliveryAddress": "Examplestreet 1", "deliveryCoaddress": "", "deliveryZipcode": "12345", "deliveryCity": "Somecity", "deliveryState": "", "deliveryCountry": "DE", "billingVAT": "", "poNumber": "", "shippingList": "standard", "proforma": "http://.../proforma?shipment=83651-1", "deliveryNote": "http://../delnote?shipment=83651-1", "invoices": [ "https://online.klarna.com/invoice_public_show.yaws/invoice.pdf?invno=<>&orgno=" ], "suspect": 0, "hold": 0, "paid": 1, "shouldCapture": 0, "shippingValue": 25, "voucherValue": 0, "grandTotalValue": 3978.75, "grandTotalTaxValue": 795.75, "internalComment": "", "otherComment": "", "products": [ { "lineId": "43243", "sku": "B405916999", "variantSku": "", "sizeSku": "", "name": "Product #1", "variant": "White", "size": "XS", "ean": "7332577534606", "upc": "123456", "qty": 1, "originalPrice": 500.5, "price": 450.5, "weight": 2, "weightUnit": "kg", "countryOfOrigin": "DE", "harmCode": "345345435", "comment": "" }, { "lineId": "43244", "sku": "C00622469B", "variantSku": "", "sizeSku": "", "name": "Product #2", "variant": "Blue", "size": "XS", "ean": "7332577652942", "upc": "123456", "qty": 2, "originalPrice": 200.5, "price": 180.5, "weight": 1.5, "weightUnit": "kg", "countryOfOrigin": "CI", "harmCode": "423432", "comment": "" } ] } }

Error example

1 2 3 4 5 { "status": "no", "msg": "shipment is sent and can not be updated", "shipment": "4-1" }
1 2 3 4 5 { "status": "no", "msg": "shipment is paid and can not be updated", "shipment": "4-1" }
1 2 3 4 5 { "status": "no", "msg": "shipment is captured and can not be updated", "shipment": "4-1" }
1 2 3 4 5 { "status": "no", "msg": "shipment has refunds and can not be updated", "shipment": "4-1" }

Complete shipment#

Endpoint: PUT *base*/shipment
Authentication: API Key

This will insert back the tracking number and carrier information to Centra. An email will be sent out to the customer with the tracking information.

Remember, for the Shipment to be completed, it has to be paid, Good-to-go, and shipped.

You can select if you want to capture the order, this is often used if the shipments are already created inside Centra. You will get an error as response if the capture did not go through.

Parameters

orderintrequired

Order ID to which the shipment belongs.

shipmentintrequired

Shipment ID for the shipment to complete.

capturebooleanoptional

Default: true. Try to capture the order. Ignored if the capture was already made earlier for the shipment.

gtgbooleanoptional

Good-to-go. Indicates the items are packed and ready to leave the Warehouse. Required for shipment to complete.

shippedbooleanoptional

Indicates the items have been shipped. Required for shipment to complete.

carrierstringoptional

Carrier used for shipping.

servicestringoptional

Service level used for shipping.

packagesintoptional

Number of packages in shipment.

trackingstringoptional

Tracking number for shipment.

returnSlipTrackingstringoptional

Return slip tracking number for shipment.

sendEmailbooleanoptional

Decide if Shipping Confirmation e-mail should be sent. If not defined, Store setting "Send Shipping Confirmation" will be used instead.

internalCommentstringoptional

Append some text to internal comment field.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 13 PUT <base>/shipment HTTP/1.1 Content-type: application/json { "order": "83651", "shipment": "83651-1", "carrier": "Fedex", "service": "Express", "packages": 1, "tracking": "TRTTET5", "returnSlipTracking": "TRTTET6", "capture": 1 }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Order ID that was completed.

shipmentstringoptional

Shipment ID that was completed.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 { "status": "ok", "order": 83651, "shipment": "83651-1" }

Error example

1 2 3 4 5 6 { "status": "no", "msg": "capture failed", "order": 83651, "shipment": "83651-1" }

Capture shipment#

Endpoint: PUT *base*/capture
Authentication: API Key

This will capture the payment for a shipment. You can use this on a shipment that has "shouldCapture": true from Get shipments.

Parameters

shipmentstringrequired

The shipmentId from Get shipments or Create shipment.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 PUT <base>/capture HTTP/1.1 Content-type: application/json { "shipment": "83651-1" }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Order ID that was captured.

shipmentstringoptional

OShipment ID that was captured.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 { "status": "ok", "order": 83651, "shipment": "83651-1" }

Error example

1 2 3 4 5 6 { "status": "no", "msg": "capture failed", "order": 83651, "shipment": "83651-1" }

Delete shipment#

Endpoint: DELETE *base*/shipments/*shipmentId*[?xml=1]
Authentication: API Key

This will delete the shipment completely. Will only work if the shipment does not have any invoices or credit notes connected to it.

Parameters

shipmentIdstringoptional

The shipmentId from Get shipments or Create shipment.

xmlbooleanoptional

Response in xml format instead of json.

Request example

DELETE <base>/shipments/*shipmentId* HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Order ID for the shipment that was deleted.

shipmentstringoptional

Shipment ID for the shipment that was deleted.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 6 { "status": "ok", "msg": "shipment removed", "order": 8, "shipment": "8-1" }

Error example

1 2 3 4 5 { "status": "no", "msg": "shipment has invoices or creditnotes and could not be deleted.", "shipment": "3-1" }

Update Check First#

Endpoint: POST *base*/check-first
Authentication: API Key

This will update the status of a check-first warehouse on an order.

Updating a check first for an order is irreversible. Once an order has been accepted or rejected, it can no longer be changed.

Parameters

orderNumberintrequired

Order ID to update the Check first.

warehouseIdintrequired

Warehouse ID associated with the Check first order.

acceptedboolrequired

Whether to accept or reject the Check First warehouse. true to accept, false to reject.

Request example

1 2 3 4 5 6 7 8 POST <base>/check-first HTTP/1.1 Content-type: application/json { "orderNumber": 123, "warehouseId": 321, "accepted": true }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

msgstring|objectoptional

If status returns no, this value should send back a message why it failed.

orderNumberstringoptional

Error message describing an issue with the provided order number.

warehouseIdstringoptional

Error message describing an issue with the provided warehouse id.

acceptedstringoptional

Error message describing an issue with the provided accepted value.

Response example

1 2 3 4 5 6 HTTP/1.1 200 OK Content-type: application/json { "status": "ok" }

Error examples

1 2 3 4 5 6 7 8 { "status": "no", "msg": { "orderNumber": "invalid value", "warehouseId": "required", "accepted": "invalid value" } }
1 2 3 4 { "msg": "order does not exist", "status": "no" }
1 2 3 4 { "msg": "failed to allocate stock", "status": "no" }

Update allocation request#

Endpoint: PUT *base*/allocation-request
Authentication: API Key

This will update the status of a allocation request warehouse on an order.

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

idintrequired

Allocation request ID.

statusstringrequired

Whether to accept or reject the allocation request for warehouse. Accepted values:confirmed to accept, rejected to reject.

Request example

1 2 3 4 5 6 7 PUT <base>/allocation-request HTTP/1.1 Content-type: application/json { "id": 67, "status": "confirmed" }

Response

200 Content-type: application/json

statusstringrequired

true if success. false if failed.

errorMessagesarrayoptional

If status returns false, this value will be not empty with a message why it failed.

Response example

1 2 3 4 5 6 7 HTTP/1.1 200 OK Content-type: application/json { "success": true, "errorMessages": [] }

Error examples

1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "success": false, "errorMessages": [ "You can't update allocation request, which is in status confirmed." ] }
1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "success": false, "errorMessages": [ "You can't update allocation request, which is in status rejected." ] }
1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "success": false, "errorMessages": [ "Allocation request not found" ] }
1 2 3 4 5 6 { "success": false, "errorMessages": [ "Warehouse doesn't have sufficient stock to allocate the request." ] }
1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "success": false, "errorMessages": [ "Failed to allocate stock from the warehouse." ] }
1 2 3 4 5 6 7 8 9 HTTP/1.1 200 OK Content-type: application/json { "success": false, "errorMessages": { "status": "invalid value, expected 'confirmed' or 'rejected'" } }

Missing access to endpoint:

1 2 3 4 5 6 HTTP/1.1 403 Forbidden Content-type: application/json { "status": "Not Allowed" }

Get allocation requests of an order#

Endpoint: GET *base*/orders/*id*/allocation-requests
Authentication: API Key

This will fetch all allocation requests for order.

Allocation request can have the following statuses:

allocated - items are allocated from this warehouse, request is sent, timed-out - allocation request reached expiration date, items are re-allocated, request still can be confirmed (if the allocation flow has not yet reached the end), 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. outdated - allocation request is outdated, please ignore it failed - allocation request wasn't sent in a webhook, but it can still be confirmed through Order API

In Order API Plugin settings Allow access to the following endpoints Order API should have access to Get allocation requests of an order (GET /orders/*id*/allocation-requests) endpoint.

Parameters

warehouseIdintoptional

Show allocation requests for a specific warehouse ID

statusstringoptional

By default, allocation requests will be shown only with status sent, allocated and failed

Show allocation requests with a specific status. Acceptable values are sent, outdated, timed-out,confirmed, rejected, failed and pending.

Request example

GET <base>/*base*/orders/9993/allocation-requests HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success. no if failed.

errorMessagesarrayoptional

If status returns no, this value will be not empty with a message why it failed.

allocation_requestsarrayoptional

Array with allocation requests json objects.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "allocation_requests": [ { "id": 1140, "status": "outdated", "warehouseId": 27, "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", "warehouseName": "Store 1" }, { "id": 1141, "status": "sent", "warehouseId": 27, "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", "warehouseName": "Store 1" } ] }

Error examples

Order isn't found:

1 2 3 4 5 6 7 HTTP/1.1 200 OK Content-type: application/json { "status": "no", "msg": "Unknown order id: 1095" }

Missing access to endpoint:

1 2 3 4 5 6 HTTP/1.1 403 Forbidden Content-type: application/json { "status": "Not Allowed" }

Create return#

Endpoint: POST *base*/return
Authentication: API Key

This will create return for given shipment and items. Return will be created even if some of the provided items cannot be returned.

Parameters

shipmentstringrequired

The shipmentId from Get shipments or Create shipment.

productsobjectoptional

Key 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 objectstringrequired

lineID from the Get shipments referring to a specific product item in the order.

value in objectintrequired

Quantity of the item that should be returned.

returnStockbooleanoptional

Insert returned items into stock. If not provided Default stock action on return setting on the store will be used.

handlingCostfloatoptional

Handling cost.

handlingCostFromShipmentbooleanoptional

Default false. Set to true to use Handling cost from Shipment. You cannot provide handlingCost at the same time this option is used.

shippingCostfloatoptional

Shipping cost.

shippingCostFromShipmentbooleanoptional

Default false. Set to true to use Shipping cost from Shipment. You cannot provide shippingCost at the same time this option is used.

returnCostfloatoptional

Return cost. If the return itself should have a cost to it. Providing a value here will deduct the amount of money to refund.

voucherValuefloatoptional

Voucher value, should always be positive value.

voucherValueFromShipmentbooleanoptional

Default false. Set to true to use Voucher value from Shipment. You cannot provide voucherValue at the same time this option is used.

commentstringoptional

Additional comment for return, for reference.

xmlbooleanoptional

Response in xml format instead of json.

createdAtdate/datetimeoptional

Additional 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.

refundobjectoptional

Refund object. Example: {"refund":{"refundPayment": true}} will make refund from return.

refundPaymentbooleanoptional

If 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.

sendEmailbooleanoptional

Send refund email. Default value is false.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 POST <base>/return HTTP/1.1 Content-type: application/json { "shipment": "120276-1", "returnStock": 1, "comment": "Return created with Order Api", "products": { "268871": "1", "268870": "1" } }

Request exampleincluding refund

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 POST <base>/return HTTP/1.1 Content-type: application/json { "shipment": "120276-1", "returnStock": 1, "comment": "Return created with Order Api", "products": { "268871": "1", "268870": "1" }, "refund": { "refundPayment": true, "sendEmail": true } }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

orderintoptional

Order ID that was captured.

returnintoptional

Return ID that was created.

returnCompletedbooleanoptional

If the return was completed directly on creation, this can only happen if a successful refund was made when return was created.

returnedItemsarrayoptional

Array of Line IDs of returned Products.

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 6 7 8 { "status": "ok", "return": 5397, "returnCompleted": false, "returnedItems": [ "268871" ] }

Response example including refund

1 2 3 4 5 6 7 8 9 10 11 { "status": "ok", "return": 5397, "returnCompleted": true, "returnedItems": [ "268871" ], "refund": { "status": "ok" } }

Error example

1 2 3 4 { "status": "no", "msg": "return could not be created." }

Get returns#

Endpoint: GET *base*/returns?[&limit=5][&page=2][&return=23]
Authentication: API Key

Will list all returns, newest first.

Parameters

limitintoptional

Limit the number of returns returned.

pageintoptional

Number of page of results to return.

returnintoptional

Only show a return with given ID.

shipmentstringoptional

Only show a return with given shipment number.

orderintoptional

Only fetch returns for a specific order.

selectionintoptional

Only fetch returns for a specific selection.

customer_idintoptional

Only fetch returns for a specific customer.

newer_thandate/datetimeoptional

Only 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/datetimeoptional

Only 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.

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/returns?limit=2 HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

returnsarrayrequired

Array of fetched returns.

returnIdintoptional

ID of the return.

completedbooleanoptional

Whether the return was completed or not.

shipmentstringoptional

Number of the shipment.

shipmentIdintoptional

ID of the shipment.

orderIdintoptional

ID of the order.

selectionIdstringoptional

Selection ID of the order.

customerIdintoptional

Customer ID of the order.

datedatetimeoptional

Date when return was created.

returnCostfloatoptional

Cost of the return.

shippingCostfloatoptional

Cost of shipping returned.

handlingCostfloatoptional

Handling cost of the return.

voucherValuefloatoptional

Voucher value included in the return.

taxValuefloatoptional

Tax value of the return, zero if deducted.

taxDeductionfloatoptional

Tax deduction in the return.

currencystringoptional

Currency code in which order and also return was made.

baseCurrencyRatefloatoptional

Exchange rate between currency and baseCurrency above.

returnToStockbooleanoptional

Whether the return was marked as returned back to stock.

commentstringoptional

Optional description added to the return.

createdFromstringoptional

Informs where this return originated, i.e. "Order API".

productsarrayoptional

Products inside the return.

returnLineIdintoptional

ID of the specific product item in this return.

shipmentLineIdintoptional

ID of the related shipment line.

orderLineIdintoptional

ID of the related order line.

productIdintoptional

ID of the product.

variantIdintoptional

ID of the product variant.

productNamestringoptional

Name of the product.

productBrandstringoptional

Brand name of the product.

variantNamestringoptional

Name of the product variant.

sizestringoptional

Size description, if any.

skustringoptional

Product SKU.

variantSkustringoptional

Product variant SKU.

sizeSkustringoptional

Size SKU.

eanstringoptional

EAN of the item.

upcstringoptional

UPC of the item.

upcstringoptional

UPC of the item.

quantityintoptional

Quantity of this specific product item returned.

pricefloatoptional

Unit price as seen on shipment.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 HTTP/1.1 200 OK Content-type: application/json { "status": "ok", "returns": [ { "returnId": 385, "completed": false, "shipment": "20059-1", "shipmentId": 8039, "orderId": 20059, "selectionId": "8bf93dd57e9ebf9291c8c3a5f0cb63bf", "customerId": 416715, "date": "2019-07-11 14:34:32", "marketId": 1, "pricelistId": 1, "returnCost": 0, "shippingCost": 0, "handlingCost": 0, "voucherValue": 0, "taxValue": 21.41, "taxDeduction": 0, "currency": "EUR", "baseCurrency": "SEK", "baseCurrencyRate": 10.6453, "returnToStock": true, "comment": "Godkänd retur", "createdFrom": "Order API", "products": [ { "returnLineId": 555, "shipmentLineId": 30672, "orderLineId": 60288, "productId": 159, "variantId": 372, "productName": "Muffin man", "productBrand": "Handcrafted", "variantName": "Big cart", "size": "One Size", "sku": "MUF1042", "variantSku": "", "sizeSku": "", "ean": "7340112910426", "upc": "123456", "quantity": 1, "price": 124.1 } ] }, { "returnId": 384, "shipment": "20179-1", "shipmentId": 8094, "orderId": 20179, "selectionId": "ae6eb1befe5d6f850a016932ca4276dc", "customerId": 734042, "date": "2019-07-11 14:33:56", "marketId": 1, "pricelistId": 1, "returnCost": 0, "shippingCost": 0, "handlingCost": 0, "voucherValue": 0, "taxValue": 9.08, "taxDeduction": 0, "currency": "GBP", "baseCurrency": "SEK", "baseCurrencyRate": 11.61479, "returnToStock": true, "comment": null, "createdFrom": "Order API", "products": [ { "returnLineId": 553, "shipmentLineId": 30800, "orderLineId": 60669, "productId": 196, "variantId": 430, "productName": "Plush Guitar", "productBrand": "", "variantName": "Pink", "size": null, "sku": "PNKG8484", "variantSku": "", "sizeSku": "", "ean": "7340082321862", "upc": "123456", "quantity": 1, "price": 54.5 } ] } ] }

Update return#

Endpoint: PUT *base*/returns/*returnId*
Authentication: API Key

Update information on Return.

Parameters

returnIdstringrequired

The ID from return when creating or updating a return.

completedbooleanoptional

Set to true/false to change Return status to Complete/Pending.

refundPaymentbooleanoptional

If 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.

sendEmailbooleanoptional

Send refund email. Default value is false.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 PUT <base>/returns/2 HTTP/1.1 Content-type: application/json { "completed": true }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

returnobjectrequired

Object of fetched return.

returnIdintoptional

ID of the return.

completedbooleanoptional

Whether the return was completed or not.

shipmentstringoptional

Number of the shipment

shipmentIdintoptional

ID of the shipment

orderIdintoptional

ID of the order

selectionIdstringoptional

Selection ID of the order

customerIdintoptional

Selection ID of the order

datedatetimeoptional

Date when return was created.

returnCostfloatoptional

Cost of the return.

shippingCostfloatoptional

Cost of shipping returned

handlingCostfloatoptional

Handling cost of the return.

voucherValuefloatoptional

Voucher value included in the return.

taxValuefloatoptional

Tax value of the return, zero if deducted.

taxDeductionfloatoptional

Tax deduction in the return.

currencystringoptional

Currency code in which order and also return was made.

baseCurrencystringoptional

Code of the currency used as base in this store.

baseCurrencyRatefloatoptional

Exchange rate between currency and baseCurrency above.

returnToStockbooleanoptional

Whether the return was marked as returned back to stock.

commentstringoptional

Optional description added to the return.

createdFromstringoptional

Informs where this return originated, i.e. "Order API".

productsarrayoptional

Products inside the return.

returnLineIdintoptional

ID of the specific product item in this return.

shipmentLineIdintoptional

ID of the related shipment line.

orderLineIdintoptional

ID of the related order line.

productIdintoptional

ID of the product.

variantIdintoptional

ID of the product variant.

productNamestringoptional

Name of the product.

productBrandstringoptional

Brand name of the product.

variantNamestringoptional

Name of the product variant.

sizestringoptional

Size description, if any.

skustringoptional

Product SKU.

variantSkustringoptional

Product variant SKU.

sizeSkustringoptional

Size SKU

eanstringoptional

EAN of the item.

upcstringoptional

UPC of the item.

upcstringoptional

UPC of the item.

quantityintoptional

Quantity of this specific product item returned.

pricefloatoptional

Unit price as seen on shipment

msgstringoptional

If status returns no, this value should send back a message why it failed.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 { "status": "ok", "return": { "returnId": 18, "completed": false, "shipment": "44-1", "shipmentId": 1142, "orderId": 44, "selectionId": "be337d27e16564cadad0a340b8bc1fbe", "customerId": 31, "date": "2020-01-07 17:00:29", "marketId": 1, "pricelistId": 1, "returnCost": 5, "shippingCost": 5.55, "handlingCost": 9, "voucherValue": 0, "taxValue": 21.91, "taxDeduction": 0, "currency": "SEK", "baseCurrency": "SEK", "baseCurrencyRate": 1, "returnToStock": false, "comment": null, "createdFrom": "Order API", "products": [ { "returnLineId": 17, "shipmentLineId": 2681, "orderLineId": 112, "productId": 7, "variantId": 2460, "productName": "Test Product STOCK", "productBrand": null, "variantName": null, "size": null, "sku": "TPSTOCK", "variantSku": "", "sizeSku": "", "ean": "StockTestEAN", "upc": "123456", "quantity": 1, "price": 100 } ] } }

Error example

1 2 3 4 { "status": "no", "msg": "Return with id=100500 does not exist" }

Get products#

Endpoint: GET *base*/products
Authentication: API Key

This will return product data from Centra with categories.

Parameters

skustringoptional

Get products with a specific SKU.

modifieddate/datetimeoptional

Get 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/datetimeoptional

Get 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.

eanstringoptional

Get a product with specified EAN code.

productId variantId stockItemIdintoptional

Filter products based on product, variant and stock item IDs.

limitintoptional

You 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.

includestringoptional

include=attributes will also make the products include the custom attributes defined for each product and variant.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 GET <base>/products HTTP/1.1 Content-type: application/json

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

productsarrayrequired

List of the products.

productsarrayoptional

List of the products.

skustringoptional

SKU for this product.

productstringoptional

The internal name for this product.

productIdintoptional

ID for this product.

namestringoptional

The externally facing name for this product.

variantSkustringoptional

SKU for this variant.

variantIdintoptional

ID for this variant.

sizeSkustringoptional

SKU for this size.

stockItemIdintoptional

ID for this specific stock item.

eanstringoptional

The EAN for this product item size.

weightdecimal2 (0.00)optional

The weight specified for this product.

weightUnitstringoptional

The unit used for the weight.

  • kg
  • lb
sizestringoptional

Name of the size for this specific product item.

activebooleanoptional

If the product item is active or not.

folderstringoptional

String with names of the folders the product belongs to.

Like this: Collection / Jackets.

countryOfOriginstringoptional

ISO-Alpha-2 (SE, US, GB etc)

storestringoptional

Store name product is related to.

categoriesarray|stringoptional

Array with names of the categories the product belongs to.

Like this: ["Collection / Jackets\/Outerwear", "..."].

imagesarray|stringoptional

URLs with the images connected to this product item.

Like this: ["https://xxx.centracdn.net/x/y/z.jpg", "https://..."].

pricesarrayoptional

Array of the pricelists for this product.

idintoptional

ID of the pricelist.

priceliststringoptional

Name of the pricelist.

pricestringoptional

Price for the product in this pricelist.

currencystringoptional

ISO code of the currency for this pricelist.

campaignsarrayoptional

List of campaigns this product is connected to in this pricelist.

idintoptional

ID of the campaign.

campaignstringoptional

Name of the campaign.

pricedecimal2 (0.00)optional

The price when this campaign is applied to the price. Currency will always be the same as in the pricelist.

previousstringoptional

Will contain a URL to the previous page.

nextstringoptional

Will contain a URL to the next page.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 { "status": "ok", "products": [ { "sku": "M411-740", "productId": 232, "variantSku": "", "variantId": 1211, "sizeSku": "", "brand": "Odd Molly", "collection": "Molly Prefall 2011", "product": "bakers cross 3\/4 blouse", "variant": "LITE ROSE", "size": "3", "stockItemId": 3424, "ean": "", "weight": 0.17, "weightUnit": "kg", "countryOfOrigin": "PT", "harmCode": "6206300090", "harmDescription": "Cotton - blouse", "active": 0, "folder": "Folder 1 / Folder 2" "name": "Bakers Cross", "description": "", "shortDescription": "", "comment": "", "store": "Retail", "categories": [ "Collection \/ Jackets\/Outerwear", "New Arrivals" ], "images": [ "https:\/\/...\/images\/1_0d2f67cd05.jpg", "https:\/\/...\/images\/1_318da2ad06.jpg", "https:\/\/...\/images\/1_c4e1c20d34.jpg" ], "prices": [ { "id": "36", "price": "329.00", "pricelist": "EUR Europe", "currency": "EUR", "campaigns": [ { "id": "40", "campaign": "OUTLET 50% NY", "price": 164.5 } ] }, { "id": "35", "price": "269.00", "pricelist": "GBP", "currency": "GBP", "campaigns": [ { "id": "40", "campaign": "OUTLET 50% NY", "price": 134.5 } ] } ] }, { "sku": "M411-740", "productId": 232, "variantSku": "", "variantId": 1211, "sizeSku": "", "brand": "Odd Molly", "collection": "Molly Prefall 2011", "product": "bakers cross 3\/4 blouse", "variant": "LITE ROSE", "size": "4", "stockItemId": 3425, "ean": "", "weight": 0.17, "weightUnit": "kg", "countryOfOrigin": "PT", "harmCode": "6206300090", "harmDescription": "Cotton - blouse", "active": 0, "name": "Bakers Cross", "description": "", "shortDescription": "", "comment": "", "store": "Retail", "categories": [ "Collection \/ Jackets\/Outerwear", "New Arrivals" ], "images": [ "https:\/\/...\/images\/1_0d2f67cd05.jpg", "https:\/\/...\/images\/1_318da2ad06.jpg", "https:\/\/...\/images\/1_c4e1c20d34.jpg" ] "prices": [ { "id": "36", "price": "329.00", "pricelist": "EUR Europe", "currency": "EUR", "campaigns": [ { "id": "40", "campaign": "OUTLET 50% NY", "price": 164.5 } ] }, { "id": "35", "price": "269.00", "pricelist": "GBP", "currency": "GBP", "campaigns": [ { "id": "40", "campaign": "OUTLET 50% NY", "price": 134.5 } ] } ] } ], "previous": "?limit=10&page=2", "next": "?limit=10&page=3" }

Get stock#

Endpoint: GET *base*/stock
Authentication: API Key

This will return product data from Centra with stock info. The values of the stock depends on the connected warehouses for the API-plugin.

Parameters

skustringoptional

Get products with a specific SKU.

modifieddate/datetimeoptional

Get 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/datetimeoptional

Get 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/datetimeoptional

Get 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.

eanstringoptional

Get a product with specified EAN code.

upcstringoptional

Get a product with specified UPC code.

productId variantId stockItemIdintoptional

Get a product with specified productId, variantId or stockItemId.

limitintoptional

You 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.

includestringoptional

include=attributes will also make the products include the custom attributes defined for each product and variant.

excludestringoptional

exclude=physicalStock will exclude fetching physical stock which will speed up the fetching of the stock values.

xmlbooleanoptional

Response 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

statusstringrequired

ok if success, else no.

productsarrayoptional

List of the products.

skustringoptional

SKU for this product.

productstringoptional

The internal name for this product.

productIdintoptional

The ID for this product.

variantSkustringoptional

SKU for this variant.

variantIdintoptional

ID for this variant.

sizeSkustringoptional

SKU for this size.

stockItemIdintoptional

ID for this specific stock item.

eanstringoptional

The EAN for this product item size.

upcstringoptional

The UPC for this product item size.

weightdecimal2 (0.00)optional

The weight specified for this product.

weightUnitstringoptional

The unit used for the weight.

  • kg
  • lb
sizestringoptional

Name of the size for this specific product item.

activebooleanoptional

If the product item is active or not.

countryOfOriginstringoptional

ISO-Alpha-2 (SE, US, GB etc)

physicalStockintoptional

The 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

allocatedStockintoptional

The amount of items in the physical stock that is currently allocated against orders.

availableStockintoptional

The amount of items in the physical stock that is currently available to sell.

previousstringoptional

Will contain a URL to the previous page.

nextstringoptional

Will contain a URL to the next page.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 { "status": "ok", "products": [ { "sku": "12019005", "productId": 10, "variantSku": "A", "variantId": 9, "sizeSku": "X", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLACK", "variant": "SVART", "size": "ONE SIZE", "stockItemId": 3131, "ean": "1234567890123", "upc": "123456", "weight": 22, "weightUnit": "kg", "countryOfOrigin": "", "harmCode": "87120030", "harmDescription": "Cyklar", "active": 1, "physicalStock": 5, "allocatedStock": 1, "availableStock": 4 }, { "sku": "12028008", "productId": 11, "variantSku": "B", "variantId": 10, "sizeSku": "Y", "brand": "Kronan", "collection": "ALL", "product": "Bike Man 0 speed BROWN", "variant": "BRUN", "size": "ONE SIZE", "stockItemId": 3132, "ean": "9876543210123", "upc": "123456", "weight": 22, "weightUnit": "kg", "countryOfOrigin": "", "harmCode": "87120030", "harmDescription": "CYKEL", "active": 1, "physicalStock": 141, "allocatedStock": 10, "availableStock": 131 } ], "previous": "?limit=2&page=2", "next": "?limit=2&page=3" }

Update stock#

Endpoint: POST *base*/stock
Authentication: API Key

This updates the physicalStock quantities in Centra. This is the number of products in stock including those that are reserved for orders.

You cannot set the quantity below the number that is reserved for orders, the value specified in allocatedStock from :ref:Get stock <order-api-get-stock>. In the case the stock update contains a lower amount than the allocated stock, Centra will set the quantity to allocatedStock which the lowest possible value without affecting any reserved orders.

The request will not return any error message, but an email notification can be sent to a Centra-administrator from the plugin settings.

Parameters

productsarrayrequired

Array of products to update stock on

productstringrequired

String to update a product item. Use ean, upc or a combination of sku, variantSku and sizeSku to update the quantity for each product.

quantityintrequired

The quantity of the physical stock for the item.

costPricestringoptional

The internal cost price for this item.

costPriceCurrencystringoptional

ISO code for the currency for the cost price. USD, EUR, SEK, etc.

xmlbooleanoptional

Response in xml format instead of json.

Request example The example above uses EAN, this is the same field as the Get stock product field ean. The example below uses SKU by combining the Get stock fields sku, variantSku and sizeSku:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 POST <base>/stock HTTP/1.1 Content-type: application/json { "products": [ { "product": "12312378901", # <- Combined product number (SKU) "123123" + variant number "789" + size number "01" "quantity": 54 }, { "product": "9876543210123", # <- Size-level EAN "9876543210123" "quantity": 55 }, { "product": "5432167890123", "quantity": 1 } ] }

Optionally you can also include a cost / pcs value for the items.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 POST <base>/stock HTTP/1.1 Content-type: application/json { "products":[ { "product": "1234567890123", "quantity": 54, "costPrice": 12.54, "costPriceCurrency": "SEK" }, { "product": "9876543210123", "quantity": 55, "costPrice": 8.12, "costPriceCurrency": "EUR" }, { "product": "5432167890123", "quantity": 1, "costPrice": 54.24, "costPriceCurrency": "USD" } ] }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

msgstringoptional

If status returns no, this value should send back a message why it failed.

errorsobjectoptional

If status returns no, this object might contain information about products that could not be updated.

productsNotFoundarray of stringoptional

This will be an array with the product identifiers that could not be updated from the request.

Like this: ["43242342", "43243294", "432432232"]

productsAreBundlesarray of stringoptional

This will be an array with the product identifiers that are bundled products. This means that they can not be updated directly, since they are based on products the bundle is connected to.

Like this: ["43242342", "43243294", "432432232"]

Response example

1 2 3 { "status":"ok" }

Error example

1 2 3 4 5 6 7 8 9 10 { "status": "no", "msg": "Some of the products were not updated", "errors": { "productsNotFound": [ "9876543210123", "5432167890123" ] } }

List Customers#

Endpoint: GET *base*/customers
Authentication: API Key

Return list of the customers.

Parameters

limitintoptional

Limit amount of customers returned.

offsetintoptional

Offset how far in to start returning customers.

emailstringoptional

Return a specific customer.

createddate/datetimeoptional

Get 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/datetimeoptional

Get 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.

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/customers?limit=5&offset=5 HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

customersarrayoptional

Array of customers returned.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 { "status": "ok", "customers": [ { "customerId": "1", "email": "max.buch@example.com", "firstName": "Max", "lastName": "Buch", "address1": "", "address2": "", "zipCode": "", "city": "", "state": "", "country": "SE", "phoneNumber": "", "newsletter": true, "gender": "", "registered": false, "consents": [ { "key": "test_key1", "name": "Consent1", "consented": false, "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ", "language": "", "version": "", "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" } ], "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" }, { "customerId": "6", "email": "felix.parker@example.com", "firstName": "Felix", "lastName": "Parker", "address1": "", "address2": "Forest st. 102", "zipCode": "95131", "city": "San Jose", "state": "CA", "country": "US", "phoneNumber": "", "newsletter": false, "gender": "", "registered": true, "consents": [], "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" } ] }

Get customer#

Endpoint: GET *base*/customers/*customerId*
Authentication: API Key

Return customer by specified ID.

Parameters

customerIdintrequired

The customerID from :ref:List customers <order-api-list-customers>.

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 GET <base>/customers/4234 HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

customerobjectrequired

The customer object.

customerIdstringoptional

ID of the customer.

emailstringoptional

Email for the customer.

address1 address2 zipCode city statestringoptional

The address of the customer

countrystringoptional

The country of the customer. ISO-Alpha-2 (SE, US, GB etc).

consentsarrayoptional

List of consents the customer has accepted. These consents are mostly created from external systems that can select their own data in these fields.

keystringoptional

The key for this specific consent.

namestringoptional

Name of consent.

consentedbooleanoptional

If the customer has consented to this or not.

textstringoptional

The description of this consent.

languagestringoptional

The language for this consent. No restrictions on the format of the language code.

createddatetimeoptional

Date when the customer was created.

newsletterbooleanoptional

If the customer has opt-ed in for newsletters.

modifieddatetimeoptional

Date when the customer was modified.

registeredbooleanoptional

If the customer was registered, which means it is allowed to sign in.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 { "status": "ok", "customer": { "customerId": "4", "email": "jon.snow@example.com", "firstName": "Jon", "lastName": "Snow", "address1": "Time Square 55", "address2": "", "zipCode": "2456", "city": "Tampa", "state": "LA", "country": "US", "phoneNumber": "096456192", "newsletter": true, "gender": "", "registered": false, "consents": [ { "key": "test_key1", "name": "Consent1", "consented": true, "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ", "language": "", "version": "1", "created": "2018-03-15 20:40:36", "modified": "2018-03-15 20:40:36" }, { "key": "test_key2", "name": "Consent2", "consented": false, "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ", "language": "EN", "version": "", "created": "2018-03-15 20:41:14", "modified": "2018-03-15 20:41:14" } ], "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" } }

Update customer#

Endpoint: PUT *base*/customers/*customerId*
Authentication: API Key

Update customer information.

Parameters

customerIdintrequired

The customerID from :ref:List customers <order-api-list-customers>.

firstName lastName ...customer objectoptional

The customer object

xmlbooleanoptional

Response in xml format instead of json.

Request example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 PUT <base>/customers/4234 HTTP/1.1 Content-type: application/json { "firstName": "Benjamin", "lastName": "Simon", "address1": "", "address2": "New Address2", "zipCode": "10500", "city": "BRIGHTON", "country": "US", "state": "CA", "phoneNumber": "9004505123", "gender": "", "consents": [ { "key": "firts_con", "consented": true }, { "key": "second_con", "consented": false, "version": "1.0", "language": "EN" } ] }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

customerobjectrequired

Customer object. The customer object is explained in :ref:Get Customer Parameters <order-api-get-customer-response>.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 { "status": "ok", "customer": { "customerId": "1", "email": "benjamin.simon@example.com", "firstName": "Benjamin", "lastName": "Simon", "address1": "", "address2": "New Address2", "zipCode": "10500", "city": "BRIGHTON", "state": "CA", "country": "US", "phoneNumber": "9004505123", "newsletter": true, "gender": "", "registered": false, "consents": [ { "key": "test_key1", "name": "Consent1", "consented": false, "text": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industrys standard dummy text ever since the 1500s, when an unknown printer took a galley ", "language": "", "version": "", "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" }, { "key": "firts_con", "name": "", "consented": true, "text": "", "language": "", "version": "", "created": "2018-03-21 12:17:54", "modified": "2018-03-21 12:17:54" }, { "key": "second_con", "name": "", "consented": false, "text": "", "language": "EN", "version": "1.0", "created": "2018-03-21 12:17:54", "modified": "2018-03-21 12:17:54" } ], "created": "2018-03-15 20:42:59", "modified": "2018-03-15 20:42:59" } }

Error example

1 2 3 4 { "status": "no", "msg": "The customer was not found." }

Anonymize customer#

Endpoint: PUT *base*/anonymize-customer/*customerId*
Authentication: API Key

This endpoint will anonymize all personal data for a customer identifed by the customer id.

This is irrevocable. Personal data will be permanently deleted. This may include financial data. Invoices due to legal requirements will NOT be anonymized.

Parameters

customerIdintrequired

The 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

statusstringrequired

ok if success, else no.

msgstringoptional

The response if the anonymization was successful or an error if status is no.

Response example

1 2 3 4 { "status": "ok", "msg": "The personal data has been anonymized." }

Error example

If the customer was not found:

1 2 3 4 { "status": "no", "msg": "The customer was not found." }

If the customer was already anonymized:

1 2 3 4 { "status": "no", "msg": "The personal data was already anonymized." }

List supplier orders#

Endpoint: GET *base*/supplier-orders
Authentication: API Key

Get all confirmed supplier orders visible by the plugin.

Parameters

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/supplier-orders HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

ordersarrayoptional

Array of orders returned

orderIdstringrequired

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.

ETDdatetimeoptional

Estimated time of delivery for the customer.

productsQtyintoptional

The total quantity of products in this supplier order.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "status": "ok", "orders": [ { "orderId": "957", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 20000 }, { "orderId": "957", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 10000 } ] }

Get supplier order#

Endpoint: GET *base*/supplier-orders/*supplierOrderId*
Authentication: API Key

List the products inside a supplier order.

Parameters

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/supplier-orders/*supplierOrderId* HTTP/1.1

Response

200 Content-type: application/json

statusbooleanrequired

ok if success, else no.

orderobjectrequired

Information about this specific supplier order.

orderIdstringrequired

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that fits into a specific delivery window.

ETDdatetimeoptional

Estimated time of delivery for the customer.

productsQtyintoptional

The total quantity of products in this supplier order.

productsarrayoptional

The 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:

quantityintoptional

The amount of product items ordered.

coststringoptional

The cost / pcs for this item.

costCurrencystringoptional

The currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB etc).

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 { "status": "ok", "order": { "orderId": "957", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 20000, "products": [ { "sku": "12019005", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLACK", "variant": "SVART", "size": "ONE SIZE", "ean": "898989891212", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 122 "cost": "9.40", "costCurrency": "USD" }, { "sku": "12019007", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLUE", "variant": "BLUE", "size": "ONE SIZE", "ean": "898989891213", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 342, "cost": "12.40", "costCurrency": "EUR" } ] } }

List supplier deliveries#

Endpoint: GET *base*/supplier-deliveries
Authentication: API Key

Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.

Deliveries will be listed when these requirements are fulfilled:

  • Delivery created on a confirmed Supplier Order.
  • Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
  • Delivery is not accepted yet.
  • Delivery has items in it.

Parameters

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/supplier-deliveries HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

deliveriesarrayoptional

Array of deliveries returned

idstringoptional

Internal ID for the supplier order delivery.

deliveryIdstringoptional

ID of the supplier order delivery. This is the ID communicated externally.

orderIdstringoptional

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order delivery was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.

ETDdatetimeoptional

Estimated time of delivery for the customer.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 { "status": "ok", "deliveries": [ { "id": "364", "orderId": "957", "deliveryId": "957-1", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 20000 }, { "id": "365", "orderId": "957", "deliveryId": "957-2", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 10000 } ] }

Get supplier delivery#

Endpoint: GET *base*/supplier-deliveries/*supplierDeliveryId*
Authentication: API Key

Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.

Deliveries will be listed when these requirements are fulfilled:

  • Delivery created on a confirmed Supplier Order.
  • Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
  • Delivery is not accepted yet.
  • Delivery has items in it.

Parameters

xmlbooleanoptional

Response 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

statusbooleanrequired

ok if success, else no.

deliveryobjectrequired

Information about this specific supplier order delivery.

idstringoptional

Internal ID for the supplier order delivery.

deliveryIdstringoptional

ID of the supplier order delivery. This is the ID communicated externally.

orderIdstringoptional

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order delivery was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.

ETDdatetimeoptional

Estimated time of delivery for the customer.

productsQtyintoptional

The total quantity of products in this supplier order.

productsarrayoptional

The 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:

quantityintoptional

The amount of product items attached to this delivery.

coststringoptional

The cost / pcs for this item.

costCurrencystringoptional

The currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB etc).

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 { "status": "ok", "delivery": { "id": "364", "orderId": "957", "deliveryId": "957-1", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 20000, "products": [ { "sku": "12019005", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLACK", "variant": "SVART", "size": "ONE SIZE", "ean": "898989891212", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 122 "cost": "9.40", "costCurrency": "USD" }, { "sku": "12019007", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLUE", "variant": "BLUE", "size": "ONE SIZE", "ean": "898989891213", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 342, "cost": "12.40", "costCurrency": "EUR" } ] } }

Get supplier delivery details#

Endpoint: GET *base*/supplier-deliveries/*supplierDeliveryId*/details
Authentication: API Key

Get the incoming and not accepted deliveries that are connected to the warehouse this plugin is connected to.

Deliveries will be listed when these requirements are fulfilled:

  • Delivery created on a confirmed Supplier Order.
  • Supplier order has the Preferred Warehouse set to the "Supplier Delivery Warehouse" in the Plugin.
  • Delivery is not accepted yet.
  • Delivery has items in it.

Parameters

xmlbooleanoptional

Response 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

statusbooleanrequired

ok if success, else no.

deliveryobjectrequired

Information about this specific supplier order delivery.

idstringoptional

Internal ID for the supplier order delivery.

deliveryIdstringoptional

ID of the supplier order delivery. This is the ID communicated externally.

orderIdstringoptional

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order delivery was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.

ETDdatetimeoptional

Estimated time of delivery for the customer.

productsQtyintoptional

The total quantity of products in this supplier order.

ordersarrayoptional

The list of orders that has reserved products for this supplier order delivery.

orderIdstringoptional

The order ID for the customer order.

accountIdstringoptional

The account ID for the customer.

accountNamestringoptional

The name of the account.

buyerstringoptional

The name of the buyer from account placing the order.

carrierstringoptional

The preferred carrier for this account.

servicestringoptional

The preferred carrier service for this account.

paymentTermsstringoptional

The payment terms defined for this order.

shippingTermsstringoptional

The shipping terms defined for this order.

poNumberstringoptional

PO number used when placing the order.

deliveryName deliveryCompany deliveryEmail deliveryCell deliveryTele deliveryAddress deliveryCoaddress deliveryZipcode deliveryCity deliveryStatestringoptional

The address the order should be delivered to.

deliveryCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

productsarrayoptional

The 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:

quantityintoptional

The amount of product items reserved from this supplier order delivery to the customer order.

coststringoptional

The cost / pcs for this item.

costCurrencystringoptional

The currency code for the cost / pcs. ISO-Alpha-2 (SE, US, GB etc).

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 { "status": "ok", "delivery": { "id": "364", "orderId": "957", "deliveryId": "957-1", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 20000, "orders": [ { "orderId": "83982", "accountId": "478", "accountName": "Internal ROW", "buyer": "Internal ROW, John ", "carrier": "", "service": "", "other": "Other Comment", "paymentTerms": "30 Net", "shippingTerms": "Ex. Works", "poNumber": "Pre Spring 17", "deliveryName": "John Doe", "deliveryCompany": "A Company", "deliveryEmail": "info@example.com", "deliveryCell": "", "deliveryTele": "0", "deliveryAddress": "Skogsgatan 123", "deliveryCoaddress": "C/O: Warehouse", "deliveryZipcode": "12345", "deliveryCity": "Stockholm", "deliveryState": "0", "deliveryCountry": "SE", "products": [ { "sku": "12019005", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLACK", "variant": "SVART", "size": "ONE SIZE", "ean": "898989891212", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 122 "cost": "9.40", "costCurrency": "USD" }, { "sku": "12019007", "variantSku": "A", "sizeSku": "", "brand": "Kronan", "collection": "ALL", "product": "Bike Lady 0 speed BLUE", "variant": "BLUE", "size": "ONE SIZE", "ean": "898989891213", "upc": "123456", "weight": 22, "weightUnit": "kg", "quantity": 342, "cost": "12.40", "costCurrency": "EUR" } ] }, { "orderId": "..."} ] } }

Accept supplier delivery#

Endpoint: POST *base*/supplier-deliveries/*supplierDeliveryId*
Endpoint: POST *base*/supplier-deliveries/*supplierDeliveryId*/sku
Authentication: API Key

Will accept the delivery with the proper quantities in the physical delivery. This will be inserted into the preferred warehouse.

This can only be done once per supplier delivery.

It is possible to over deliver or under deliver when accepting the delivery. This will be visible inside Centra when delivery was accepted.

In case of under delivery a new delivery containing the undelivered products will be created.

Parameters

productsobjectrequired

Key is from the :ref:Get supplier delivery <order-api-get-supplier-delivery> and value is the quantity.

key in objectstringrequired

Use 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 objectintrequired

Quantity of the item that should be accepted.

insertStockbooleanoptional

Default 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
xmlbooleanoptional

Response in xml format instead of json.

Request example

Both id and deliveryId from List supplier deliveries can be used to accept a supplier delivery.

1 2 3 4 5 6 7 8 9 10 POST <base>/supplier-delivery/364 HTTP/1.1 Content-type: application/json { "products": { "73213213123": 32, "73213213124": 12, }, "insertStock": false }

Accept using SKU instead of EAN

Append /sku to the URL and switch from EAN to SKU for the product keys.

1 2 3 4 5 6 7 8 9 POST <base>/supplier-delivery/364/sku HTTP/1.1 Content-type: application/json { "products": { "PRODSKUVARIANTSKUSIZESKU": 32, "PRODSKUVARIANTSKUSIZESKU2": 12, } }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

additionalDeliveryobjectoptional

If 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.

idstringoptional

Internal ID for the created supplier order delivery.

deliveryIdstringoptional

ID of the supplier order delivery. This is the ID communicated externally.

orderIdstringoptional

ID of the supplier order.

supplierCountrystringoptional

ISO-Alpha-2 (SE, US, GB etc).

createddatetimeoptional

The date this supplier order delivery was created.

ETAdatetimeoptional

Estimated time of arrival to the warehouse. This will be used to calculate what orders that should be automatically connected to this specific delivery.

ETDdatetimeoptional

Estimated time of delivery for the customer.

productsQtyintoptional

The total quantity of products remaining in the accepted supplier order delivery.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 { "status":"ok", "additionalDelivery": { "id": "365", "orderId": "957", "deliveryId": "957-2", "supplierName": "Falca", "supplierCountry": "ES", "created": "2019-01-28 01:15", "ETD": "2019-03-31 15:15", "ETA": "2019-04-05 20:15", "message": "Text entered by centra admin", "productsQty": 19891 } }

Create voucher#

Endpoint: POST *base*/voucher
Authentication: API Key

This will create a simple voucher of percentoff or priceoff type

Parameters

namestringrequired

Name of the voucher.

codestringoptional

Code of the voucher. Will be generated a random one if not passed.

startDatestringoptional

Start date of the voucher in Y-m-d format. Will be set to current one if not passed.

stopDatestringrequired

Stop date of the voucher in Y-m-d format.

typeenumrequired

Type of the voucher. One of percentoff or priceoff

valuefloatoptional

Value of the voucher. Is required if percentoff is a voucher type

valueByPricelistobjectoptional

Values 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.

storeintrequired

Store id for voucher

marketsint|arrayrequired

Markets for voucher

limitintoptional

Limit of the voucher usage, where 0 means unlimited. Is 0 if not passes.

statusbooleanrequired

Is voucher active or inactive

conversionHtmlstringoptional

Conversion html of the voucher

Request examples

1 2 3 4 5 6 7 8 9 10 11 POST <base>/voucher HTTP/1.1 { "name": "Welcome 10%", "stopDate": "2022-07-09", "type": "percentoff", "value": 10, "store": 1, "markets": 1, "status": true }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 POST <base>/voucher HTTP/1.1 { "name": "Welcome!", "stopDate": "2022-07-09", "type": "priceoff", "valueByPricelist": { "19": 100, "20": 10 }, "store": 1, "markets": 1, "status": true }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

voucherintoptional

ID of a created voucher

codestringoptional

Code of a created voucher

Response example

1 2 3 4 5 { "status": "ok", "voucher": 13, "code": "quooquadi_t6uqwecifin" }

Errors example

Required fields are not passed

1 2 3 4 5 6 7 8 9 10 11 { "status": "no", "msg": { "name": "required", "stopDate": "required", "type": "required", "store": "required", "markets": "required", "status": "required" } }

Market does not exist for a provided store

1 2 3 4 5 6 { "status": "no", "msg": { "markets": "Market 2 not found." } }

Neither value nor valueByPricelist provided

1 2 3 4 5 6 { "status": "no", "msg": { "value": "One of 'value' or 'valueByPricelist' should be provided." } }

Clone voucher#

Endpoint: PUT *base*/voucher/*id*/clone
Authentication: API Key

This will clone a voucher with updated provided information

Parameters

namestringoptional

Name of the voucher.

codestringoptional

Code of the voucher. Will be generated a random one if not passed.

stopDatestringrequired

Stop date of the voucher in Y-m-d format.

conversionHtmlstringoptional

Conversion html of the voucher

Request example

1 2 3 4 5 6 7 PUT <base>/voucher/3/clone HTTP/1.1 { "name": "Welcome 10%", "code": "new-welcome-10", "stopDate": "2022-07-09" }

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

voucherintoptional

Id of a new voucher

codestringoptional

Code of a new voucher

Response example

1 2 3 4 5 { "status": "ok", "voucher": 4, "code": "new-welcome-10" }

Errors example

Required fields are not passed

1 2 3 4 5 6 7 { "status": "no", "voucher": "4", "msg": { "stopDate": "required" } }

Voucher not found

1 2 3 4 5 6 7 { "status": "no", "voucher": "3", "msg": { "voucher": "Voucher not found" } }

Auto vouchers not supported

1 2 3 4 5 6 7 { "status": "no", "voucher": "3", "msg": { "voucher": "Auto vouchers not supported" } }

Voucher does not belong to this store

1 2 3 4 5 6 7 { "status": "no", "voucher": "3", "msg": { "voucher": "Voucher does not belong to this store" } }

Get voucher#

Endpoint: GET *base*/vouchers/*id*
Authentication: API Key

Return active/inactive voucher by specified ID. Cancelled vouchers are ignored.

Parameters

idintrequired

Voucher id.

xmlbooleanoptional

Response in xml format instead of json.

Request example

GET <base>/vouchers/1 HTTP/1.1

Response

200 Content-type: application/json

statusstringrequired

ok if success, else no.

voucherobjectrequired

The voucher object.

idintoptional

ID of the voucher.

namestringoptional

Name for the voucher.

codestringoptional

Code of the voucher

startDatedateoptional

The date in Y-m-d format when the voucher starts being active

stopDatedateoptional

The date in Y-m-d format when the voucher stops being active

typestringoptional

Type of the voucher e.g. priceoff, percentoff

valuefloatoptional

Value of the voucher. Exists for percentoff voucher type

valueByPrcelistobjectoptional

Value of the voucher for each price list. Contains id of price list to value. Exists for priceoff voucher type

storeintoptional

Store the voucher is valid for

marketsarrayoptional

List of the markets voucher is valid for

limitintoptional

The voucher max usage limit

statusstringoptional

Status of the voucher. One of active, inactive

priorityintoptional

The voucher priority

conversionHtmlstringoptional

Conversion html for voucher

createdAtdatetimeoptional

The date in Y-m-d H-i-s format when the voucher was created.

Response example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 { "status": "ok", "voucher": { "id": 1, "name": "Welcome 10%", "code": "welcome10", "conversionHtml": "", "startDate": "2020-06-26", "stopDate": "2020-07-09", "type": "percentoff", "value": "10", "store": 1, "markets": [ 1 ], "limit": 1, "status": "active", "priority": 1, "createdAt": "2020-06-25 12:00:00" } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 { "status": "ok", "voucher": { "id": 1, "name": "Welcome 10", "code": "welcome10", "conversionHtml": "", "startDate": "2020-06-26", "stopDate": "2020-07-09", "type": "priceoff", "value": null, "valueByPricelist": { "1": 10, "2": 44, "3": 13, "4": 130, }, "store": 1, "markets": [ 1 ], "limit": 1, "status": "active", "priority": 1, "createdAt": "2020-06-25 12:00:00" } }