delete https://{subdomain}.myshoplaza.com/openapi/2022-01/price_rules//discount_codes
Requires
price_rulesaccess scope. More access scope
The Delete Discount Code API allows you to remove a discount code from a specified price rule.
This API is especially useful for:
- Removing obsolete discount codes.
- Managing discount codes dynamically.
- Ensuring that invalid or expired discount codes do not remain active.
Request Parameters
Public Request Parameters
Path Parameters
| Field | Type | Required | Example | Description |
|---|---|---|---|---|
price_rule_id | string | Yes | 588fea0b-f15d-4c1d-9390-23661f0194fa | ID of the price rule associated with the discount codes. |
Response Explanation
Public Response Parameters
Error Response
Error responses in the API can be represented using two different fields: errors and error. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
| Field | Type | Example | Description |
|---|---|---|---|
errors | Array | [ "invalid line_item id"] | A list of errors encountered during the request processing. |
| Field | Type | Example | Description |
|---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process |
Error Detail
| Status Code | Message | Possible Reason | Example Response |
|---|---|---|---|
| 400 | Bad Request | Invalid input format or request structure (e.g., missing required fields or incorrect data types). | Bad Request |
| Unauthorized | The request is missing valid authentication credentials or the credentials provided are invalid. | Unauthorized | |
| 404 | Not Found | The ID provided is not existed. | Not Found |
