Quickstart

Use the TradPay API to create payments and track transactions

In order to perform actions using the TradPay API, you need to complete the following steps.

1. Create TradPay Account & Get API keys

  • Go to TradPay and log in.

  • Under Developer → API, check Enable to generate your Secret API Keys.

  • Save these securely, as the Secret API Key won’t be retrievable later (you can regenerate both if needed).

  • Prerequisite: Account verification is required. (Dashboard → Settings → Merchant Profile → Select Creator or Business)

2. Signature

Every request must include a hashed authentication signature in the header. It’s computed by concatenating your signing key and request body. Then generates a hash using the HMAC SHA256 hash algorithm.

The Header contains: the signature content of X-TX-Signature and X-TX-AppId

  • Example request header

POST https://api.tradpay.io/v1/{PATH} HTTP/1.1
Content-Type: application/json;
X-TX-Signature: signature-content-hash
X-TX-AppId: YOUR-APP-ID
  • Example signature

import crypto from "crypto";

function signRequestBody(
    body: string, // JSON from request body
    secretKey: string // taken from dashboard for API secret key
  ): string {
    return crypto
        .createHmac("sha256", secretKey) // Create a HMAC SHA256 hash
        .update(body, "utf8") // Update the token hash with the request body using utf8
        .digest("hex");
}

3. Send requests

  • Please replace YOUR-APP-ID with your actual APP-ID.

curl -X POST https://api.tradpay.io/v1/{PATH} \
    -H "Content-Type: application/json" \
    -H "X-TX-Signature: SIGNATURE-HASH" \
    -H "X-TX-AppId: YOUR-APP-ID" \
    -d '{}'

Last updated