Skip to main content

Delete Product Variant

Deleting a Product Variant​

Contents​

Overview​

  • Call name: delete-product-variant
  • Endpoint URL: https://{API hostname}/internal/delete-product-variant
  • 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 variant from the Spaaza system. When a product variant is deleted, all associated barcodes 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 variant
  • 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 variant to delete

Sample request​

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

id=3

Sample response​

{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"product_variant": {
"barcodes": [],
"colour": "navy",
"condition": "new",
"cost_price": 79.95,
"currency_id": 2,
"deleted": true,
"id": 3,
"image_url": "https://www.spaaza.com/images/navy_arran.jpg",
"name": null,
"price": 99.95,
"product_id": 7,
"published_expiry_date": "2025-01-24T12:00:00+00:00",
"published_status": 1,
"size": "S",
"web_url": "https://www.shop.spaaza.com/images/navy_arran.jpg"
},
"result_type": "delete-product-variant"
}
}

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
330server_error
Unexpected server error
500