User Feedback
POST /api/v1/offers/{offer_id}/user-feedback
Allows a user to submit feedback about an offer (e.g., trouble redeeming).
Endpoint
- Method:
POST
- Path:
/api/v1/offers/{offer_id}/user-feedback
- Content-Type:
application/json
Path Parameters
Name | Type | Required | Description |
---|---|---|---|
offer_id | integer | Yes | ID of the offer to leave feedback for. |
Request Body
{
"feedback_reason": "string",
"location_id": 0,
"merchant_id": 0,
"offer_type": "show_and_save"
}
Fields
Field | Type | Required | Description |
---|---|---|---|
feedback_reason | string | Yes | Free-text reason or short description of the issue/feedback. |
location_id | integer | No | Location context for the offer feedback, if applicable. |
merchant_id | integer | No | Merchant context for the offer feedback, if applicable. |
offer_type | enum | Yes | Redemption option type. See Offer Type Enum below. |
Offer Type Enum
- show_and_save
- online
- promo_code
Success Response
- Status: 201 Created
{
"account_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"acknowledged": true,
"created_at": "2025-08-25T19:55:34.342Z",
"feedback_reason": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"location_id": 0,
"merchant_id": "string",
"offer_id": 0,
"offer_type": "show_and_save",
"token_action_record_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"token_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"updated_at": "2025-08-25T19:55:34.342Z"
}
Error Responses
Invalid Offer ID
- Status: 400 Bad Request
{
"error_code": "invalid_input",
"error_message": "Invalid input."
}
Failed to Create Feedback
- Status: 500 Internal Server Error
{
"error_code": "internal_error",
"error_message": "Internal error."
}
Examples
cURL
curl -X POST "https://your.api.com/api/v1/offers/50323909/user-feedback" \
-H "Content-Type: application/json" \
-d '{
"feedback_reason": "Could not redeem at POS; cashier could not find the offer.",
"location_id": 1898267,
"merchant_id": 12345,
"offer_type": "show_and_save"
}'
fetch (TypeScript)
await fetch('/api/v1/offers/50323909/user-feedback', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
feedback_reason: 'Barcode would not scan on the device.',
location_id: 1898267,
merchant_id: 12345,
offer_type: 'promo_code'
})
});
Validation & Best Practices
- Ensure offer_id is a valid integer and references an existing offer.
- Validate offer_type against the allowed enum values.
- Provide location_id and/or merchant_id when available to improve triage quality.
- Sanitize and limit feedback_reason length to prevent overly large submissions.
Updated 1 day ago