Refund Creation Endpoint
Create refunds requests from a completed deposit
Refund Creation
POST
https://api-stg.directa24.com/v3/refunds
This endpoint allows you to create a full or a partial refund over a completed deposit.
Headers
Name | Type | Description |
---|---|---|
Content-Type | string |
|
X-Date | string | ISO8601 Datetime with Timezone: |
X-Login | string | Merchant X-Login API Key |
Authorization | string | Authorization control hash |
X-Idempotency-Key | string | Unique idempotency key |
Request Body
Name | Type | Description |
---|---|---|
deposit_id | integer | Directa24 |
invoice_id | string | The |
amount | number | Amount to refund. If none is sent, the full deposit amount is assumed |
bank_account | object | Object containing the information of the beneficiary. Not needed for credit cards |
comments | string | Commentaries about the refund, if any |
notification_url | string | HTTPS URL used to send the notifications about refund's change of status |
Description
The refunds
endpoint allows you to create a full/partial(depending on the market) refund over a Credit Card deposit in completed state or full/partial refunds over other payment methods' deposits in completed state.
In the case of credit cards, since the refund will be processed to the same card, all you need to send are the fields to identify the deposit.
In the case of other payment methods where we don't have the account of the payer, you need to send the beneficiary's ID, bank account details and bank code retrieved with the Endpoint for Bank Codes.
You can create as many refunds as needed over a completed deposit, as long as the total amount of those refunds doesn't exceed the original amount deposited.
Refunds Request
In order to start creating refunds, you need to:
Send the request with POST method.
Use the headers described here.
Specify a valid
deposit_id
andinvoice_id
related to the deposit to be refunded.Send the Authorization header calculated in the same way than for deposits, as explained here.
Send the body of the request as JSON.
Example Request
Request fields description
Field | Format | Description | Validations |
| Integer | D24 | Valid |
| String (max length: 128) | The | Valid |
| Big decimal (positive, up to 2 decimals) | Amount to refund. Only used in case of partial refunds. If none is sent, a full refund will be assumed | Positive. Equal or smaller than the deposit amount |
| Object[] | Object containing the details where the refund should be sent to | |
| String (max length: 200) | Commentaries about the refund, if any | String of up to 200 characters |
| String (max length: 2048) | Valid HTTPS URL used to send the notifications about refund's change of status | HTTPS URL |
bank_account
Object
bank_account
ObjectField name | Format | Description | Validations |
| string (max length: 255) | Beneficiary's name and last name | String of up to 255 characters |
| string (max length: 10) | Beneficiary's document type | Valid document type for the country of the deposit. |
| string (max length: 30) | Beneficiary's document ID | Valid document for the country of the deposit. |
| string (max length: 5) | Beneficiary's valid | |
| string (max length: 45) | Beneficiary's bank branch | String of up to 45 characters |
| string (max length: 45) | Beneficiary's bank account number | String of up to 45 characters |
| string (max length: 45) | Beneficiary's account type |
Account types
| Description |
SAVING | Savings account |
CHECKING | Checkings account |
VISTA | Salary account |
MASTER | Master account |
SAVING_SET | Joint savings account |
CHECKING_SET | Joint checkings |
DEFAULT | Default |
Example Response
CASH Success Response Example
CASH Success Response Fields
Field | Format | Description |
| Integer | ID of the refund on D24 end. Store this ID for future checks of its status |
CREDIT CARD Responses Example
When the refund is made over a CREDIT CARD deposit, it might be (depending upon availability) completed instantaneously, and so all the details of the refund are returned.
In case the result is SUCCESS, it means the refund was successfully created and the user should receive the money back into their card soon.
In case the result is REJECTED, the response of the API will return two fields called reason
and reason_code
providing more information about the rejection reason.
In case the result is IN_PROGRESS, it means the refund will be processed asynchronously and so a notification will be sent to the notification_url
specified at the time of creating the refund as soon as it gets completed or rejected. Click here for more information about the notifications of the refunds.
Error Responses Example
Error Responses Fields
Field | Format | Description |
| Integer | |
| String | Description of the error |
| String | Type of the error. Click here to check all the possible error types for refund |