To remove a specific customer, you must know his id
which can be fetched as described in the add object tutorial. See step 1.
Perform an HTTP request to remove the customer with id
.
DELETE /api/customers/{id} HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If you don’t know how to get the Authorization
header, please proceed to the Authentication tutorial
If a customer with the specified id
exists and you are allowed to perform this kind of operation, the server will respond with HTTP 202 Accepted
.
{
"data": null,
"errors": []
}
Note: If the customer has any subcustomers
you must first delete all subcustomers
or you will get:
{
"data": null,
"errors": [
{
"name": "DeleteCustomerNotAllowedBecauseSubcustomers"
}
]
}
If you recieved DeleteCustomerNotAllowedBecauseSubcustomers
in the previous section or if you need to delete a specific subcustomer
, you should perform the next HTTP method, where customerId
is the customer from whom you want to delete the subcustomer
, and id
is the particular subcustomer
to delete.
DELETE /api/customers/{customerId}/subcustomers/{id} HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
Note that you can perform a GET
request to /api/cusomers/{id}/subcustomers
to fetch a list of all customers.
cURL
example:Example of remove customer:
curl -X DELETE -H 'https://admin.skyresponse.com/api/customers/1' -H "Authorization: Bearer PASTE_YOUR_TOKEN_HERE"
To remove a specific customer, you must know his id
which can be fetched as described in the add object tutorial. See step 1.
Perform an HTTP request to remove the customer with id
.
DELETE /api/customers/{id} HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
If you don’t know how to get the Authorization
header, please proceed to the Authentication tutorial
If a customer with the specified id
exists and you are allowed to perform this kind of operation, the server will respond with HTTP 202 Accepted
.
{
"data": null,
"errors": []
}
Note: If the customer has any subcustomers
you must first delete all subcustomers
or you will get:
{
"data": null,
"errors": [
{
"name": "DeleteCustomerNotAllowedBecauseSubcustomers"
}
]
}
If you recieved DeleteCustomerNotAllowedBecauseSubcustomers
in the previous section or if you need to delete a specific subcustomer
, you should perform the next HTTP method, where customerId
is the customer from whom you want to delete the subcustomer
, and id
is the particular subcustomer
to delete.
DELETE /api/customers/{customerId}/subcustomers/{id} HTTP/1.1
Host: https://admin.skyresponse.com
Authorization: Bearer tkgY9yiM...plBp
Note that you can perform a GET
request to /api/cusomers/{id}/subcustomers
to fetch a list of all customers.
cURL
example:Example of remove customer:
curl -X DELETE -H 'https://admin.skyresponse.com/api/customers/1' -H "Authorization: Bearer PASTE_YOUR_TOKEN_HERE"