Skip to main content

Endpoints

3PL exposes a few endpoints to perform various programmatic tasks. They are detailed below.

The base URL for all 3PL calls is: https://3pl.zquared.com/api/v1

Stores#

This endpoint shows stores associated with your account. A store within 3PL consists of a storage warehouse(s) for products, and a sales channel(s) through which that product is sold.

GET /stores

Returns#

Returns an array of stores associated with your account.

RESPONSE

[
{
"warehouses": [
{
"id": "XYZ123",
"name": "Example Warehouse 123"
}
],
"channels": [
{
"id": 123456,
"name": "Example Channel 987"
}
]
},
{...}
]

Submit New Orders#

This endpoint is for submitting order data manually to Zquared 3PL.

POST /orders

[
{
"salesChannelId": 123456, // from a /store call results
"orderNumber": "XXYYZZ123", // [max length: 191]
"orderDate": "2020-03-25T20:25:52Z", //ISO 8601 timestamp
"paymentDate": "2020-03-25T20:25:52Z", //ISO 8601 timestamp
"orderItems": [
{
"name": "Item 1",
"sku": "item-1-sku",
"quantity": 0,
"tax": {
"amount": 0,
"currency": "USD" // (optional) [default: USD]
},
"price": { // price per single unit
"amount": 0,
"currency": "USD" // (optional) [default: USD]
}
},
{...}
],
"insurance": {
"cost": {
"amount": 0,
"currency": "USD" // (optional) [default: USD]
},
"value": {
"amount": 0,
"currency": "USD" // (optional) [default: USD]
}
},
"orderTotal": {
"amount": 0,
"currency": "USD" // (optional) [default: USD]
},
"shippingDetails": {
"name": "Jane Doe", // [max length: 100]
"address": {
"line_1": "1234 Main St", // [max length: 150]
"line_2": "", // [max length: ??],
"city": "Anywhere", // [max length: 60]
"state": "AA", // [max length: 20] abbreviated format
"zip": "00000",
"country": "US" // ISO 3166-2 Country code abbreviation
},
"method": "FedEx Ground", // name of shipping method
"cost": {
"amount": 0,
"currency": "USD" // (optional) [default: USD]
}
},
"notes": {
"fromBuyer": "", // (optional)
"toBuyer": "" // (optional)
},
"customFields": {}, // (optional), key/value pairs of custom fields to pass
"attachments": [ // (optional)
{
"label": "billoflading", // label for attachment
"type": "pdf" // file type,
"dataType": "base64", // indicate data type of data field
"data": "data:application/pdf;base64..." // base64 encoded data string
},
{...}
]
},
{...}
]

An example of a success message returned by the API. The statusCode will be set to 0. details may or may not contain extra information. response will include an array of successfully submitted order numbers.

RESPONSE

{
"statusCode": "0",
"details": "",
"response": {
"orderNumbers": [
"XXYYZZ123"
]
}
}

Update Order Attachments#

This endpoint is for submitting attachments to an order already in the system. Submitted attachments are added to existing attachments in the system for an order, or if the label key is identical, the existing document in the system is replaced.

PATCH /orders/:orderNumber

{
"salesChannelId": 123456, // from a /store call results
"orderNumber": "XXYYZZ123", // [max length: 191]
"attachments": [
{
"label": "billoflading", // label for attachment
"type": "pdf", // file type,
"dataType": "base64", // indicate data type of data field
"data": "data:application/pdf;base64..." // base64 encoded data string
},
{...}
]
}

An example of a success message returned by the API. The statusCode will be set to 201. details may or may not contain extra information.

RESPONSE

{
"statusCode": "201",
"details": "Order updated successfully"
}

Inventory Quantities#

This endpoint shows inventory values for a particular channel.

GET /inventory/:warehouseId

Parameters#

  • warehouseIdrequired

    The warehouse Id from the warehouse that contains inventory

Returns#

Returns an array of skus and related inventory values.

Example Call#

/inventory/XYZ123

RESPONSE

[
{
"sku": "XYZ123",
"quantity": 300,
"lots": [
{
"lot": "0123456",
"expiration": "2023-05-31T00:00:00.000Z", //ISO 8601 timestamp
"quantity": 200
},
{...}
]
},
{
"sku": "XYZ456",
"quantity": 29,
"lots": []
},
{...}
]