Create Payment
After understanding DogPay's acquiring workflow, this guide will walk you through creating your first Web3 payment order using our API.
🛠️ 1. Preparation: Get Currency Config
DogPay supports multiple blockchains and cryptocurrencies. Before creating an order, you need to know the unique configuration ID (currencyConfigId) for the target currency on a specific chain.
You can call the Get Currency Config endpoint to retrieve the supported list. For example, getting the USDT config on Ethereum:
// Response snippet example
{
"id": "config_eth_usdt_001",
"pay_channel": "pay_002",
"currency": "USDT",
"chain": "Ethereum",
"status": "active"
}Note: Please save the id you want to use, as it will be passed as the currencyConfigId when creating the order.
🚀 2. Initiate Create Order Request
Once you have the configuration ID, you can call the Create Pay Order endpoint to create an order.
Developer Notes
- Minimum Amount: To prevent micro-amounts (dust amounts) from being filtered by the network, the order amount (
orderAmount) must be greater than or equal to0.02. For example, if you pass0.01during a top-up test, the order will be blocked by the system.- Channel Version: Due to system upgrades, please prioritize setting the
payChannelparameter to a fixed value ofpay_002. The old channel (pay_001) is no longer being updated.
Example Request
curl -X POST "[https://sandbox-api-v2.dogpay.com/open-api/v1/pay](https://sandbox-api-v2.dogpay.com/open-api/v1/pay)" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orderAmount": "0.02",
"payChannel": "pay_002",
"currencyConfigId": "config_eth_usdt_001",
"goodsName": "Premium Subscription",
"callId": "order_req_1712345678",
"successUrl": "[https://your-merchant-site.com/payment/success](https://your-merchant-site.com/payment/success)",
"failureUrl": "[https://your-merchant-site.com/payment/failed](https://your-merchant-site.com/payment/failed)"
}'Core Parameters Overview
| Parameter | Required | Description |
|---|---|---|
orderAmount | Yes | The order amount (in your configured fiat or stablecoin). Must be $\ge$ 0.02. |
payChannel | No | The payment channel. Preferentially use pay_002. |
currencyConfigId | Yes | The combined configuration ID for the chain and currency (obtained in Step 1). |
goodsName | Yes | The product name or short description that will be displayed on the checkout page. |
callId | Yes | A unique request ID generated by your business system, used to ensure request Idempotency. |
successUrl | No | The URL to which the frontend will redirect after the user successfully completes the payment. |
failureUrl | No | The URL to which the frontend will redirect if the payment fails or is actively cancelled. |
🔗 3. Handle Response & Display Checkout
If the request is successful, DogPay will return the response data containing the payUrl (hosted checkout link).
Example Response
{
"code": 0,
"message": "success",
"data": {
"transaction": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"status": "pending"
// ... other order details ...
},
"payInfo": {
"payUrl": "[https://pay.dogpay.com/checkout/550e8400-e29b-41d4](https://pay.dogpay.com/checkout/550e8400-e29b-41d4)",
"expireTime": 1712349278
}
}
}Next Steps
Extract data.payInfo.payUrl from the response and display it to the user in your frontend application (this can be done via direct redirect, embedded iframe, or generating a QR code).
After the user completes the payment at the checkout, please ensure you listen to the relevant Webhook events to accurately update the order status in your system.
Updated 20 days ago
