Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

Skip to main content

Refund a credit transfer

Refund incoming transfers with the API.

Guide​

  1. Call the refund mutation.
  2. Add the originTransactionId, consentRedirectUrl, and amount.
  3. Add the RefundSuccessPayload payload.
  4. Add the consent URL to the success payload (line 48): consent > consentUrl.
  5. Add the RefundRejection rejection in case of error.

Mutation​

Open in API Explorer
mutation RefundCreditTransfer {
refund(
input: {
consentRedirectUrl: "$YOUR_REDIRECT_URL"
refundTransactions: {
originTransactionId: "YOUR_ORIGIN_TRANSACTION_ID"
amount: { value: "22", currency: "EUR" }
}
}
) {
... on RefundSuccessPayload {
__typename
consent {
id
consentUrl
}
}
... on RefundRejection {
__typename
code
message
}
}
}

Payload​

The payload provides the consentUrl to finalize the refund.

{
"data": {
"refund": {
"__typename": "RefundSuccessPayload",
"consent": {
"id": "YOUR_REFUND_ID",
"consentUrl": "https://identity.swan.io/consent?consentId=$YOUR_CONSENT_ID&env=Sandbox"
}
}
}
}