curl --location --request POST 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Supplier notified of production delay",
"cancelled_by": "purchasing@company.com",
"notify_supplier": true,
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}'
{
"id": "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "asn",
"asn_number": "ASN-2024-00001",
"status": "cancelled",
"cancelled_at": "2024-01-16T10:30:00Z",
"cancelled_by": "purchasing@company.com",
"cancellation_reason": "Supplier notified of production delay",
"purchase_order_id": "po_123456789",
"supplier_id": "sup_abc123",
"items_affected": [
{
"sku": "WBH-001",
"quantity": 500
},
{
"sku": "USB-C-001",
"quantity": 1000
}
],
"notifications_sent": [
{
"type": "email",
"recipient": "supplier@audiotech.com",
"sent_at": "2024-01-16T10:31:00Z"
},
{
"type": "webhook",
"endpoint": "warehouse_system",
"sent_at": "2024-01-16T10:31:00Z"
}
],
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}
Cancel ASN
Cancel an ASN that hasn’t been received yet
POST
/
v1
/
asns
/
:id
/
cancel
curl --location --request POST 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Supplier notified of production delay",
"cancelled_by": "purchasing@company.com",
"notify_supplier": true,
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}'
{
"id": "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "asn",
"asn_number": "ASN-2024-00001",
"status": "cancelled",
"cancelled_at": "2024-01-16T10:30:00Z",
"cancelled_by": "purchasing@company.com",
"cancellation_reason": "Supplier notified of production delay",
"purchase_order_id": "po_123456789",
"supplier_id": "sup_abc123",
"items_affected": [
{
"sku": "WBH-001",
"quantity": 500
},
{
"sku": "USB-C-001",
"quantity": 1000
}
],
"notifications_sent": [
{
"type": "email",
"recipient": "supplier@audiotech.com",
"sent_at": "2024-01-16T10:31:00Z"
},
{
"type": "webhook",
"endpoint": "warehouse_system",
"sent_at": "2024-01-16T10:31:00Z"
}
],
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}
ASNs can only be cancelled if they haven’t been received. Once receiving has started, the ASN cannot be cancelled.
Path Parameters
The unique identifier of the ASN to cancel
Request Body
Reason for cancellation
User ID or email of the person cancelling the ASN
Whether to notify the supplier of the cancellation (default: true)
Additional notes about the cancellation
Response
ASN ID
ASN number
Updated status (will be “cancelled”)
Timestamp of cancellation
User who cancelled the ASN
Reason for cancellation
curl --location --request POST 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Supplier notified of production delay",
"cancelled_by": "purchasing@company.com",
"notify_supplier": true,
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}'
{
"id": "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "asn",
"asn_number": "ASN-2024-00001",
"status": "cancelled",
"cancelled_at": "2024-01-16T10:30:00Z",
"cancelled_by": "purchasing@company.com",
"cancellation_reason": "Supplier notified of production delay",
"purchase_order_id": "po_123456789",
"supplier_id": "sup_abc123",
"items_affected": [
{
"sku": "WBH-001",
"quantity": 500
},
{
"sku": "USB-C-001",
"quantity": 1000
}
],
"notifications_sent": [
{
"type": "email",
"recipient": "supplier@audiotech.com",
"sent_at": "2024-01-16T10:31:00Z"
},
{
"type": "webhook",
"endpoint": "warehouse_system",
"sent_at": "2024-01-16T10:31:00Z"
}
],
"notes": "Shipment delayed by 2 weeks due to material shortage. Will create new ASN when shipment is ready."
}
Error Responses
{
"error": {
"type": "invalid_status",
"message": "Cannot cancel ASN that has already been received",
"code": "ASN_ALREADY_RECEIVED"
}
}
⌘I