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

Retrieve Session

GET
/v1/checkout/sessions/{id}

Request

Authorization
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
Path Params
id
string 
required

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 GET '/v1/checkout/sessions/'

Responses

🟢200成功
application/json
Body
code
string 
required
msg
string 
required
data
object (Session) 
required
sessionId
string 
required
Session id
paymentIntentId
string 
required
Payment intenet id
clientReferenceId
string 
自定义id
required
A unique string to reference the Checkout Session
currency
string 
币种
required
Three-letter ISO currency code, in upcase.
amount
number 
金额
required
Payment amount
>= 1
status
enum<string> 
required
Allowed values:
opencompleteexpired
subject
string 
主题
required
description
string 
描述
optional
customerId
string 
optional
The ID of the customer for this Session
customer
object 
optional
expiresAt
integer 
过期时间
required
The timestamp at which the Checkout Session will expire.
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
url
string 
收银台url
required
Checkout url
created
integer 
创建时间
required
Timestamp at which the object was created.
paymentMethodOptions
object 
付款方式配置
optional
Payment-method-specific configuration.
Example
{
    "code": "success",
    "msg": null,
    "data": {
        "sessionId": "cs_test_2025031",
        "paymentIntentId": "pi_test_202503110",
        "clientReferenceId": "183",
        "currency": "USD",
        "amount": 20,
        "status": "expired",
        "subject": "test",
        "description": "test des",
        "customerId": "cus_test_20250306",
        "expiresAt": 1741768596319,
        "successUrl": "https://test.com/",
        "cancelUrl": "https://test.com",
        "url": "https://sandbox-checkout.yobopay.com/pay/cs_test_2025031",
        "created": 1741682196321,
        "paymentMethodOptions": {
            "card": {
                "setupFutureUsage": "on_session"
            }
        }
    }
}
Modified at 2025-03-21 06:13:22
Previous
Expire Session
Next
Retrieve PaymentIntent
Built with