Skip to main content

Delete Product

Deleting a Product​

Contents​

Overview​

  • Call name: delete-product
  • Endpoint URL: https://{API hostname}/internal/delete-product
  • Request methods: DELETE
  • Request Content-Type: application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint allows deleting a product from the Spaaza system. When a product is deleted, all associated product variants are also deleted.

Version-specific information​

The following version-specific changes apply to this endpoint. See the versioning page for more details.

VersionChange details
N/AN/A

Permissions and Authentication​

This API call requires admin authentication:

  • The performing user must be logged in and have DELETE access to the chain that owns the product
  • User and privileged authentication methods are not permitted for this endpoint

Headers​

Standard headers are used for this endpoint. No special headers are required.

HTTP Parameters​

The following HTTP parameters can be passed to the API:

ParameterDescription
id(integer, mandatory) The unique identifier of the product to delete

Sample request​

DELETE /internal/delete-product HTTP/1.1
Content-Type: application/x-www-form-urlencoded

id=7

Sample response​

{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"product": {
"brand": "Aran Brands Inc.",
"category": "sweater > Aran > mens",
"cost_price": 79.95,
"created_date": "2025-01-24T12:00:00+00:00",
"deleted": true,
"description": "The Aran Jumper is a style of jumper that takes its name from the Aran Islands off the west coast of Ireland.",
"entity": {
"entity_email_address": null,
"entity_id": 1,
"entity_name": "FOO Chain, inc.",
"entity_phone_number": null,
"entity_type": "chain"
},
"id": 7,
"image_url": "https://www.spaaza.com/images/arran.jpg",
"last_modified_date": "2025-01-24T12:00:00+00:00",
"listing_source": null,
"manufacturer": null,
"name": "Men's Merino Aran Jumper",
"owner_code": "00024003",
"price": 99.95,
"private_label": false,
"product_variants": [],
"season": "Winter",
"webshop_url": "https://www.shop.spaaza.com/images/arran.jpg"
},
"result_type": "delete-product"
}
}

Possible error responses​

CodeName and DescriptionHTTP Status Code
3http_vars_missing
The required id parameter is missing
400
6no_valid_session
The user needs to be logged in and a valid session key needs to be sent
401
68permission_denied_or_non_existent
This user has insufficient permissions for this object or the object does not exist
403
90product_id_not_found
No record has been found for that product_id
404
330server_error
Unexpected server error
500