POST
/
api
/
service
/
refund
/
create
JavaScript
import Ivy from '@getivy/node-sdk';

const client = new Ivy({
  apiKey: 'My API Key',
});

const refund = await client.refunds.create({ amount: 0 });

console.log(refund.id);
{
  "id": "<string>",
  "amount": 1,
  "currency": "EUR",
  "status": "initiated",
  "orderId": "<string>",
  "transactionId": "<string>"
}

Authorizations

X-Ivy-Api-Key
string
header
required

API key for authentication

Body

application/json
amount
number
required
orderId
string

The internal Ivy id of the order. Must be present in request body if referenceId is not provided

referenceId
string

The external id set by the merchant during checkout creation. Required if orderId is not passed.

bankStatementReference
string

An optional custom text that will be shown on the customer's payment reference. Input has to be maximum 16 alpha-numeric characters. If not provided, a default Ivy refund referenceId will be shown.

Response

200 - application/json

Creates a refund and returns the details of created refund

id
string
required

The unique Refund id

amount
number
required

The amount of the refund in decimals.

Required range: x > 0
currency
enum<string>
required

Refund's currency.

Available options:
EUR,
GBP,
PLN,
SEK,
DKK
status
enum<string>
required

The current status of this refund.

Available options:
initiated,
pending,
succeeded,
failed
orderId
string
required

The id of the refunded order

transactionId
string

The id of the transaction