In the first quarter of this year, we’ve been working hard on bringing several updates to our API/Webhooks ecosystem.
INVENTORY UPDATE WEBHOOK
We updated the payload, leaving what you used to receive untouched, but adding the detail of which warehouse received the update, using the same fields as the general inventory update.
You will be receiving a payload similar to:
{
"account_id": 7556,
"account_uuid": "QWNjb3VudDo3NTU2",
"webhook_type": "Inventory Update",
"inventory": [
{
"sku": "100100",
"inventory": "37",
"backorder_quantity": "1",
"on_hand": "45",
"virtual": false,
"updated_warehouse": {
"warehouse_id": 13841,
"warehouse_uuid": "V2FyZWhvdXNlOjEzODQx",
"identifier": "CA",
"inventory": "35",
"backorder_quantity": "0",
"on_hand": "35"
}
}
]
}
PACKER NOTE
We added packer note at the SKU level, and you can add it using the API, either when creating a new product or updating an existing one.
Creation:
mutation{
product_create(data:{
name:"string"
sku:"string"
packer_note:"this is a packer note"
warehouse_products:{
warehouse_id:"string"
on_hand:1
}
}){
request_id
complexity
}
}
Update:
mutation{
product_update(data:{
sku:"string"
packer_note:"this is a packer note"
}){
request_id
complexity
}
}
INVENTORY_SUBTRACT DEPRECATED
This mutation will be deprecated and removed soon. Please use inventory_remove
instead to remove inventory from now on.
BOX_NAME FIELD IN SHIPPING_LABELS QUERY
We added the box_name
to the shipments.shipping_labels
query. Until now, you could only query the box_id
and needed to keep an ID to Name correlation table on your end.
query{
shipment(id:"string"){
request_id
complexity
data{
shipping_labels{
box_id
box_name
}
}
}
}
UPDATED_AT FIELD IN ORDERS QUERY
This field was available as a filter, but you could not query it before.
query{
order(id:"string"){
complexity
request_id
data{
updated_at
}
}
}
TRACKING_NUMBER FILTER IN SHIPMENTS QUERY
We added tracking_number
as a filter to our shipments
query. There are some cases where, for example, carriers inform package statuses with the tracking number. This update will allow you to recover the order info with just the tracking number quickly.
query{
shipments(tracking_number:"1111111111111" ){
request_id
complexity
data{
edges{
node{
shipping_labels{
order_id
cost
}
order{
legacy_id
order_number
}
}
}
}
}
}
LABELS EDGE IN RETURN QUERY
We added the labels
edge to the returns
query. This will allow you to poll data that belongs to the RMA’s label.
query{
returns{
complexity
request_id
data(first:5){
edges{
node{
legacy_id
labels{
id
legacy_id
tracking_number
status
created_date
carrier
shipping_method
cost
length
width
height
weight
to_name
address1
address2
address_city
address_state
address_zip
address_country
pdf_location
}
}
}
}
}
}
CUSTOMER_ACCOUNT_ID FILTER IN INVENTORY_CHANGES QUERY
Now, 3PLs will be able to filter inventory changes by child account.
query{
inventory_changes(customer_account_id:"string"){
request_id
complexity
data(first:50){
edges{
node{
account_id
sku
reason
created_at
}
}
}
}
}
UPDATE TO AVAILABLE FIELD IN WAREHOUSE_PRODUCTS QUERY
This field would significantly increase the cost of this query per queried product. As of this update, this extra cost has been removed. When polling this field, each product in the response will only consume one credit.
query{
products{
complexity
data(first:50){
edges{
node{
sku
warehouse_products{
available
}
}
}
}
}
}
NEW FILTERS IN INVENTORY SNAPSHOT
To significantly reduce the size of the returned JSON and allow for faster processing, we added 2 new filters to this mutation that will reduce the number of SKUs returned.:
-
updated_at
: Will only return products that had an update since the specified date. -
has_inventory
: Will only return products that have inventory at the moment of execution.
mutation{
inventory_generate_snapshot(data:{
updated_at: "ISODateTime"
has_inventory: boolean
}){
request_id
complexity
snapshot{
snapshot_url
status
}
}
}
FBA_INVENTORY IN PRODUCTS
You can now get your FBA inventory from your product query. It is also available in the products query.
query{
product(sku:"string"){
data{
fba_inventory{
quantity
marketplace_id
merchant_id
}
}
}
}
TRACKING_URL IN GENERATE LABEL WEBHOOK
We added the possibility to send the tracking URL in your response. If this field is present, it will override the tracking URL set up when creating the method. If you are sending the tracking URL don’t forget to also send the tracking number, this is used as the “text” when building the link to the URL in our UI.
{
"code": "200",
"shipping_method": "Ground",
"tracking_number": "123456789",
"cost": "5.55",
"label": "https://url-to-label.com",
"customs_info": "",
"shipping_carrier": "ups",
"tracking_url": "https://mycarrier.com/123456789"
}