Skip to main content
POST
/
payment
/
create
{
  "success": false,
  "error": {
    "status": 401,
    "code": "UNAUTHORISED",
    "message": "Invalid API key"
  },
  "data": null
}
Create a new payment request for cryptocurrency payment.
amount
string
required
Payment amount in fiat currency
currency
string
required
Fiat currency code (USD, EUR, etc.)
customerId
string
required
Customer ID for the payment
orderId
string
required
Unique order identifier
metadata
object
Additional payment metadata
webhookUrl
string
Webhook URL for payment notifications
successUrl
string
URL to redirect on successful payment
returnUrl
string
URL to redirect on payment cancellation
allowedCryptos
array
Array of allowed cryptocurrencies (BTC, ETH, LTC, SOL)
customFields
object
Custom fields for the payment
success
boolean
Indicates if the request was successful
data.id
string
Payment ID for tracking
data.expiresAt
string
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
}