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"
}'