Payment-Gateway-OpenApi
  1. Crypto For X402
Payment-Gateway-OpenApi
  • Getting Started
  • Fiat Collection
    • Overview
    • Pelago Direct Mode
      • Direct Mode Introduction
      • Get Rate
      • Order Notify
  • Crypto Collection
    • Overview
    • Order Notify
      POST
    • Refund
      POST
    • Withdraw
      POST
    • Payout
      POST
  • Common Collection
    • Check Order Info
      POST
  • Crypto For X402
    • Retrieve Supported Payment Methods
      GET
    • Create or Confirm Order
      POST
    • Query Order Status
      GET
  • Obsolete (已废弃)
    • Pelago Cashier Mode
      • Cashier Mode Introduction
      • Create Pelago Order
    • Create Order
      POST
    • Create Order
      POST
    • Get Product
      POST
    • Get Order Info
      POST
  • Create Order (统一下单接口)
    POST
  • Order Query
    GET
  1. Crypto For X402

Create or Confirm Order

POST
/openapi/crypto/x402/order
Creates a payment order or confirms payment via X-PAYMENT header. Returns 402 with payment instructions if payment is required, or 200 upon successful confirmation.

Request

Authorization
API Key
Add parameter in header
Merchant-App-Key
Example:
Merchant-App-Key: ********************
or
API Key
Add parameter in header
X-PAYMENT
Example:
X-PAYMENT: ********************
or
Header Params

Body Params application/json

Example
{
    "description": "Payment for premium subscription"
}

Request Code 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 'https://api.pelagotech.com/openapi/crypto/x402/order' \
--header 'X-PAYMENT: eyJ4NDAyVmVyc2lvbiI6MSwic2NoZW1lIjoiZXhhY3QiLCJuZXR3b3JrIjoiYnNjLW1haW5uZXQiLCJwYXlsb2FkIjp7ImFtb3VudCI6IjI2MDAwMDAiLCJzaWduYXR1cmUiOiIweDU1Li4iLCJ0eEhhc2giOiIweDEyMy4uIn19' \
--header 'Merchant-App-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "Payment for premium subscription"
}'

Responses

🟢200成功
application/json
Payment successful, order confirmed
Headers

Body

Example
{
    "orderId": "CO2025091502171350002",
    "status": "confirmed",
    "message": "Payment successful"
}
🟠400请求有误
🟠402402
Modified at 2025-10-27 02:45:31
Previous
Retrieve Supported Payment Methods
Next
Query Order Status
Built with