Skip to main content
POST
/
v1
/
payment_sessions
Create a payment session
curl --request POST \
  --url https://api.yorlet.com/v1/payment_sessions \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 50000000,
  "currency": "gbp",
  "customer": "<string>",
  "mode": "payment",
  "payment_method_types": [
    "autogiro"
  ],
  "description": "<string>",
  "metadata": {},
  "payment_method_options": {},
  "reporting_type": "advance_rent",
  "return_url": "<string>",
  "send_email": true,
  "statement_descriptor": "<string>",
  "transaction_data": {
    "transfer_data": {
      "use_unit_ownership": true
    },
    "unit": "<string>"
  }
}
'
{
  "id": "<string>",
  "created": 123,
  "object": "payment_session",
  "amount": 123,
  "currency": "<string>",
  "customer": "<string>",
  "description": "<string>",
  "mode": "payment",
  "payment_method_types": [
    "<string>"
  ],
  "reporting_type": "<string>",
  "return_url": "<string>",
  "status": "paid",
  "transaction": "<string>",
  "url": "<string>",
  "account": "<string>",
  "deleted": false,
  "merchant": {
    "business_name": "<string>",
    "color": "<string>",
    "country": "<string>",
    "display_name": "<string>",
    "icon": "<string>",
    "id": "<string>",
    "support_email": "<string>",
    "support_phone": "<string>",
    "support_website": "<string>"
  },
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API Key authentication. Use "Bearer YOUR_API_KEY".

Body

application/json
amount
integer
required

The amount to charge. Should be a positive integer in the smallest currency unit (e.g. 100 for £1.00).

Required range: 100 <= x <= 99999900
currency
enum<string>
required

Three-letter ISO currency code, in lowercase. Must be a supported currency.

Available options:
gbp,
eur,
usd
customer
string
required

The ID of the customer the transaction is for.

mode
enum<string>
required
Available options:
payment
payment_method_types
enum<string>[]
required
Minimum array length: 1
Available options:
autogiro,
bacs_debit,
card,
card_present,
bank_transfer,
direct_transfer,
gbp_credit_transfer,
pay_by_bank,
sepa_debit
description
string

An arbitrary string attached to the object. Often useful for displaying to users.

metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

payment_method_options
object

Payment method configuration options.

reporting_type
enum<string> | null

The reporting type of the transaction.

Available options:
advance_rent,
charge,
deposit,
holding_fee,
rent,
null
return_url
string<uri>

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

send_email
boolean

Send the URL to the customer email address.

statement_descriptor
string | null

The statement descriptor that will appear on customers bank statement.

transaction_data
object

A subset of parameters to be passed to transaction creation.

Response

200 - application/json

Returns the payment session object if the request succeeded.

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_session
amount
number
required
currency
string
required
customer
required
description
string | null
required
mode
enum<string>
required
Available options:
payment
payment_method_types
string[]
required
reporting_type
string | null
required
return_url
string | null
required
status
enum<string>
required
Available options:
paid,
unpaid,
canceled
transaction
required
url
string | null
required
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.

merchant
object
metadata
object

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.