Void Return (Post Void)
Request Details
| Item | Value |
| Description | This API is designed for the “post void” scenario at point of sale. The API deletes a return from the CrowdTwist commerce system and credits the points that were originally deducted by the return. |
| Method | DELETE |
| Endpoint | https://[environment]pos[client_id].crowdtwist.com/return/[return_id] |
| 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 | ||||
| return_id | 123456 | Yes | String | This is the unique id for returns. |
| QUERY PARAMETERS – none | ||||
Response
Response Body
| Field Name | Sample Value | Required | Format | Description |
| return_id | 18 | Yes | Integer | This is the id of the return record in our system that matched the “return_id” in the request URL for the requesting client. |
| total_points_awarded | 235 | Yes | Integer | This is the total number of points awarded after the return is voided. |
| user_id | 42529648 | Yes | Integer | This will be null if there are no user id associated with the original return. |
Error Responses
| Field Name | Sample Value | Required | Format | Description |
| system | pos | Yes | String | A machine readable code that describes the error. |
| reason | return not found | Yes | String | Type of error. |
| description | Return not found | Yes | String | A short, descriptive sentence detailing the error. |
| message | Return third party id cannot be found | Yes | String | A longer, descriptive sentence detailing the error. |
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.). | – missing_data
– not_unique – receipt_not_found – quantity_too_large – sku_not_found – not_supported (if an endpoint is not supported, a status HTTP code of 405 will be returned) – 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 | System | Reason | Description | Message |
| 400 | pos | return_not_found | Return not found. | Return third party id [123] cannot be found. |
| 400 | pos | return_already_voided | Required Already voided. | Return [123] is already voided. |
Samples
Sample Request
Sample Response Body
Sample Error Response