curl --request POST \
--url https://api.scrip.dev/v1/redemptions/{id}/reverse \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "Customer refund request",
"amount": "500.00",
"idempotency_key": "reverse-12345",
"quantity": 1
}
'import requests
url = "https://api.scrip.dev/v1/redemptions/{id}/reverse"
payload = {
"reason": "Customer refund request",
"amount": "500.00",
"idempotency_key": "reverse-12345",
"quantity": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reason: 'Customer refund request',
amount: '500.00',
idempotency_key: 'reverse-12345',
quantity: 1
})
};
fetch('https://api.scrip.dev/v1/redemptions/{id}/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrip.dev/v1/redemptions/{id}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer refund request',
'amount' => '500.00',
'idempotency_key' => 'reverse-12345',
'quantity' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrip.dev/v1/redemptions/{id}/reverse"
payload := strings.NewReader("{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrip.dev/v1/redemptions/{id}/reverse")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrip.dev/v1/redemptions/{id}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}"
response = http.request(request)
puts response.read_body{
"amount": "500.00",
"created_at": "2024-01-15T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"journal_entry_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 1,
"reason": "Customer refund request",
"redemption_id": "550e8400-e29b-41d4-a716-446655440001"
}{
"amount": "500.00",
"created_at": "2024-01-15T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"journal_entry_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 1,
"reason": "Customer refund request",
"redemption_id": "550e8400-e29b-41d4-a716-446655440001"
}{
"code": "bad_request",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Invalid request parameters"
}{
"code": "unauthorized",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Missing or invalid credentials"
}{
"code": "not_found",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource not found"
}{
"code": "conflict",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource already exists or state conflict"
}{
"code": "unsupported_media_type",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Content-Type must be application/json"
}{
"code": "internal_error",
"message": "An internal error occurred"
}Reverse a redemption
Reverse all or part of a redemption, returning funds to the participant.
curl --request POST \
--url https://api.scrip.dev/v1/redemptions/{id}/reverse \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"reason": "Customer refund request",
"amount": "500.00",
"idempotency_key": "reverse-12345",
"quantity": 1
}
'import requests
url = "https://api.scrip.dev/v1/redemptions/{id}/reverse"
payload = {
"reason": "Customer refund request",
"amount": "500.00",
"idempotency_key": "reverse-12345",
"quantity": 1
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
reason: 'Customer refund request',
amount: '500.00',
idempotency_key: 'reverse-12345',
quantity: 1
})
};
fetch('https://api.scrip.dev/v1/redemptions/{id}/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrip.dev/v1/redemptions/{id}/reverse",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => 'Customer refund request',
'amount' => '500.00',
'idempotency_key' => 'reverse-12345',
'quantity' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.scrip.dev/v1/redemptions/{id}/reverse"
payload := strings.NewReader("{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.scrip.dev/v1/redemptions/{id}/reverse")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrip.dev/v1/redemptions/{id}/reverse")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"Customer refund request\",\n \"amount\": \"500.00\",\n \"idempotency_key\": \"reverse-12345\",\n \"quantity\": 1\n}"
response = http.request(request)
puts response.read_body{
"amount": "500.00",
"created_at": "2024-01-15T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"journal_entry_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 1,
"reason": "Customer refund request",
"redemption_id": "550e8400-e29b-41d4-a716-446655440001"
}{
"amount": "500.00",
"created_at": "2024-01-15T10:30:00Z",
"id": "550e8400-e29b-41d4-a716-446655440000",
"journal_entry_id": "550e8400-e29b-41d4-a716-446655440002",
"quantity": 1,
"reason": "Customer refund request",
"redemption_id": "550e8400-e29b-41d4-a716-446655440001"
}{
"code": "bad_request",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Invalid request parameters"
}{
"code": "unauthorized",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Missing or invalid credentials"
}{
"code": "not_found",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource not found"
}{
"code": "conflict",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Resource already exists or state conflict"
}{
"code": "unsupported_media_type",
"details": {
"expected": "<string>",
"field": "<string>",
"fields": [
{
"expected": "<unknown>",
"field": "<string>",
"message": "This field is required",
"reason": "required",
"received": "<string>"
}
],
"reason": "invalid",
"received": "<string>"
},
"message": "Content-Type must be application/json"
}{
"code": "internal_error",
"message": "An internal error occurred"
}amount and quantity fields. For a partial reversal, specify the amount (for raw and AMOUNT_BASED redemptions) or quantity (for UNIT_BASED catalog redemptions) to reverse. The reason field is required and must be between 1 and 500 characters.
For UNIT_BASED catalog items, reversals decrement the reward’s committed_units and delivered_units. A reward that was OUT_OF_STOCK can return to ACTIVE if the reversal brings committed inventory below max_total. For assets configured in LOT mode, reversals restore the specific lots that were consumed in reverse spend order.
Multiple partial reversals are allowed on a single redemption. The cumulative reversed amount cannot exceed the original redemption amount. Check reversed_amount on the redemption to verify headroom before issuing a partial reversal. A redemption that has already been fully reversed returns 409 with code already_reversed.
Pass an idempotency_key to safely retry requests. Duplicate requests return 200 with the existing reversal instead of 201.
Authorizations
API key passed in the X-API-Key header.
Path Parameters
Redemption ID
Body
Reversal details
Why this reversal is being made (1-500 chars)
1 - 500"Customer refund request"
Amount to reverse for raw or AMOUNT_BASED redemptions (omit for full reversal, decimal string)
"500.00"
Prevents duplicate reversals when retrying requests
"reverse-12345"
Units to reverse for UNIT_BASED catalog redemptions (omit for full reversal)
1
Response
Duplicate request (idempotency key matched, returns existing record)
Amount credited back to the participant's balance (decimal string)
"500.00"
When this reversal was created
"2024-01-15T10:30:00Z"
Unique identifier for this reversal
"550e8400-e29b-41d4-a716-446655440000"
The ledger journal entry created by this reversal
"550e8400-e29b-41d4-a716-446655440002"
Units reversed (UNIT_BASED catalog redemptions only)
1
Why this reversal was made
"Customer refund request"
The redemption that was reversed
"550e8400-e29b-41d4-a716-446655440001"