Creation of a refund Run in API Explorer
This request allows you to make a refund for a paid transaction.
When making multiple refund transactions simultaneously, please allow at least a 5-second delay between each transaction.
For security reasons, refunds can be made:
- for BLIK, up to a maximum of 12 months
- for imoje pay later, up to a maximum of 12 months
- for payment cards, up to 3 years
Path parameters
-
Merchant identifier
-
Transaction identifier as
UUID v4Maximum length is
36. Format should match the following pattern:^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.
Body
Required
-
Transaction type
Value is
refund. -
Shop identifier as
UUID v4Maximum length is
36. Format should match the following pattern:^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$. -
The transaction amount in the smallest currency unit, e.g. pennies.
-
Transaction title
Maximum length is
255. Format should match the following pattern:^[A-Za-z0-9#&_\-\,\.\\\\/ \u00C0-\u02C0"']+$. -
Send an e-mail confirming the refund to the payer. The e-mail is sent after the refund has been successfully processed (status
settled) to the e-mail address provided when placing the order.
curl \
--request POST 'https://api.imoje.pl/v1/merchant/{merchantId}/transaction/{transactionId}/refund' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"type":"refund","title":"yourRefundTitle","amount":100,"serviceId":"24737aab-a507-4feb-8248-3f42bfdbb006","sendRefundConfirmationEmail":true}'
{
"type": "refund",
"title": "yourRefundTitle",
"amount": 100,
"serviceId": "24737aab-a507-4feb-8248-3f42bfdbb006",
"sendRefundConfirmationEmail": true
}
{
"transaction": {
"id": "2eea6c95-51fc-446a-bedc-03e4b197ffd0",
"type": "refund",
"amount": 1000,
"source": "api",
"status": "settled",
"created": 1735686000,
"orderId": "yourOrderId",
"currency": "PLN",
"modified": 1735686000,
"serviceId": "51cd18a7-68dc-49a7-bb23-3854bbc34627",
"paymentMethod": "blik",
"paymentMethodCode": "blik"
}
}
{
"apiErrorResponse": {
"code": "TRX-ERROR-120100",
"errors": [],
"message": "Refund amount too large.",
"instance": {
"type": "refund",
"amount": 2000,
"serviceId": "51cd18a7-68dc-49a7-bb23-3854bbc34627"
}
}
}