YoboPay
  1. Checkout
YoboPay
  • 接入说明
  • Introduction
  • Webhook接入
  • Webhook Introduction
  • Test Card
  • Embedded Checkout
  • Checkout
    • Create Session
      POST
    • Expire Session
      POST
    • Retrieve Session
      GET
  • PaymentIntents
    • Retrieve PaymentIntent
      GET
    • List all paymentIntent
      GET
  • Charges
    • List all charges
      GET
  • Customers
    • Create Customer
      POST
    • Update Customer
      POST
    • Retrieve Customer
      GET
  • Events
    • The Event object
    • Types of Events
    • Data Object
      • PaymentIntent
      • Charge
  • Refunds
    • Create Refund
      POST
    • List all refunds
      GET
  1. Checkout

Create Session

POST
/v1/checkout/sessions
Creates a Checkout Session object.

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Body Params application/json
clientReferenceId
string 
自定义id
required
A unique string to reference the Checkout Session
<= 64 characters
subject
string 
标题
required
<= 127 characters
description
string 
描述
optional
<= 1023 characters
currency
enum<string> 
币种
required
Three-letter ISO currency code, in upcase.
Allowed value:
USD
amount
number 
支付金额
required
Payment amount
>= 1
successUrl
string 
支付成功跳转url
required
The URL the customer will be directed to after the payment or subscription creation is successful.
cancelUrl
string 
取消跳转url
required
Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website
expiresAt
number 
过期时间
optional
The timestamp at which the Checkout Session will expire. It can be anywhere from 1 minutes to 24 hours after Checkout Session creation. By default, this value is 1 hours from creation.
customerId
string 
optional
The ID of the customer for this Session
customer
object 
optional
email
string 
用户邮箱
optional
customer‘s email
phone
string 
用户电话号码
optional
customer‘s phone
type
enum<string> 
支付类型
optional
Payment type, The default value is card
Allowed values:
cardstripepaypal
paymentMethodOptions
object 
支付方式特殊配置
optional
Payment-method-specific configuration.
card
object 
卡支付配置
optional
contains details about the Card payment method options.
Example
{
    "description": "test description",
    "subject": "test",
    "currency": "USD",
    "amount": "20",
    "successUrl": "https://test.com",
    "cancelUrl": "https://test.com",
    "clientReferenceId": "1123123123123128"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v1/checkout/sessions' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "test description",
    "subject": "test",
    "currency": "USD",
    "amount": "20",
    "successUrl": "https://test.com",
    "cancelUrl": "https://test.com",
    "clientReferenceId": "1123123123123128"
}'

Responses

🟢200成功
application/json
Body
code
string 
required
msg
string 
required
data
object 
required
sessionId
string 
required
Session id
paymentIntentId
string 
required
Payment intent id
clientReferenceId
string 
required
A unique string to reference the Checkout Session
expiresAt
integer 
过期时间
required
The timestamp at which the Checkout Session will expire
url
string 
收银台url
required
Checkout url
Example
{
    "code": "success",
    "msg": null,
    "data": {
        "sessionId": "cs_test_2025031108",
        "paymentIntentId": "pi_test_2025031",
        "clientReferenceId": "1111111183",
        "expiresAt": 1741768596319,
        "url": "https://sandbox-checkout.yobopay.com/pay/cs_test_2025031108"
    }
}
Modified at 2025-06-09 07:44:15
Previous
Embedded Checkout
Next
Expire Session
Built with