Skip to main content
POST
/
v1
/
payment_methods
Create a payment method
curl --request POST \
  --url https://api.yorlet.com/v1/payment_methods \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer": "<string>"
}
'
{
  "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
customer
string
required

The ID of the customer the payment method is for.

type
enum<string>
required

The type of the payment method.

Available options:
alipay,
autogiro,
bacs_debit,
bank_transfer,
card_present,
card,
direct_transfer,
pay_by_bank,
sepa_debit,
test_card,
wechat_pay
bank_transfer
object

Bank transfer specific options for the payment method.

Response

200 - application/json

Returns a payment method 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.