The refunds API allows you to refund charges and retrieve the details of previous refunds.
Returns a paginated list of all refunds.
curl https://test-api.pinpayments.com/1/refunds -u your-secret-api-key:
{
"response": [
{
"token": "rf_ERCQy--Ay6o-NKGiUVcKKA",
"success": null,
"amount": 400,
"currency": "USD",
"charge": "ch_bZ3RhJnIUZ8HhfvH8CCvfA",
"created_at": "2012-10-27T13:00:00Z",
"error_message": null,
"status_message": "Pending"
}
],
"count": 1,
"pagination": {
"current": 1,
"previous": null,
"next": null,
"per_page": 25,
"pages": 1,
"count": 1
}
}
Returns the details of the specified refund.
curl https://test-api.pinpayments.com/1/refunds/rf_ERCQy--Ay6o-NKGiUVcKKA -u your-secret-api-key: -X GET
{
"response": {
"token": "rf_ERCQy--Ay6o-NKGiUVcKKA",
"success": null,
"amount": 400,
"currency": "USD",
"charge": "ch_bZ3RhJnIUZ8HhfvH8CCvfA",
"created_at": "2012-10-27T13:00:00Z",
"error_message": null,
"status_message": "Pending"
}
}
Creates a new refund and returns its details.
Optional amount | The amount to refund in the currency’s base unit (e.g. cents for AUD, yen for JPY). Default value is the full amount of the charge. |
---|
curl https://test-api.pinpayments.com/1/charges/ch_bZ3RhJnIUZ8HhfvH8CCvfA/refunds -u your-secret-api-key: -X POST
{
"response": {
"token": "rf_ERCQy--Ay6o-NKGiUVcKKA",
"success": null,
"amount": 400,
"currency": "USD",
"charge": "ch_bZ3RhJnIUZ8HhfvH8CCvfA",
"created_at": "2012-10-27T13:00:00Z",
"error_message": null,
"status_message": "Pending"
}
}
402 | insufficient_pin_balance |
{...}
|
---|
Returns a list of all refunds for the specified charge.
curl https://test-api.pinpayments.com/1/charges/ch_bZ3RhJnIUZ8HhfvH8CCvfA/refunds -u your-secret-api-key:
{
"response": [
{
"token": "rf_ERCQy--Ay6o-NKGiUVcKKA",
"success": null,
"amount": 400,
"currency": "USD",
"charge": "ch_bZ3RhJnIUZ8HhfvH8CCvfA",
"created_at": "2012-10-27T13:00:00Z",
"error_message": null,
"status_message": "Pending"
}
],
"count": 1,
"pagination": {
"current": 1,
"previous": null,
"next": null,
"per_page": 25,
"pages": 1,
"count": 1
}
}