DELETE
/
v1
/
asns
/
:id
curl --location --request DELETE 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
  "id": "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
  "object": "asn",
  "deleted": true
}
ASNs can only be deleted if they are in “cancelled” status or created in error. Received ASNs cannot be deleted for audit trail purposes.

Path Parameters

id
string
required
The unique identifier of the ASN to delete

Response

id
string
The ID of the deleted ASN
object
string
Always “asn”
deleted
boolean
Always true for successful deletion
curl --location --request DELETE 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
  "id": "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
  "object": "asn",
  "deleted": true
}

Error Responses

error
object
Error object when deletion fails
{
  "error": {
    "type": "asn_received",
    "message": "Cannot delete ASN that has been received. ASNs with received status must be maintained for audit purposes.",
    "code": "ASN_ALREADY_RECEIVED"
  }
}