Create a new payment request for cryptocurrency payment.
Payment amount in fiat currency
Fiat currency code (USD, EUR, etc.)
Customer ID for the payment
Additional payment metadata
Webhook URL for payment notifications
URL to redirect on successful payment
URL to redirect on payment cancellation
Array of allowed cryptocurrencies (BTC, ETH, LTC, SOL)
Custom fields for the payment
Indicates if the request was successful
Payment expiration timestamp
Example Request
curl -X POST https://api.transaction.gg/payment/create \
-H "Authorization: Bearer pk_your_public_key" \
-H "Content-Type: application/json" \
-d '{
"amount": "29.99",
"currency": "USD",
"customerId": "cus_V6n6SN2KnsIFCuQU",
"orderId": "order_123",
"metadata": {
"description": "Premium subscription"
},
"webhookUrl": "https://mystore.com/webhook",
"successUrl": "https://mystore.com/success",
"returnUrl": "https://mystore.com/cancel",
"allowedCryptos": ["BTC", "ETH"],
"customFields": {
"customer_name": "John Doe"
}
}'
Alternative with Product/Price
curl -X POST https://api.transaction.gg/payment/create \
-H "Authorization: Bearer pk_your_public_key" \
-H "Content-Type: application/json" \
-d '{
"productId": "prod_X4dUuzsMaruQ4UsX",
"priceId": "price_i62wKFQ8sGnLxQ5G",
"customerId": "cus_V6n6SN2KnsIFCuQU",
"orderId": "order_123"
}'
Example Response
{
"success": true,
"data": {
"id": "pay_abc123def456",
"expiresAt": "2024-01-01T01:00:00Z"
}
}
Error Responses
{
"success": false,
"error": {
"status": 401,
"code": "UNAUTHORISED",
"message": "Invalid API key"
},
"data": null
}
{
"success": false,
"error": {
"status": 404,
"code": "CUSTOMER_NOT_FOUND",
"message": "Customer not found"
},
"data": null
}