Shipment Receipt Creation
Shipment Receipts Creation and Update involves a lot of fields. We suggest you utilize the upsert_shipments_receipts_full call to make the process easier.
The upsert_shipments_receipts_full
call can:
- Reduce API calls needed to create Shipment Receipts
- Link to existing objects with external IDs (i.e. Shopify ID, SAP ID, Warehouse Code)
- Link to existing shipments by shipment_number
- Inventory Items are linked by SKU for Shipment Receipt Items
- Link to shipment receipt items by external IDs (i.e. SAP ID, Warehouse Code)
Upserts can produce surprising results if you are not careful. Please read the Upsert Documentation to understand how upserts work.
What the call cannot do is create or modify the shipment for you. Create the shipment first with the create shipment api or the upsert shipments full. Only information that is needed from the shipment is identifying information.
Example call:
POST https://api.channelape.io/rest/v1/rpc/upsert_shipment_receipts_full HTTP/1.1
Content-Type: application/json
apikey: ANON_KEY
Authorization: Bearer YOUR_KEY
{
"shipment_receipts_full": {
"business_id": "[BUSINESS_ID]",
"shipment_number": "[shipment_number]",
"receipts": [
{
"received_time": "2023-05-26T16:06:01.80982+00:00",
"external_ids": {
"confirmation_id": "confirmation_id_1",
},
"items": [
{
"sku": "sku_1",
"external_ids": {
"shipment_line_number": "shipment_1-1"
},
"quantity": 81,
"receipt_time": "2023-05-26T19:48:59.913165+00:00"
},
{
"sku": "sku_2",
"external_ids": {
"shipment_line_number": "shipment_1-2"
},
"quantity": 12,
"receipt_time": "2023-05-26T19:48:59.913165+00:00",
"comment": "Slight damage to box"
}
]
}
]
}
}
Shipments receipts also accepts a completed_time that will mark the receipt as completed. This is useful for marking a receipt as completed when it is created. If this is set no further updates can be made to the receipt as inventory adjustments will be made. For example:
POST https://api.channelape.io/rest/v1/rpc/upsert_shipment_receipts_full HTTP/1.1
Content-Type: application/json
apikey: ANON_KEY
Authorization: Bearer YOUR_KEY
{
"shipment_receipts_full": {
"business_id": "[BUSINESS_ID]",
"shipment_number": "[shipment]",
"receipts": [
{
"received_time": "2023-05-26T16:06:01.80982+00:00",
"completed_time": "2023-05-26T18:13:02.9087+00:00",
"external_ids": {
"confirmation_id": "confirmation_id_1"
},
"items": [
{
"sku": "sku_1",
"external_ids": {
"shipment_line_number": "shipment_1-1"
},
"quantity": 81,
"receipt_time": "2023-05-26T19:48:59.913165+00:00"
},
{
"sku": "sku_2",
"external_ids": {
"shipment_line_number": "shipment_1-2"
},
"quantity": 12,
"receipt_time": "2023-05-26T19:48:59.913165+00:00",
"comment": "Slight damage to box"
}
]
}
]
}
}
Calling this function again will result in an error:
HTTP/1.1 400 Bad Request
Content-Type: application/json;
{
"code": "P0001",
"details": null,
"hint": null,
"message": "Cannot update a receipt that is already complete"
}
Shipments receipts items has an available flag (defaults to true).
This flag indicates if the received item can be used, generally it would be false if damaged.
Inventory adjustments
will be made unavailable
for items marked as false. For example:
POST https://api.channelape.io/rest/v1/rpc/upsert_shipment_receipts_full HTTP/1.1
Content-Type: application/json
apikey: ANON_KEY
Authorization: Bearer YOUR_KEY
{
"shipment_receipts_full": {
"business_id": "[BUSINESS_ID]",
"shipment_number": "[shipment]",
"receipts": [
{
"received_time": "2023-05-26T16:06:01.80982+00:00",
"completed_time": "2023-05-26T18:13:02.9087+00:00",
"external_ids": {
"confirmation_id": "confirmation_id_1"
},
"items": [
{
"sku": "sku_1",
"external_ids": {
"shipment_line_number": "shipment_1-1"
},
"quantity": 81,
// Can be omitted as this is the default
"available": true,
"receipt_time": "2023-05-26T19:48:59.913165+00:00"
},
{
"sku": "sku_2",
"external_ids": {
"shipment_line_number": "shipment_1-2"
},
// Marks these items as unusable
// will increase unavailable quantity for location the shipment is being received defined at `shipment.location_to`
"available": false,
"quantity": 12,
"receipt_time": "2023-05-26T19:48:59.913165+00:00",
"comment": "Slight damage to box"
}
]
}
]
}
}