Unuse Coupon
Request Details
Item | Value |
Description | This API endpoint allows clients to mark a coupon as “unused”, available to be used again. |
Method | POST |
Endpoint | https://[environment]api[client_id].crowdtwist.com/v2/coupon/unuse?api_key=[api_key] |
Content Type | application/json |
Request
Field Name | Sample Value | Required | Format | Description |
URL PARAMETERS – none | ||||
QUERY PARAMETERS | ||||
api_key | QWERTY | Yes | String |
Request Body
Field Name | Sample Value | Required | Format | Description |
coupon_value | 1X3FJ9K003 | Yes | String | The value of the coupon being updated. |
Response
Response Body
Field Name | Sample Value | Required | Format | Description |
success | true | Yes | Boolean | True if the request was successful. |
message | Successfully submitted | Yes | String | Response message for this request. |
Error Responses
Field Name | Sample Value | Required | Format | Description |
error | internal_error | Yes | String | The identifier of the category of the error. This gives the client the ability to categorize errors and make assumptions based on the identifier of the error. |
message | Coupon could not be found | Yes | String | This is a detailed message around the error specifying, as specifically as possible, what the fields are that are missing or where exactly the error is. |
Error Response Codes
Error | Error Code | Description | Reason |
Input Error | 4xx | Returned whenever the request is missing required fields, including situations in which the body is malformed (e.g. HTTP method not supported, receipt not found, etc.). | – not_used – not_issued – no_data |
Server Error | 5xx | HTTP error status code is returned due to an error that occurred in the backend. | –internal_error: unexpected error occurred in the CrowdTwist backend – not_configured: error occurs when an configuration has not been configured yet |
Example Response Codes
Response Code | Reason | Message |
404 | not_issued | Coupon has not been issued. |
404 | no_data | Unable to find coupon. |
400 | input_error | Coupon value is required. |
Samples
Sample Request
{"coupon_value": "JDSI2JE"}
Sample Response Body
Sample Error Responses