TechnoMindsSaudi digital infrastructure

Developer documentation

Fatoorah API with Python

Use a server-side HTTP client with explicit connect and read timeouts. Reuse one operation key after retryable failures and move ambiguous results to reconciliation instead of guessing.

Implementation guide

What the integration should preserve.

  1. 01

    Load the key from a process secret, not source code.

  2. 02

    Set explicit timeout and bounded retry policies.

  3. 03

    Persist request IDs before doing later accounting work.

  4. 04

    Do not retry validation or authorization failures unchanged.

  5. 05

    Keep sandbox and production configuration physically separate.

Relevant paths

POST /v1/fatoorah/invoicesGET /v1/fatoorah/invoices/:id

Example

import os, requests

response = requests.post(
    f"{os.environ['TECHNOMINDS_API_URL']}/v1/fatoorah/invoices",
    headers={"Authorization": f"Bearer {os.environ['TECHNOMINDS_API_KEY']}",
             "Idempotency-Key": invoice_operation_id},
    json={"invoice_type": "standard", "currency": "SAR", "total": 115},
    timeout=(3.05, 20),
)
response.raise_for_status()
result = response.json()

Continue reading