Api
Create Payment
Create a new payment for a store. You can specify either:
- Fiat amount (will calculate crypto amount dynamically)
- Crypto amount with specific payment method
- Both (but this will result in conflict error)
AuthorizationBearer <token>
JWT token with EdDSA signature. Use Bearer scheme.
In: header
invoiceType?string
Invoice type
Value in
"CRYPTO" | "FIAT"fiatAmount?string
Fiat amount as string (must be >= 0)
fiatCurrency?string
Fiat currency symbol
Value in
"USD" | "EUR" | "RUB"cryptoAmount?string
Crypto amount as string (must be >= 0)
paymentMethodID?string
Payment method ID
metadata?string
There can be any data here. It will be sent in the body of the webhook.
webhookURL?string
The url to which the webhook will be sent
Format
uriResponse Body
curl -X POST "https://api.hexpay.io/v1/payments/create" \ -H "Content-Type: application/json" \ -d '{ "invoiceType": "FIAT", "fiatAmount": "100.50", "fiatCurrency": "USD", "metadata": "eyJvcmRlcklkIjoiMTIzNDUifQ==", "webhookURL": "https://merchant.com/webhook" }'{
"paymentID": "019327c6-2058-7901-b234-56789abcdeff"
}{
"error": "Conflicting data: cannot specify both fiat and crypto amounts",
"code": "AMOUNT_CONFLICT"
}{
"error": "Invalid authentication token",
"code": "AUTH_INVALID"
}{
"error": "Payment method not found",
"code": "PAYMENT_METHOD_NOT_FOUND"
}{
"error": "Internal server error",
"code": "INTERNAL_ERROR"
}