API ReferenceCommerce

Inventory

Warehouses, stock levels, the inventory transactions that record each movement, and the fulfilments that get an order’s items to the customer.

About inventory

A warehouse is a place stock is kept, with a unique code and an address. A stock row holds one product’s quantities in one warehouse: available, reserved, in transit and on hand; it is read-only here. A transaction is a ledger entry for one movement of stock; one you record cannot be changed or deleted. A transaction that makes a product available again fires the back-in-stock event that a job can turn into an email.

A fulfilment is the part of a placed order that leaves one warehouse together, as a delivery or a pickup. A delivery moves from pending to ready, in_transit and delivered; a pickup moves from pending to ready and delivered, which reads “Collected”. Both can be cancelled until they leave the warehouse. A fulfilment whose shipping method has nothing to ship, such as a gift card or a service, has no warehouse and is delivered when the order is paid. The status changes only through the fulfilment routes on this page. Each answers with the fulfilment under data.fulfillment and a message, a 422 with a message when the change is refused, and a 403 when the user’s role may not make it.

With inventory tracking on, the platform writes transactions as an order moves. The purchase holds each line’s stock (checkout_reservation), and a fulfilment added by hand holds its own (fulfillment_reservation). The hold moves with the fulfilment’s warehouse and goes when a pending fulfilment is deleted. Shipping, delivering, collecting and cancelling each write a transaction with a reason: fulfillment_shipped, fulfillment_delivered, fulfillment_collected or fulfillment_cancelled.

Stock Read-only

Stock rows are listed, not written; they follow the inventory transactions.

Orders, invoices and fulfilment
Transactions Append-only

A transaction you record cannot be edited or deleted. The stock held for a fulfilment is the exception: it moves with the fulfilment’s warehouse and goes when a pending fulfilment is deleted.

Orders, invoices and fulfilment
Warehouses Active or not

active is a datetime, like published elsewhere; a new warehouse is inactive.

Orders, invoices and fulfilment
Fulfilments Lifecycle only

The status moves only through the ready, ship, deliver, cancel and shipment routes, which move the stock and log the change.

Stock, fulfilment and the member's order screens
Access Admin users

Members are refused: a 404 by default, a 403 where the site’s access-denied setting says so. Call it from a server with an admin user’s OAuth token or API key.

Authentication and authorisation

List warehouses#

GET /cdna-api/inventory/warehouses

Lists warehouses. Without limit every match comes back.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Warehouse, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,name,code,active,address{addressLine1,suburb,postcode,countryName}}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List warehouses
GET /cdna-api/inventory/warehouses?limit=2&properties={id,name,code,active,address{addressLine1,suburb,postcode,countryName}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 1,
  "data": [
    {
      "id": 1,
      "name": "API sandbox warehouse",
      "code": "API-SANDBOX",
      "active": null,
      "address": {
        "addressLine1": "1 Example Street",
        "suburb": "Melbourne",
        "postcode": "3000",
        "countryName": "Australia"
      }
    }
  ]
}
Real response from this documentation site

Show a warehouse#

GET /cdna-api/inventory/warehouse/{id}

Reads one warehouse by its id.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Warehouse, in the Reference

Parameters

idpathrequired
integer
The warehouse id.
propertiesquery
selector
The fields and relations to return, such as {id,name,code,active,address{addressLine1,suburb,postcode,countryName}}.

Example

Show a warehouse
GET /cdna-api/inventory/warehouse/1?properties={id,name,code,active,address{addressLine1,suburb,postcode,countryName}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "name": "API sandbox warehouse",
    "code": "API-SANDBOX",
    "active": null,
    "address": {
      "addressLine1": "1 Example Street",
      "suburb": "Melbourne",
      "postcode": "3000",
      "countryName": "Australia"
    }
  }
}
Real response from this documentation site

Create a warehouse#

POST /cdna-api/inventory/warehouse

Creates a warehouse.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new warehouse, in the fields properties asks for, and a message.

Parameters

namebodyrequired
string
The name, up to 190 characters.
codebodyrequired
string
A unique code.
addressbodyrequired
object
companyName, addressLine1, suburb, stateName, postcode, countryName, and coordinates as {"latitude": -37.8136, "longitude": 144.9631}. With inventory tracking on, warehouses are ranked by distance from the customer, and one without coordinates ranks after those that have them. Saving a warehouse in the admin fills them in when a Google Geocoding API key is set.
externalIdbody
string
The warehouse’s id in another system; unique.
activebody
datetime
true makes it active now; a new warehouse is inactive.

Example

Create a warehouse
POST /cdna-api/inventory/warehouse?properties={id,name,code,active,address{addressLine1,suburb,postcode,countryName}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "name": "API sandbox warehouse",
  "code": "API-SANDBOX",
  "address": {
    "companyName": "Example Pty Ltd",
    "addressLine1": "1 Example Street",
    "suburb": "Melbourne",
    "stateName": "VIC",
    "postcode": "3000",
    "countryName": "Australia"
  }
}
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 1,
    "name": "API sandbox warehouse",
    "code": "API-SANDBOX",
    "active": null,
    "address": {
      "addressLine1": "1 Example Street",
      "suburb": "Melbourne",
      "postcode": "3000",
      "countryName": "Australia"
    }
  },
  "message": "The Warehouse has been added successfully."
}
Real response from this documentation site

Edit a warehouse#

PUT /cdna-api/inventory/warehouse/{id}

Changes a warehouse. Fields left out keep their values.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The saved warehouse under data.warehouse, and a message.

Parameters

idpathrequired
integer
The warehouse id.
name, code, address, externalId, activebody
As for Create a warehouse.

Example

Edit a warehouse
PUT /cdna-api/inventory/warehouse/9 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "active": true
}

Delete a warehouse#

DELETE /cdna-api/inventory/warehouse/{id}

Deletes a warehouse and its stock rows.

Access
Admin users and integrations, with an OAuth access token or an API key.

Parameters

idpathrequired
integer
The warehouse id.

Example

Delete a warehouse
DELETE /cdna-api/inventory/warehouse/9 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json

List stock#

GET /cdna-api/inventory/stocks

Lists stock rows: one product’s quantities in one warehouse. Read-only. This site has none.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Stock, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,availableQuantity,reservedQuantity,inTransitQuantity,onHandQuantity}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List stock
GET /cdna-api/inventory/stocks?limit=2&properties={id,availableQuantity,reservedQuantity,inTransitQuantity,onHandQuantity} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 0,
  "data": []
}
Real response from this documentation site

List transactions#

GET /cdna-api/inventory/transactions

Lists inventory transactions, the ledger of stock movements. This site has none.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Transaction, in the Reference

Parameters

propertiesquery
selector
The fields and relations to return, such as {id,productCode,reason,availableQuantity,created}.
filtersquery
name=value
Any stored field, or a relation with a dot, such as parent.id=12. Prefix the name with !, >, <, % or |. Use stored field names exactly as in the model, and compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List transactions
GET /cdna-api/inventory/transactions?limit=2&properties={id,productCode,reason,availableQuantity,created} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 0,
  "data": []
}
Real response from this documentation site

Record a transaction#

POST /cdna-api/inventory/transaction

Writes a ledger entry for one stock movement. It cannot be changed or deleted afterwards. When it makes a product available again, the back-in-stock event fires.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The new transaction under data.transaction, and a message.
Model
Transaction, in the Reference

Parameters

productCodebodyrequired
string
The product’s or variant’s SKU.
availableQuantity, reservedQuantity, inTransitQuantity, onHandQuantitybody
integer
The quantities moved; 0 when left out.
warehousebody
integer
The warehouse, by id.
reasonbody
string
Why the stock moved.

Example

Record a transaction
POST /cdna-api/inventory/transaction HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "productCode": "API-SANDBOX-MUG",
  "warehouse": 1,
  "reason": "Stocktake",
  "availableQuantity": 20,
  "onHandQuantity": 20
}
Response 422 Unprocessable EntityNo product code
{
  "result": "error",
  "validationErrors": {
    "productCode": [
      {
        "message": "This value should not be blank.",
        "code": "c1051bb4-d103-4f74-8988-acbcafc7fdc3",
        "propertyPath": "productCode"
      }
    ]
  },
  "message": "A validation error occurred; please check the submitted fields for errors."
}
Real response from this documentation site

List an order’s fulfilments#

GET /cdna-api/inventory/fulfillments/{order.id}

Lists the fulfilments of one order; without the order id, /inventory/fulfillments, the fulfilments of every placed order. A checkout’s fulfilments are not listed.

Each fulfilment comes back with id, type (delivery or pickup), nothingToShip, status, statusDisplay, statusLabels, externalId, allowedActions, warehouse (id, name, code), order (its id), deliveryAddress, selectedShippingRate, fulfillmentItems, shipments with their tracking logs, created, modified and hateoasLinks. Ask for shippingRates, transactions or the status history, logs{fromStatus,toStatus,created}, with properties.

status is pending, ready, in_transit, delivered or cancelled. statusDisplay words it for the type: a pickup reads “Ready for collection” and “Collected”, and a fulfilment with nothing to ship reads “Delivered digitally”. allowedActions names the routes the fulfilment takes now: markReady, ship, deliver, cancel and addShipment. A shipment’s trackingUrl is always an http or https address, or null.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Fulfillment, in the Reference

Parameters

order.idpath
integer
The order id; left out, the fulfilments of every placed order.
propertiesquery
selector
The fields and relations to return, such as {id,type,status,allowedActions,warehouse{id,code}}.
filtersquery
name=value
order.id, status, type or warehouse.id, such as status=ready, or any other stored field. Prefix the name with !, >, <, % or |. Compare totalCount with the unfiltered list's to confirm a filter applied.
orderByquery
string
field:ASC or field:DESC, comma-separated. Stored fields only.
limitquery
integer
Records per response. There is no default.
offsetquery
integer
Records to skip.

Example

List an order’s fulfilments
GET /cdna-api/inventory/fulfillments/9?properties={id,type,status,statusDisplay,allowedActions,warehouse{id,code}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "totalCount": 2,
  "data": [
    {
      "id": 41,
      "type": "delivery",
      "status": "ready",
      "statusDisplay": "Ready",
      "allowedActions": [
        "ship",
        "cancel",
        "addShipment"
      ],
      "warehouse": {
        "id": 1,
        "code": "API-SANDBOX"
      }
    },
    {
      "id": 42,
      "type": "delivery",
      "status": "pending",
      "statusDisplay": "Pending",
      "allowedActions": [
        "markReady",
        "cancel"
      ],
      "warehouse": {
        "id": 2,
        "code": "SYD-01"
      }
    }
  ]
}
Built from the platform’s source; the ids are examples

Show a fulfilment#

GET /cdna-api/inventory/fulfillment/{id}

Reads one fulfilment of a placed order by its id, in the same shape as the list.

Access
Admin users and integrations, with an OAuth access token or an API key.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.
propertiesquery
selector
The fields and relations to return, such as {id,status,allowedActions,shipments{trackingCode,trackingUrl}}.

Example

Show a fulfilment
GET /cdna-api/inventory/fulfillment/41?properties={id,type,status,statusDisplay,externalId,allowedActions,warehouse{id,name,code},shipments{trackingCode,trackingUrl}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "id": 41,
    "type": "delivery",
    "status": "in_transit",
    "statusDisplay": "In Transit",
    "externalId": "WMS-100233",
    "allowedActions": [
      "deliver",
      "addShipment"
    ],
    "warehouse": {
      "id": 1,
      "name": "API sandbox warehouse",
      "code": "API-SANDBOX"
    },
    "shipments": [
      {
        "trackingCode": "AB123456789",
        "trackingUrl": "https://tracking.example.com/AB123456789"
      }
    ]
  }
}
Built from the platform’s source; the ids are examples

Create a fulfilment#

POST /cdna-api/inventory/fulfillment

Adds a pending fulfilment to a placed order, for items no active fulfilment holds, such as the items of a cancelled one.

The fulfilment takes the order’s type and delivery address, and no shipping is charged: the order was paid for when it was placed. order, warehouse and item also take {"id": …}.

With inventory tracking on, warehouse is required. It must be one the order’s shipping rules allow for every line, and it must hold every line in stock; the stock is held at once. Items whose shipping methods all have nothing to ship, such as gift cards, are sent without a warehouse and become a digital fulfilment. With tracking on they cannot share a fulfilment with items that ship.

A refusal is a 422 with a message that names the reason. A 503 with a Retry-After header means other orders are holding the same stock at that moment: send the request again after that many seconds.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

orderbodyrequired
integer
The placed order, by id.
fulfillmentItemsbodyrequired
list
Up to 200 lines, each {"item": …, "quantity": …}: the id of one of the order’s items, and a whole number of its units.
warehousebody
integer
The warehouse the items leave from, by id. Required with inventory tracking on; left out for items that ship nothing.
externalIdbody
string
The fulfilment’s id in a warehouse or carrier system, up to 190 characters.

Example

Create a fulfilment
POST /cdna-api/inventory/fulfillment?properties={fulfillment{id,type,status,externalId,warehouse{id,code}}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "order": 9,
  "warehouse": 2,
  "fulfillmentItems": [
    {
      "item": 31,
      "quantity": 1
    }
  ],
  "externalId": "WMS-100234"
}
Response
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 43,
      "type": "delivery",
      "status": "pending",
      "externalId": "WMS-100234",
      "warehouse": {
        "id": 2,
        "code": "SYD-01"
      }
    }
  },
  "message": "Fulfillment #43 was added and its stock reserved."
}
{
  "result": "error",
  "message": "Only 1 of API sandbox mug can still be added to a fulfillment, but 2 were entered."
}
Built from the platform’s source; the ids are examples

Edit a fulfilment#

PUT /cdna-api/inventory/fulfillment/{id}

Changes a fulfilment’s external ID, or the warehouse of a pending one. Fields left out keep their values.

externalId can change in any status. warehouse can change only while the fulfilment is pending and has something to ship. The new warehouse must be one the order’s shipping rules allow; with inventory tracking on it must also hold every line, and the held stock moves with the fulfilment. A 503 with a Retry-After header means other orders are holding the same stock at that moment: send the request again after that many seconds.

The status is not edited here. It moves only through the routes that mark a fulfilment ready, shipped, delivered or cancelled, which move the stock and log the change.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.
externalIdbody
string
The fulfilment’s id in a warehouse or carrier system, up to 190 characters; empty clears it.
warehousebody
integer
The new warehouse, by id. Pending fulfilments only.

Example

Edit a fulfilment
PUT /cdna-api/inventory/fulfillment/42?properties={fulfillment{id,status,externalId}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "externalId": "WMS-100235"
}
Response
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 42,
      "status": "pending",
      "externalId": "WMS-100235"
    }
  },
  "message": "Fulfillment #42 was updated."
}
{
  "result": "error",
  "message": "Fulfillment #41 is no longer pending, so its warehouse cannot change."
}
Built from the platform’s source; the ids are examples

Delete a fulfilment#

DELETE /cdna-api/inventory/fulfillment/{id}

Removes a pending fulfilment. Its held stock goes back to available, and its items can be placed again.

Only a pending fulfilment can be deleted, and not the order’s only one. Cancel those instead; the 422 says which applies.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The deleted fulfilment’s id under data.fulfillment.id, and a message.

Parameters

idpathrequired
integer
The fulfilment id.

Example

Delete a fulfilment
DELETE /cdna-api/inventory/fulfillment/43 HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 43
    }
  },
  "message": "Fulfillment #43 was deleted and its stock released."
}
{
  "result": "error",
  "message": "Fulfillment #43 is the order's only fulfillment, so it cannot be deleted. Cancel it instead."
}
Built from the platform’s source; the ids are examples

Mark a fulfilment ready#

POST /cdna-api/inventory/fulfillment/{id}/ready

Marks a pending fulfilment picked and packed, or ready for collection when it is a pickup. There is no body.

The stock stays reserved in the warehouse. For a pickup the message reads “Fulfillment #42 is ready for collection.” A fulfilment with nothing to ship skips this step: mark it delivered instead.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.

Example

Mark a fulfilment ready
POST /cdna-api/inventory/fulfillment/42/ready?properties={fulfillment{id,status,statusDisplay,allowedActions}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 42,
      "status": "ready",
      "statusDisplay": "Ready",
      "allowedActions": [
        "ship",
        "cancel",
        "addShipment"
      ]
    }
  },
  "message": "Fulfillment #42 marked ready."
}
Built from the platform’s source; the ids are examples

Ship a fulfilment#

POST /cdna-api/inventory/fulfillment/{id}/ship

Hands a ready delivery to the carrier: it moves to in transit.

With a trackingCode the parcel is recorded as the fulfilment’s first shipment. Without one the fulfilment moves to in transit with no shipment. With inventory tracking on, its reserved stock moves to in transit. A pickup is never shipped: mark it delivered when the customer collects it.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.
trackingCode, trackingUrl, method, totalbody
Optional. As for Add a shipment: with a trackingCode, the parcel is recorded as the first shipment.

Example

Ship a fulfilment
POST /cdna-api/inventory/fulfillment/41/ship?properties={fulfillment{id,status,statusDisplay,allowedActions,shipments{trackingCode,trackingUrl}}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "trackingCode": "AB123456789",
  "trackingUrl": "https://tracking.example.com/AB123456789"
}
Response 200 OK
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 41,
      "status": "in_transit",
      "statusDisplay": "In Transit",
      "allowedActions": [
        "deliver",
        "addShipment"
      ],
      "shipments": [
        {
          "trackingCode": "AB123456789",
          "trackingUrl": "https://tracking.example.com/AB123456789"
        }
      ]
    }
  },
  "message": "Fulfillment #41 marked in transit."
}
Built from the platform’s source; the ids are examples

Mark a fulfilment delivered#

POST /cdna-api/inventory/fulfillment/{id}/deliver

Marks a delivery in transit delivered, or a ready pickup collected. There is no body.

A fulfilment with nothing to ship goes there straight from pending. Each shipment of a delivery gets a delivered entry in its tracking logs. With inventory tracking on, a collected pickup’s reserved stock leaves the warehouse. The message reads “Fulfillment #41 collected.” for a pickup.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.

Example

Mark a fulfilment delivered
POST /cdna-api/inventory/fulfillment/41/deliver?properties={fulfillment{id,status,statusDisplay,allowedActions}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response 200 OK
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 41,
      "status": "delivered",
      "statusDisplay": "Delivered",
      "allowedActions": []
    }
  },
  "message": "Fulfillment #41 delivered."
}
Built from the platform’s source; the ids are examples

Cancel a fulfilment#

POST /cdna-api/inventory/fulfillment/{id}/cancel

Cancels a fulfilment before it leaves the warehouse. There is no body.

A pending or ready fulfilment can be cancelled; one in transit or delivered cannot. With inventory tracking on, its reserved stock goes back to available. Its items become unassigned, so Create a fulfilment can place them again. Cancelling does not refund the customer.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.

Example

Cancel a fulfilment
POST /cdna-api/inventory/fulfillment/42/cancel?properties={fulfillment{id,status,statusDisplay,allowedActions}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Response
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 42,
      "status": "cancelled",
      "statusDisplay": "Cancelled",
      "allowedActions": []
    }
  },
  "message": "Fulfillment #42 cancelled."
}
{
  "result": "error",
  "message": "Fulfillment #41 cannot move from In Transit to Cancelled."
}
Built from the platform’s source; the ids are examples

Add a shipment#

POST /cdna-api/inventory/fulfillment/{id}/shipment

Records a parcel of a delivery that is ready or in transit. The first one moves a ready fulfilment to in transit.

Each shipment starts its tracking logs with an in_transit entry that carries the selected rate’s estimated delivery. A pickup, or a fulfilment with nothing to ship, takes no shipments.

Access
Admin users and integrations, with an OAuth access token or an API key.
Returns
The fulfilment under data.fulfillment, and a message.
Model
Fulfillment, in the Reference

Parameters

idpathrequired
integer
The fulfilment id.
trackingCodebodyrequired
string
The carrier’s tracking code, up to 190 characters.
trackingUrlbody
string
The tracking page: an http:// or https:// address, up to 190 characters.
methodbody
integer
The shipping method, by id; one that sends parcels. The selected rate’s method when left out, and required when there is none, as on a fulfilment created after the order was placed.
totalbody
string
What the parcel cost, as a plain amount such as 9.95; 0 when left out.

Example

Add a shipment
POST /cdna-api/inventory/fulfillment/41/shipment?properties={fulfillment{id,status,shipments{trackingCode}}} HTTP/1.1
Host: hub.coredna.com
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/json
Content-Type: application/json

{
  "trackingCode": "AB123456790",
  "trackingUrl": "https://tracking.example.com/AB123456790",
  "total": "12.50"
}
Response
{
  "result": "success",
  "data": {
    "fulfillment": {
      "id": 41,
      "status": "in_transit",
      "shipments": [
        {
          "trackingCode": "AB123456789"
        },
        {
          "trackingCode": "AB123456790"
        }
      ]
    }
  },
  "message": "Shipment added to fulfillment #41."
}
{
  "result": "error",
  "message": "A shipment can only be added to a fulfillment that is ready or in transit. Fulfillment #42 is Pending."
}
Built from the platform’s source; the ids are examples