Update offer credit amount
Updates the credit amount on an offer. The offer must be in “pending” or “awaiting_customer” status.
POST
/{id}/creditPath parameters
idstringrequiredThe ID of the offer to update
Request body
application/jsoncreditAmountintegerrequiredCredit amount in cents (e.g., 10000 = $100.00). Must be a non-negative integer.
min 0
Responses
200Offer credit amount updated successfully
successbooleanrequiredWhether the credit amount was updated successfully
creditAmountintegerrequiredThe credit amount that was persisted, in cents. Callers should verify this matches their request.
min 0
updatedAtstring<date-time>requiredTimestamp when the credit amount was updated
400Bad request - Offer credit could not be updated
codestringrequiredError code indicating the type of error
messagestringrequiredHuman-readable error message explaining what went wrong
detailsobject[]Detailed validation errors when applicable
Show propertiesHide properties
Array of
objectfieldstringrequirederrorstringrequired401Unauthorized - Missing or invalid authentication
codestringrequiredError code indicating the type of error
messagestringrequiredHuman-readable error message explaining what went wrong
detailsobject[]Detailed validation errors when applicable
Show propertiesHide properties
Array of
objectfieldstringrequirederrorstringrequired403Forbidden - Caller can view this offer but is not allowed to update it
codestringrequiredError code indicating the type of error
messagestringrequiredHuman-readable error message explaining what went wrong
detailsobject[]Detailed validation errors when applicable
Show propertiesHide properties
Array of
objectfieldstringrequirederrorstringrequired404Not found - Offer does not exist or caller is not allowed to view it
codestringrequiredError code indicating the type of error
messagestringrequiredHuman-readable error message explaining what went wrong
detailsobject[]Detailed validation errors when applicable
Show propertiesHide properties
Array of
objectfieldstringrequirederrorstringrequired500Internal server error
codestringrequiredError code indicating the type of error
messagestringrequiredHuman-readable error message explaining what went wrong
detailsobject[]Detailed validation errors when applicable
Show propertiesHide properties
Array of
objectfieldstringrequirederrorstringrequiredRequest
curl -X POST "https://api.sibipro.com/prod/offers/string/credit" \
-H "Content-Type: application/json" \
-d '{
"creditAmount": 10000
}'const response = await fetch("https://api.sibipro.com/prod/offers/string/credit", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"creditAmount": 10000
})
});Response
{
"success": true,
"creditAmount": 10000,
"updatedAt": "2024-01-20T12:00:00Z"
}{
"code": "string",
"message": "The request contains invalid parameters",
"details": [
{
"field": "customer.email",
"error": "Invalid email"
},
{
"field": "address.postalCode",
"error": "Invalid"
}
]
}{
"code": "string",
"message": "The request contains invalid parameters",
"details": [
{
"field": "customer.email",
"error": "Invalid email"
},
{
"field": "address.postalCode",
"error": "Invalid"
}
]
}{
"code": "string",
"message": "The request contains invalid parameters",
"details": [
{
"field": "customer.email",
"error": "Invalid email"
},
{
"field": "address.postalCode",
"error": "Invalid"
}
]
}{
"code": "string",
"message": "The request contains invalid parameters",
"details": [
{
"field": "customer.email",
"error": "Invalid email"
},
{
"field": "address.postalCode",
"error": "Invalid"
}
]
}{
"code": "string",
"message": "The request contains invalid parameters",
"details": [
{
"field": "customer.email",
"error": "Invalid email"
},
{
"field": "address.postalCode",
"error": "Invalid"
}
]
}