Skip to main content

Create a payment link

In development

is currently in development. Feel free to review this section to understand how the feature will work when live.

Create a payment link to accept card payments with the API.

About payment links

Payment links redirect customers to a Swan-hosted payment page where a customer can choose from the merchant's eligible enabled payment methods. These optimized payment pages are customizable with the merchant's name, logo, and accent color.

Your merchants can create links to share with their customers by email or text message. They could also include a QR code on an invoice, scannable by the customer with their mobile device.

Prerequisites
  • Merchant profile status: Enabled
  • Card payment method status: Enabled

Guide​

  1. Call the createMerchantPaymentLink mutation.
  2. Add the merchantProfileId.
  3. Payment method (line 6):
    • If you only want to allow card payments, add the card paymentMethodId.
    • If you'd like to allow all eligible enabled payment methods, don't provide a value for paymentMethodId.
  4. Add the amount, including both the value and currency.
  5. Include a label and reference if you'd like.
  6. Add the success payload. Include the final url in the payload if you'd like (line).
  7. Add rejections (not shown).
SEPA Direct debit

If the merchant has both Core and Standard SEPA Direct Debit enabled and you don't provide a value for paymentMethodId in #3, Core is used by default.

Mutation​

🔎 Open the mutation in API Explorer

mutation PaymentLink {
createMerchantPaymentLink(
input: {
merchantProfileId: "$MERCHANT_PROFILE_ID"
amount: { value: "50", currency: "EUR" }
paymentMethodIds: ""
label: ""
reference: ""
}
) {
... on CreateMerchantPaymentLinkSuccessPayload {
__typename
merchantPaymentLink {
url
}
}
}
}