Delete a line item

How to delete an existing line item via API

To delete a line item, send a DELETE request to the /api/line_items/:id endpoint, where id is the id of the line item that you want to delete.

Request

DELETE https://yourdomain.commercelayer.io/api/line_items/:id

Example

Request
Response
Request

The following request tries to delete the line item identified by the ID "xYZkjABcde":

curl -X DELETE \
https://yourdomain.commercelayer.io/api/line_items/xYZkjABcde \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token'
Response

On success, the API responds with a 204 No Content status code.