Refunds
Refunds
| {
"id": "refd_o6Y1oZinbl9lErB24OSQCAKl",
"payment": "paym_sS1sXwDuaqGTjuQ7DY4BBNaI",
"amount": 50,
"currency": "eur",
"created": 1540231459,
"live_mode": false
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 | package Stancer::Refund;
use Moo;
use Stancer::Core::Types qw(:all);
has amount => (is => 'ro', isa => Int);
has created => (is => 'ro', isa => InstanceOf['DateTime']);
has currency => (is => 'ro', isa => Enum['EUR', 'GBP', 'USD']);
has id => (is => 'ro', isa => Char[29]);
has payment => (is => 'ro', isa => InstanceOf['Stancer::Payment']);
1;
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | <?php
namespace Stancer;
use DateTime;
class Refund
{
protected int $amount;
protected DateTime $created;
protected string $currency;
protected string $id;
protected Payment $payment;
public function __construct(string $id = null) {}
}
|
| Not available for the moment
|
The refund object is defined as follows:
Parameter | Description | Type |
id | Refund's id | String, fixed size = 29 |
payment | Refunded payment id | String, fixed size = 29 |
amount | Amount to refund in cents, if omitted will refund the the whole payment | Int, have to be =< to the original amount of the payment |
currency | Processed currency | Enum EUR , USD , GBP |
status | Refund status | See refund status codes |
created | Refund creation's timestamp | Int |
date_refund | Timestamp of the date when the API sent the refund request to the bank | Int |
date_bank | Timestamp of the delivery date of the funds by the bank | Int |
live_mode | Whatever if the refund is in live mode | Boolean |
Create a refund
| curl -X POST "https://api.stancer.com/v1/refunds/" \
--header "Content-Type: application/json" \
--data '{
"payment": "paym_sS1sXwDuaqGTjuQ7DY4BBNaI",
"amount": 50
}'
|
The above command returns JSON structured as follows:
HTTP request
Data parameters
Parameter | Field |
payment | Required |
amount | Optional |
Return parameters
The request returns a refund object as previously defined.
Get refund data
| curl "https://api.stancer.com/v1/refunds/refd_o6Y1oZinbl9lErB24OSQCAKl"
|
The above command returns JSON structured as follows:
HTTP request
Query parameters
Parameter | Field |
id_refund | Required |
Return parameters
The request returns a refund object as previously defined.