Create a payment link
Create a payment link to accept SEPA Direct Debit payments with the API.
Prerequisites
- Merchant profile status:
Enabled - Card payment method status:
Enabled - Account member permission:
canManageAccountMembership
In development
Payment links are currently in development. Feel free to review this section to understand how the feature will work when live.
Guide​
- Call the
createMerchantPaymentLinkmutation. - Add the
merchantProfileId. - Add your direct debit
paymentMethodId. You must choose either Core or Standard. - Add the
amount, including both thevalueandcurrency. - Include a
labelandreferenceif you'd like. Note that thelabelmight appear on the payer's card statement. - Add the success payload. Include the final
urlin the payload if you'd like (line 14). - Add rejections (not shown).
Mutation​
🔎 Open the mutation in API Explorer
mutation PaymentLink {
createMerchantPaymentLink(
input: {
merchantProfileId: "$MERCHANT_PROFILE_ID"
amount: { value: "50", currency: "EUR" }
paymentMethodIds: "$PAYMENT_METHOD_ID"
label: "Your custom label"
reference: "YourReference"
}
) {
... on CreateMerchantPaymentLinkSuccessPayload {
__typename
merchantPaymentLink {
url
}
}
}
}
Payload​
Notice the payment link to share with the merchant's customer in the success payload (line 6).
{
"data": {
"createMerchantPaymentLink": {
"__typename": "CreateMerchantPaymentLinkSuccessPayload",
"merchantPaymentLink": {
"url": "https://payment.sandbox.swan.io/$MERCHANT_PAYMENT_ID?lang=en"
}
}
}
}