# GET /flouci/check/{agentId}
curl -X GET 'https://<YOUR_DOMAIN>/flouci/check/AGENT12345' \
  -H 'Authorization: Bearer {JWT_TOKEN}'
{
  "code": "0",
  "desc": "Agent Name",
  "amount": "250000" 
}

Introduction

The Real-time Settlement feature establishes a direct payment channel between your agents in the field and your central system. As agents are equipped with Flouci, this system allows them to send money to you and instantly have their balance reflected in real-time. This solution is designed to:
  • Reduce Risk: Block agents who have accumulated a high cash balance.
  • Optimize Resources: Facilitate seamless reconciliation between your accounts and your agents’ balances.
This is achieved via two dedicated API endpoints: a check endpoint to validate an agent’s status and a confirm endpoint to log the payment details in your system.

Authentication

To secure the communication between Flouci and your system, you will need to provide a JWT token. This token must be included in the Authorization header of every API request. These tokens will need to be renewed periodically.
Authorization
string
required
Your JWT token for authenticating the request. Format: Bearer {JWT_TOKEN}

Check Agent Endpoint

This endpoint is used to check if an agent has a valid ID and to retrieve their current due amount before a payment is initiated. The agent ID can be any easily identifiable string, such as a phone number, a national ID number, or a custom alphanumeric code.
# GET /flouci/check/{agentId}
curl -X GET 'https://<YOUR_DOMAIN>/flouci/check/AGENT12345' \
  -H 'Authorization: Bearer {JWT_TOKEN}'
{
  "code": "0",
  "desc": "Agent Name",
  "amount": "250000" 
}

Path Parameters

agentId
string
required
The unique identifier for the agent.

Response Body

code
string
required
Indicates the status of the agent ID.
  • "0": Valid agent ID.
  • "1": Invalid agent ID.
desc
string
required
The agent’s full name. This will be an empty string if the agent ID is invalid.
amount
string
required
The total amount due from the agent, in millimes. The agent can choose to pay this amount or a different one.

HTTP Status Codes

  • 200 OK: Request was successful.
  • 403 Forbidden: Unauthorized request (e.g., invalid JWT token).

Confirm Payment Endpoint

This endpoint is called to confirm that the payment details were successfully received and stored by your system after the agent completes a transaction.
# POST /flouci/confirm
curl -X POST 'https://<YOUR_DOMAIN>/flouci/confirm' \
  -H 'Authorization: Bearer {JWT_TOKEN}' \
  -H 'Content-Type: application/json' \
  -d '{
        "transactionId": "TXN_1a2b3c4d5e6f",
        "agentId": "AGENT12345",
        "amount": 50000
      }'
{
  "code": "0"
}

Request Body

transactionId
string
required
The unique ID for the Flouci transaction.
agentId
string
required
The unique identifier for the agent who made the payment.
amount
integer
required
The amount paid by the agent, in millimes.

Response Body

code
string
required
Indicates the status of the confirmation.
  • "0": Transaction successfully stored.
  • "1": Invalid agent ID.
  • "2": Invalid amount.
  • "3": Invalid transaction (e.g., transaction ID already registered).

HTTP Status Codes

  • 200 OK: Request was successful.
  • 403 Forbidden: Unauthorized request (e.g., invalid JWT token).