API Guide
Log In
API Guide

Pay by card

Learn how to let end users fund a pay run with a debit or credit card instead of a bank account

Alongside paying from a connected bank account via Open Banking, Crezco also supports funding a pay run with a debit or credit card. This is useful for end users whose bank doesn't support Open Banking well, or who simply prefer to pay by card.

Note: Currently card payments are only supported for domestic payments

🚧

An organisation must be verified to pay by card

Paying by card requires the CardPayments feature, which is enabled once the organisation completes the Verification flow - see Get Organisation for the full feature list. Unlike bank payments, connecting a bank account first isn't required

Connecting a card

There are two ways to start a card connection, both of which return a url to redirect the user to and require a returnUrl query parameter to redirect them back to your system on completion:

  • Connect - the general-purpose connect flow. This is recommended when onboarding an organisation for the first time, since it lets the user choose whether to add a bank account or a card.
  • Connect Card - goes straight to the card connection flow. Use this when your own UI already has an explicit option for the user to add a card, rather than a generic "add a payment source" option.

Payment sources

Get payment sources returns every payment source available to an organisation - both connected bank accounts and previously used cards - discriminated by paymentSourceType (BankAccount or Card). Use this to display the user's available payment sources and let them pick one, or to retrieve the paymentSourceId of a card to reuse for a future payment.

We recommend using this endpoint over Get Organisation Bank Accounts, which only returns bank accounts and which we plan to deprecate in favour of this unified endpoint.

A payment source, whether a bank account or a card, can be removed with Delete payment source.

Creating a pay run funded by card

There are two ways to fund a pay run with a card on Create pay run:

  1. A new card - set paymentSourceType to Card and don't specify a paymentSourceId. The user will be asked to enter their card details during checkout.
  2. A previously connected card - set paymentSourceId to the ID of a card from Get payment sources. paymentSourceType can be omitted in this case, since it's derived automatically from the payment source.

Example: paying with a new card

{
  "partnerEntityId": "e3f1a3a1-9a7a-4c2f-8e3f-1a2b3c4d5e6f",
  "paymentSourceType": "Card",
  "payables": [
    {
      "partnerEntityId": "0b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
      "recipientAmount": {
        "amountInMinorUnits": 2000,
        "currencyCode": "GBP"
      },
      "reference": "testcard123",
      "beneficiary": {
        "bankAccount": {
          "accountCurrency": "GBP",
          "accountRoutingName": "John Doe",
          "country": "GB",
          "gbSortCode": "123456",
          "gbAccountNumber": "12345678"
        }
      }
    }
  ]
}

As with bank payments, fees and totals are returned on the payable rather than being hardcoded on your side - see Collecting Fees for how to read and display these.

📘

Beneficiaries are still bank accounts

Whichever payment source funds the pay run, every payable's beneficiary must still be a bank account. Crezco currently only supports paying from a card to a bank account - not paying out to a beneficiary's card.

Checking out and authorising the payment

Checkout works the same way as for bank-funded pay runs - call Checkout pay run to get a URL to the Crezco hosted payment flow.

  • If no paymentSourceId was specified, the user is prompted to enter their card details in this flow.
  • If a stored card's paymentSourceId was specified, the user goes straight to authorising the payment, which may include a 3D Secure (3DS) challenge.

Payment statuses

Card payments follow the same Payment statuses as bank payments. While the user is completing 3DS (or any other authorisation step with the card issuer), the Payable and Pay Run report UserInitiationInProgress, the same status used while a user is authorising a bank payment with their bank.