Create New Payment
With this method, merchants can create payment links from their backend applications. Use this method when your customers purchcase a product from your app.
Endpoint
POST https://api.dex3.io/api/v1/createpayment
A successful POST request typically returns a 200
Headers
Content-Type
application/json
merchant_public
YOUR MERCHANT PUBLIC
Parameters
Key
Description
Datatype
order_id
Required - Pass a unique order id which you will track within your application
varchar(200)
productName
Required - Name of the product
varchar(50)
amount
Required - Amount in USD
Important : Amount must be multiplied by 100.
Example :
For $1, pass 100
For $200, pass 20000
int
expiration
Required -
Enter 0 for no expiry
Enter number in seconds to allow validity for payment.
int
webhook
Optional - Your webhook URL where you want to get notified when the payment is complete
url
success_redirect
Optional - Success URL, where you want your users to be sent to once they complete the payment.
url
cancel_redirect
Optional - Cancel URL, where you want your users to be sent to when they cancel the payment
url
notes
Optional - Send any additional tracking info which you will use to process the payment
json
signature
Required - Create signature (See 'Create Signature' endpoint) as a means to identify if the payment is originally coming from your servers. Read 'Create Signatures'
varchar
Example
{
"order_id": "1001",
"productName": "Add Funds",
"amount": "10000",
"notes": "{\"user_id\": \"3\"}",
"expiration": "0",
"webhook": "https://www.dex3.io/webhooksample",
"signature": "a94dfc7c6334402b3d88fe5368e85755767b9e63ac3c259e79163dc8dc199965"
}{
"state": true,
"data": {
"payLink": "https://pay.dex3.io/pay/EKKlnN7QXB5ynmqZTeriefGLgr4jq8",
"paymentData": {
"payment_id": "EKKlnN7QXB5ynmqZTeriefGLgr4jq8",
"order_id": "123",
"productName": "Add Funds",
"amount": "100",
"expiration": 1710140681,
"webhook": "https://www.dex3.io/webhooksample",
"notes": "{\"user_id\":\"3\"}",
"created": 1710140558
}
}
}{
"state": false,
"error": {
"message": "Duplicate order id",
"code": 400,
"errData": false
}
}Last updated
Was this helpful?