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,
  "customer": "<string>",
  "mode": "payment",
  "payment_method_types": [],
  "description": "<string>",
  "metadata": {},
  "payment_method_options": {},
  "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>",
  "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

The mode of the payment session.

Available options:
payment
payment_method_types
enum<string>[]
required

The payment method types allowed for this session.

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

The amount of the payment session, in the smallest currency unit.

currency
string
required

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

customer
required

The customer the payment session is for.

description
string | null
required

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

mode
enum<string>
required

The mode of the payment session.

Available options:
payment
payment_method_types
string[]
required

The payment method types allowed for this session.

reporting_type
string | null
required

The reporting type used to categorize this payment session.

return_url
string | null
required

The URL to redirect to after the payment session is complete.

status
enum<string>
required

The status of the payment session.

Available options:
paid,
unpaid,
canceled
transaction
required

The transaction created for this payment session.

url
string | null
required

The hosted URL of the payment session.

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

Information about the merchant operating the payment session.

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.