curl --location --request POST 'https://api.stateset.com/v1/payments/pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30/refund' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_API_KEY' \ --data-raw '{ "amount": 5000, "reason": "requested_by_customer", "notes": "Customer returned item" }'
{ "id": "ref_1234567890abcdef", "object": "refund", "amount": 5000, "currency": "USD", "payment_id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30", "status": "succeeded", "reason": "requested_by_customer", "notes": "Customer returned item", "created_at": "2024-01-20T10:00:00Z", "processed_at": "2024-01-20T10:00:05Z", "payment": { "id": "pay_0901f083-aa1c-43c5-af5c-0a9d2fc64e30", "amount": 15000, "amount_refunded": 5000, "refunds_count": 1 }, "processor_refund_id": "re_1234567890", "receipt_url": "https://receipts.stateset.com/ref_1234567890abcdef", "metadata": { "return_id": "ret_abc123" } }
Create a full or partial refund for a payment
payments:write
Authorization: Bearer YOUR_API_KEY