Use Coupon
Request Details
Item | Value |
Description | This API endpoint allows clients to mark a coupon as “used”. This is particularly helpful for something like a manufacturer’s coupon. |
Method | POST |
Endpoint | https://[environment]api[client_id].crowdtwist.com/v2/coupon/use?api_key=[api_key] |
HTTP Header | X-CT-Authorization = CTApiKey [API Key] Note: there is a space between CTApiKey and the API Key value |
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. |
use_date | 2023-05-20T18:25:43-04:00 | No | String | Optional field to indicate when the code was used by the member. |
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.). | – receipt_not_found – invalid |
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
Sample Response Body
Sample Error Response