Nexora

Documentation API

API REST en lecture seule pour intégrer Nexora à vos outils métier. Réservée aux abonnés Enterprise.

Lecture seuleJSON / RESTEnterprise

Introduction

L'API Nexora vous permet d'accéder programmatiquement aux données de votre entreprise. Elle suit les conventions REST — les ressources sont accessibles via des URLs claires, les réponses sont en JSON.

URL de base : https://www.nexoramg.com/api/v1

Authentification

Chaque requête doit inclure votre clé API dans le header HTTP suivant :

X-API-Key: nxr_votre_cle_api
Sécurité : Ne partagez jamais votre clé. Elle donne accès en lecture à toutes les données de votre entreprise. Si elle est compromise, révoquez-la immédiatement depuis les paramètres.

Obtenir une clé

  1. Être abonné au plan Enterprise
  2. Aller dans Paramètres → Clés API
  3. Cliquer sur "Nouvelle clé" et la copier immédiatement

Pagination

Tous les endpoints de liste acceptent les paramètres suivants :

ParamètreTypeDescription
pageintegerNuméro de page (défaut : 1)
limitintegerRésultats par page, max 100 (défaut : 50)

Format de réponse :

{
  "object": "list",
  "data":   [...],
  "total":  142,
  "page":   1,
  "limit":  50
}

Codes d'erreur

Code HTTPSignification
401Clé API manquante ou invalide
403Plan Enterprise requis ou clé révoquée
404Ressource introuvable
429Trop de requêtes (rate limiting)
500Erreur serveur interne

Corps d'une erreur :

{ "error": "Invalid or missing API key" }
GET/api/v1/me

Retourne les informations sur la clé API utilisée et l'entreprise associée.

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  https://www.nexoramg.com/api/v1/me

Réponse :

{
  "object":  "api_key",
  "keyName": "Intégration Shopify",
  "prefix":  "nxr_a1b2c3d4…",
  "plan":    "ENTERPRISE",
  "company": {
    "id":       "cuid...",
    "name":     "Acme Corp",
    "currency": "EUR",
    "country":  "FR",
    "email":    "contact@acme.com"
  }
}
GET/api/v1/clients

Liste les clients actifs de votre entreprise.

Paramètres :

pageintegerPage (défaut : 1)
limitintegerRésultats par page, max 100 (défaut : 50)

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  "https://www.nexoramg.com/api/v1/clients?page=1&limit=20"

Réponse :

{
  "object": "list",
  "data": [
    {
      "id":        "cuid...",
      "firstName": "Jean",
      "lastName":  "Dupont",
      "email":     "jean.dupont@email.com",
      "phone":     "+33612345678",
      "company":   "Dupont SARL",
      "city":      "Paris",
      "country":   "FR",
      "createdAt": "2024-01-15T10:30:00.000Z"
    }
  ],
  "total": 85,
  "page":  1,
  "limit": 20
}
GET/api/v1/invoices

Liste les factures de votre entreprise, avec filtre optionnel par statut.

Paramètres :

pageintegerPage (défaut : 1)
limitintegerRésultats par page, max 100
statusstringDRAFT | SENT | PAID | OVERDUE | CANCELLED

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  "https://www.nexoramg.com/api/v1/invoices?status=SENT&limit=100"

Réponse :

{
  "object": "list",
  "data": [
    {
      "id":            "cuid...",
      "invoiceNumber": "INV-2024-0042",
      "status":        "SENT",
      "issueDate":     "2024-03-01T00:00:00.000Z",
      "dueDate":       "2024-03-31T00:00:00.000Z",
      "subtotal":      1200.00,
      "taxAmount":     240.00,
      "total":         1440.00,
      "paidAmount":    0.00,
      "paidAt":        null,
      "currency":      "EUR",
      "client": {
        "id":        "cuid...",
        "firstName": "Jean",
        "lastName":  "Dupont",
        "email":     "jean.dupont@email.com"
      }
    }
  ],
  "total": 12,
  "page":  1,
  "limit": 50
}
GET/api/v1/products

Liste les produits et services actifs de votre catalogue.

Paramètres :

pageintegerPage (défaut : 1)
limitintegerRésultats par page, max 100

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  "https://www.nexoramg.com/api/v1/products"

Réponse :

{
  "object": "list",
  "data": [
    {
      "id":          "cuid...",
      "name":        "Consultation stratégique",
      "sku":         "CONS-001",
      "category":    "Services",
      "description": "Session de conseil 1h",
      "unitPrice":   150.00,
      "stock":       null,
      "minStock":    null,
      "isService":   true,
      "currency":    "EUR",
      "createdAt":   "2024-01-10T08:00:00.000Z"
    }
  ],
  "total": 34,
  "page":  1,
  "limit": 50
}
GET/api/v1/orders

Liste les commandes de votre entreprise, avec filtre optionnel par statut.

Paramètres :

pageintegerPage (défaut : 1)
limitintegerRésultats par page, max 100
statusstringPENDING | CONFIRMED | SHIPPED | DELIVERED | CANCELLED

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  "https://www.nexoramg.com/api/v1/orders?status=CONFIRMED"

Réponse :

{
  "object": "list",
  "data": [
    {
      "id":          "cuid...",
      "orderNumber": "ORD-2024-0018",
      "status":      "CONFIRMED",
      "createdAt":   "2024-03-05T14:22:00.000Z",
      "subtotal":    800.00,
      "taxAmount":   160.00,
      "total":       960.00,
      "currency":    "EUR",
      "notes":       null,
      "client": {
        "id":        "cuid...",
        "firstName": "Jean",
        "lastName":  "Dupont",
        "email":     "jean.dupont@email.com"
      },
      "items": [
        { "name": "Laptop Pro", "quantity": 2, "unitPrice": 400.00, "total": 800.00 }
      ]
    }
  ],
  "total": 7,
  "page":  1,
  "limit": 50
}
GET/api/v1/finance

Liste les entrées financières (revenus et dépenses), avec filtres par type et plage de dates.

Paramètres :

pageintegerPage (défaut : 1)
limitintegerRésultats par page, max 100
typestringINCOME | EXPENSE
fromstringDate de début ISO 8601 (ex: 2024-01-01)
tostringDate de fin ISO 8601 (ex: 2024-12-31)

Exemple :

curl -H "X-API-Key: nxr_votre_cle" \
  "https://www.nexoramg.com/api/v1/finance?type=INCOME&from=2024-01-01&to=2024-12-31"

Réponse :

{
  "object": "list",
  "data": [
    {
      "id":          "cuid...",
      "type":        "INCOME",
      "amount":      2500.00,
      "description": "Prestation client Acme Corp",
      "category":    "Ventes",
      "date":        "2024-03-10T00:00:00.000Z",
      "reference":   "FAC-2024-0042",
      "currency":    "EUR"
    }
  ],
  "total": 48,
  "page":  1,
  "limit": 50
}

Exemples d'intégration

JavaScript (fetch)

const API_KEY = 'nxr_votre_cle'
const BASE    = 'https://www.nexoramg.com/api/v1'

async function getInvoices(status = 'SENT') {
  const res  = await fetch(`${BASE}/invoices?status=${status}`, {
    headers: { 'X-API-Key': API_KEY },
  })
  if (!res.ok) throw new Error(`HTTP ${res.status}`)
  return res.json()
}

const { data, total } = await getInvoices('PAID')
console.log(`${total} factures payées`, data)

Python (requests)

import requests

API_KEY = "nxr_votre_cle"
BASE    = "https://www.nexoramg.com/api/v1"
HEADERS = {"X-API-Key": API_KEY}

def get_invoices(status=None, limit=100):
    params = {"limit": limit}
    if status:
        params["status"] = status
    r = requests.get(f"{BASE}/invoices", headers=HEADERS, params=params)
    r.raise_for_status()
    return r.json()

result = get_invoices(status="PAID")
print(f"{result['total']} factures payées")

PHP (cURL)

<?php
$api_key = 'nxr_votre_cle';
$base    = 'https://www.nexoramg.com/api/v1';

function nexora_get($path, $params = []) {
    global $api_key, $base;
    $url = $base . $path . '?' . http_build_query($params);
    $ch  = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: $api_key"]);
    $res = curl_exec($ch);
    curl_close($ch);
    return json_decode($res, true);
}

$invoices = nexora_get('/invoices', ['status' => 'PAID', 'limit' => 50]);
echo $invoices['total'] . ' factures payées';
Nexora Management API v1 — Documentation générée automatiquement