curl --request POST \
--url http://{defaultHost}/api/v2/platform/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"shipment": {
"stock_location_id": "101",
"order_id": "101",
"variant_id": "101",
"quantity": 2
}
}'
{
"data": {
"id": "32",
"type": "shipment",
"attributes": {
"tracking": null,
"number": "H86798855348",
"cost": "0.0",
"shipped_at": null,
"state": "pending",
"created_at": "2022-11-08T19:35:09.957Z",
"updated_at": "2022-11-08T19:35:09.970Z",
"adjustment_total": "0.0",
"additional_tax_total": "0.0",
"promo_total": "0.0",
"included_tax_total": "0.0",
"pre_tax_amount": "0.0",
"taxable_adjustment_total": "0.0",
"non_taxable_adjustment_total": "0.0",
"public_metadata": {},
"private_metadata": {},
"display_discounted_cost": "$0.00",
"display_item_cost": "$19.99",
"display_amount": "$0.00",
"display_final_price": "$0.00",
"display_cost": "$0.00",
"tracking_url": null
},
"relationships": {
"order": {
"data": {
"id": "82",
"type": "order"
}
},
"address": {
"data": null
},
"stock_location": {
"data": {
"id": "110",
"type": "stock_location"
}
},
"adjustments": {
"data": []
},
"inventory_units": {
"data": [
{
"id": "28",
"type": "inventory_unit"
}
]
},
"shipping_rates": {
"data": []
},
"state_changes": {
"data": []
},
"selected_shipping_rate": {
"data": null
}
}
}
}
Creates a Shipment
curl --request POST \
--url http://{defaultHost}/api/v2/platform/shipments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"shipment": {
"stock_location_id": "101",
"order_id": "101",
"variant_id": "101",
"quantity": 2
}
}'
{
"data": {
"id": "32",
"type": "shipment",
"attributes": {
"tracking": null,
"number": "H86798855348",
"cost": "0.0",
"shipped_at": null,
"state": "pending",
"created_at": "2022-11-08T19:35:09.957Z",
"updated_at": "2022-11-08T19:35:09.970Z",
"adjustment_total": "0.0",
"additional_tax_total": "0.0",
"promo_total": "0.0",
"included_tax_total": "0.0",
"pre_tax_amount": "0.0",
"taxable_adjustment_total": "0.0",
"non_taxable_adjustment_total": "0.0",
"public_metadata": {},
"private_metadata": {},
"display_discounted_cost": "$0.00",
"display_item_cost": "$19.99",
"display_amount": "$0.00",
"display_final_price": "$0.00",
"display_cost": "$0.00",
"tracking_url": null
},
"relationships": {
"order": {
"data": {
"id": "82",
"type": "order"
}
},
"address": {
"data": null
},
"stock_location": {
"data": {
"id": "110",
"type": "stock_location"
}
},
"adjustments": {
"data": []
},
"inventory_units": {
"data": [
{
"id": "28",
"type": "inventory_unit"
}
]
},
"shipping_rates": {
"data": []
},
"state_changes": {
"data": []
},
"selected_shipping_rate": {
"data": null
}
}
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Record created
The response is of type object
.
Was this page helpful?