curl --location --request POST 'https://api.stateset.com/v1/refunds/refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Customer requested to keep the product",
"notify_customer": true
}'
{
"id": "refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "refund",
"order_id": "order_123456",
"customer_id": "cust_abc123",
"type": "partial",
"status": "cancelled",
"previous_status": "processing",
"reason": "product_damaged",
"reason_details": "Item arrived with scratches on the surface",
"cancellation": {
"reason": "Customer requested to keep the product",
"cancelled_at": "2024-06-21T10:00:00Z",
"cancelled_by": "user_456"
},
"amounts": {
"subtotal": 4999,
"tax": 450,
"shipping": 0,
"total": 5449,
"currency": "USD"
},
"timeline": [
{
"status": "created",
"timestamp": "2024-01-20T13:30:00Z",
"actor": "customer"
},
{
"status": "approved",
"timestamp": "2024-01-20T13:30:01Z",
"actor": "system"
},
{
"status": "processing",
"timestamp": "2024-01-20T13:30:02Z",
"actor": "system"
},
{
"status": "cancelled",
"timestamp": "2024-06-21T10:00:00Z",
"actor": "user_456",
"note": "Customer requested to keep the product"
}
],
"updated_at": "2024-06-21T10:00:00Z",
"notifications": {
"customer_notified": true,
"notification_sent_at": "2024-06-21T10:00:05Z"
}
}
Cancel a pending or processing refund
curl --location --request POST 'https://api.stateset.com/v1/refunds/refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Customer requested to keep the product",
"notify_customer": true
}'
{
"id": "refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "refund",
"order_id": "order_123456",
"customer_id": "cust_abc123",
"type": "partial",
"status": "cancelled",
"previous_status": "processing",
"reason": "product_damaged",
"reason_details": "Item arrived with scratches on the surface",
"cancellation": {
"reason": "Customer requested to keep the product",
"cancelled_at": "2024-06-21T10:00:00Z",
"cancelled_by": "user_456"
},
"amounts": {
"subtotal": 4999,
"tax": 450,
"shipping": 0,
"total": 5449,
"currency": "USD"
},
"timeline": [
{
"status": "created",
"timestamp": "2024-01-20T13:30:00Z",
"actor": "customer"
},
{
"status": "approved",
"timestamp": "2024-01-20T13:30:01Z",
"actor": "system"
},
{
"status": "processing",
"timestamp": "2024-01-20T13:30:02Z",
"actor": "system"
},
{
"status": "cancelled",
"timestamp": "2024-06-21T10:00:00Z",
"actor": "user_456",
"note": "Customer requested to keep the product"
}
],
"updated_at": "2024-06-21T10:00:00Z",
"notifications": {
"customer_notified": true,
"notification_sent_at": "2024-06-21T10:00:05Z"
}
}
refunds:write
permissions.
Authorization: Bearer YOUR_API_KEY
curl --location --request POST 'https://api.stateset.com/v1/refunds/refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data-raw '{
"reason": "Customer requested to keep the product",
"notify_customer": true
}'
{
"id": "refund_0901f083-aa1c-43c5-af5c-0a9d2fc64e30",
"object": "refund",
"order_id": "order_123456",
"customer_id": "cust_abc123",
"type": "partial",
"status": "cancelled",
"previous_status": "processing",
"reason": "product_damaged",
"reason_details": "Item arrived with scratches on the surface",
"cancellation": {
"reason": "Customer requested to keep the product",
"cancelled_at": "2024-06-21T10:00:00Z",
"cancelled_by": "user_456"
},
"amounts": {
"subtotal": 4999,
"tax": 450,
"shipping": 0,
"total": 5449,
"currency": "USD"
},
"timeline": [
{
"status": "created",
"timestamp": "2024-01-20T13:30:00Z",
"actor": "customer"
},
{
"status": "approved",
"timestamp": "2024-01-20T13:30:01Z",
"actor": "system"
},
{
"status": "processing",
"timestamp": "2024-01-20T13:30:02Z",
"actor": "system"
},
{
"status": "cancelled",
"timestamp": "2024-06-21T10:00:00Z",
"actor": "user_456",
"note": "Customer requested to keep the product"
}
],
"updated_at": "2024-06-21T10:00:00Z",
"notifications": {
"customer_notified": true,
"notification_sent_at": "2024-06-21T10:00:05Z"
}
}