FlamPix Gateway API
  1. Docs
FlamPix Gateway API
  • 📜 API Overview
  • Docs
    • 🔑 Authentication & HMAC Signing
    • 🪝 Webhook
    • 🧵 Deposit Status Strings
    • 🚦 API Limits
  • Raiz
    • Create Deposit
      POST
    • Get Deposit Status
      GET
    • Get User Info
      GET
    • Health Check
      GET
    • Transaction Status Update
  • Esquemas
    • Customer
    • DepositRequest
    • DepositResponse
    • UserInfoResponse
    • WebhookPayload
  1. Docs

🔑 Authentication & HMAC Signing

The FlamPix API uses a sophisticated HMAC SHA-256 signature scheme to ensure request integrity and authenticity. Every request you make must be signed using your API Secret.
Here is a comprehensive documentation guide in English, specifically designed to help developers implement your HMAC authentication.
It includes a dedicated section for Apidog/Postman users with a copy-paste "Pre-request Script" to automate the signing process during testing.

Authentication & HMAC Signing#

The FlamPix API uses a sophisticated HMAC SHA-256 signature scheme to ensure request integrity and authenticity. Every request you make must be signed using your API Secret.

1. Required Headers#

All requests must include the following headers:
HeaderDescription
X-FlamPix-KeyYour public API Key.
X-FlamPix-TimestampCurrent Unix timestamp (in seconds).
X-FlamPix-SignatureThe Hex string generated by the HMAC-SHA256 algorithm.

2. Constructing the Signature#

To generate the X-FlamPix-Signature, you must create a Base String and sign it using your API Secret.

A. The Base String Format#

The Base String is a concatenation of four values, separated strictly by a newline character (\n):
{timestamp}\n{METHOD}\n{path}\n{body}
timestamp: Same value as the header (e.g., 1708550400).
METHOD: Uppercase HTTP method (e.g., POST, GET).
path: The endpoint path starting with / (e.g., /gt/api/v1/deposits). Do not include the domain.
body: The raw JSON request body string.

B. Special Rules#

1.
GET Requests: The body is an empty string, but the final \n separator must still be present.
2.
Raw Body: Use the exact raw string of the body to be sent. Do not serialize JSON again after signing, or the hash will mismatch.

C. Examples#

Example 1: POST Request#

1708550400
POST
/gt/api/v1/deposits
{"amountInCents":15000,"destinationAddress":"lq1..."}

Example 2: GET Request (Note the trailing newline)#

1708550405
GET
/gt/api/v1/deposits/c2a5dbd4-043a-4d4f-866e-8ddad4ed067c


3. Automation in Apidog (or Postman)#

If you are using Apidog to test the API, you don't need to calculate the hash manually. You can use a Pre-request Script to generate the headers automatically.
Steps:
1.
Open your project in Apidog.
2.
Go to Environment Management.
3.
Add two variables: FLAMPIX_API_KEY and FLAMPIX_API_SECRET.
4.
Open your request (or the entire Collection settings), go to the Pre-request Script tab, and paste the following code:

4. Code Implementation Examples#

Node.js (Axios)#

PHP#

Python#

Modificado em 2025-12-22 21:38:09
Página anterior
📜 API Overview
Próxima página
🪝 Webhook
Built with