amount
object in the JSON request body.username:password
Authorization: Basic *****************
{
"amount": {
"value": "10.00",
"currency_code": "USD"
},
"invoice_id": "{{$timestamp}}",
"note_to_payer": "Defective product"
}
curl --location -g --request POST 'https://api-m.sandbox.paypal.com/v2/payments/captures/{{capture_id}}/refund' \
--header 'PayPal-Request-Id: ' \
--header 'Prefer: ' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Og==' \
--data-raw '{
"amount": {
"value": "10.00",
"currency_code": "USD"
},
"invoice_id": "{{$timestamp}}",
"note_to_payer": "Defective product"
}'
{
"id": "2YM97310D11241804",
"amount": {
"currency_code": "USD",
"value": "40.00"
},
"note_to_payer": "Defective product",
"seller_payable_breakdown": {
"gross_amount": {
"currency_code": "USD",
"value": "40.00"
},
"paypal_fee": {
"currency_code": "USD",
"value": "0.00"
},
"net_amount": {
"currency_code": "USD",
"value": "40.00"
},
"total_refunded_amount": {
"currency_code": "USD",
"value": "150.00"
}
},
"invoice_id": "1680812997",
"status": "COMPLETED",
"create_time": "2023-04-06T13:29:58-07:00",
"update_time": "2023-04-06T13:29:58-07:00",
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/payments/refunds/2YM97310D11241804",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.sandbox.paypal.com/v2/payments/captures/52909142TS941641N",
"rel": "up",
"method": "GET"
}
]
}