Delete product
Deletes a product and cascade-deletes all of its prices in one transaction. Fails if any of the product's prices have ever been referenced by a line item — in that case the product must be archived instead.
Deletes a product and cascade-deletes all of its prices in one transaction. Fails if any of the product's prices have ever been referenced by a line item — in that case the product must be archived instead.
Authorization
api-key API key for merchant integrations. Send as Authorization: Bearer <your key>.
In: header
Path Parameters
Product ID
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/products/string"{
"error": {
"type": "invalid_request_error",
"code": "resource_invalid_state",
"message": "Cannot delete a product that has been used in a checkout session or payment link. Archive it instead.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#resource_invalid_state"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "authentication_error",
"code": "authentication_required",
"message": "No valid API key provided.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#authentication_required"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "invalid_request_error",
"code": "permission_denied",
"message": "The API key does not have permission to perform this action.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#permission_denied"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "invalid_request_error",
"code": "resource_missing",
"message": "No such product: prod_abc123",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#resource_missing"
},
"request_id": "req_abc123def456"
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "An unexpected error occurred. Please try again or contact support.",
"doc_url": "https://docs.xpay.app/integrate/errors/api-error-codes#internal_error"
},
"request_id": "req_abc123def456"
}Update product PATCH
Updates product information. Can update product data fields, default price, and image. - The `defaultPrice` field should be the ID of the Price object to set as the default price for this product - The `image` field should be a URL string (use the `/upload-url` endpoint to get a one-time upload URL first)
List products GET
Lists products with search and filters. Supports: - Active filter (`active=true/false`) - Metadata filter (JSON string) - Search in `name`, `description`, and `unitLabel` fields - Pagination