Skip to main content
POST
/
v1
/
payment_methods
/
setup
Set up a payment method
curl --request POST \
  --url https://api.yorlet.com/v1/payment_methods/setup \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "consumer_user_link": "<string>",
  "return_url": "<string>",
  "single_use": true,
  "use_yorlet_sdk": true
}
'
{
  "id": "<string>",
  "created": 123,
  "object": "payment_method",
  "billing_details": {
    "address": {
      "line1": "<string>",
      "line2": "<string>",
      "city": "<string>",
      "country": "<string>",
      "postal_code": "<string>",
      "state": "<string>"
    },
    "email": "<string>",
    "name": "<string>",
    "phone": "<string>"
  },
  "customer": "<string>",
  "type": "bacs_debit",
  "bacs_debit": {
    "fingerprint": "<string>",
    "last4": "<string>",
    "sort_code": "<string>"
  },
  "account": "<string>",
  "deleted": false
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Body

application/json
type
enum<string>
required

The type of the payment method to set up.

Available options:
autogiro,
bacs_debit,
bank_transfer,
card,
onemove,
pay_by_bank,
sepa_debit

The consumer user link to associate with the setup session.

return_url
string<uri>

The URL to redirect the user to after the setup is complete.

single_use
boolean

Whether the resulting payment method should be limited to a single use.

use_yorlet_sdk
boolean

Whether to use the Yorlet SDK to complete the setup.

Response

200 - application/json

Returns a setup object if successful.

The Bacs debit payment method.

id
string
required

Unique identifier for the object.

created
number
required

Time at which the object was created. Measured in seconds since the Unix epoch.

object
enum<string>
required
Available options:
payment_method
billing_details
object
required

Billing information associated with the payment method.

customer
required

The customer this payment method is attached to.

status
enum<string>
required

The current status of the payment method.

Available options:
chargeable,
pending,
failed
type
enum<string>
required

The type of the payment method.

Available options:
bacs_debit
bacs_debit
object
required

Information about the Bacs Direct Debit payment method.

account
string

The account that the object belongs to. Only returned if the request is made with a valid Yorlet-Context header.

deleted
boolean
default:false

Only returned if the object has been deleted.