Mellio Agences / OpenAPI 3.1.0 · v1.1.0

Référence Interactive OpenAPI 3.1

Architecture Zero-Trust : les clés secrètes (sk_live_...) s'utilisent exclusivement côté serveur (cURL, Node.js, Ruby, Python) et sont bloquées si un en-tête navigateur Origin est présent.
GET /ping
Health
Vérifier l'authentification et les permissions de la clé API
curl -X GET "https://www.mellio-agences.fr/api/v1/ping" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
GET /bot_challenge
Onboarding DIY
Générer un challenge anti-robot ALTCHA (Proof-of-Work auto-hébergé)

Retourne un challenge signé (`algorithm`, `challenge`, `maxnumber`, `salt`, `signature`) lorsque `ALTCHA_API_ENABLED` (ou `ALTCHA_ENABLED`) est activé. Le jeton Base64 résolu doit être transmis dans `X-Captcha-Token` ou `X-Altcha-Payload`.

curl -X GET "https://www.mellio-agences.fr/api/v1/bot_challenge" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
GET /merchants
Merchants
Lister les établissements rattachés à l'agence avec statistiques et soldes crédits

Requiert le scope `merchants:read` ou `merchants:write`. Respecte l'éventuelle restriction par commerces configurée sur la clé.

Paramètre In Requis Description
page query non
per_page query non
active query non
sandbox query non
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants
Merchants
Créer et activer un nouvel établissement
Paramètre In Requis Description
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}
Merchants
Lire le détail, statistiques, crédits et règles fidélité d'un établissement
Paramètre In Requis Description
MerchantUuid path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/handoff_tokens
Merchants
Générer des jetons d'accès scanner PWA et flyer comptoir

Requiert le scope `merchants:write` (clé secrète uniquement).

Paramètre In Requis Description
MerchantUuid path oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/handoff_tokens" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}/customers
Customers
Lister et segmenter les porteurs de cartes avec statut RGPD

Requiert `customers:read` (ou `customers:write` / `transactions:write`). Exclut les fiches anonymisées par défaut.

Paramètre In Requis Description
MerchantUuid path oui
page query non
per_page query non
q query non
inactive_days query non
min_points query non
min_stamps query non
birthday_month query non
opt_in_sms query non
opt_in_email query non
include_anonymized query non
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/customers" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/customers
Customers
Enrôler ou mettre à jour un client et générer son pass Wallet
Paramètre In Requis Description
MerchantUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/customers" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
POST /merchants/{merchant_uuid}/customers/lookup
Customers
Identifier un client via QR Wallet, carte PVC, téléphone ou e-mail
Paramètre In Requis Description
MerchantUuid path oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/customers/lookup" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}/customers/{customer_uuid}
Customers
Lire la fiche d'un client et ses 10 dernières transactions
Paramètre In Requis Description
MerchantUuid path oui
CustomerUuid path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/customers/CUSTOMER_UUID" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/customers/{customer_uuid}/transactions
Loyalty & POS
Créditer/débiter des points ou tampons, ou valider une récompense pour un client donné

Requiert `transactions:write` et l'en-tête obligatoire `Idempotency-Key`. Opérations supportées : `earn`, `debit_loyalty`, `redeem_reward`, `gift_card_credit`, `gift_card_debit`, `prepaid_credit`, `prepaid_debit`.

Paramètre In Requis Description
MerchantUuid path oui
CustomerUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/customers/CUSTOMER_UUID/transactions" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}/transactions
Loyalty & POS
Lister les transactions d'un établissement
Paramètre In Requis Description
MerchantUuid path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/transactions" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/transactions
Loyalty & POS
Enregistrer une transaction POS (par code scanné, téléphone, e-mail ou customer_uuid)
Paramètre In Requis Description
MerchantUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/transactions" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
POST /merchants/{merchant_uuid}/transactions/{id}/refund
Loyalty & POS
Annuler / rembourser une transaction
Paramètre In Requis Description
MerchantUuid path oui
id path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/transactions/TRANSACTION_ID/refund" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}/campaigns
Campaigns
Lister les campagnes et offres à durée limitée d'un établissement
Paramètre In Requis Description
MerchantUuid path oui
status query non
include_scheduled query non
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/campaigns" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/campaigns
Campaigns
Préparer une campagne en mode brouillon (`pending_approval` obligatoire)

Requiert le scope `campaigns:draft` et `Idempotency-Key`. **Tout envoi direct est interdit** : la campagne est créée exclusivement au statut `pending_approval`, calcule l'audience opt-in exacte et le coût estimé en crédits, et notifie l'administrateur pour validation humaine.

Paramètre In Requis Description
MerchantUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/campaigns" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
GET /merchants/{merchant_uuid}/campaigns/{uuid}
Campaigns
Consulter le détail d'une campagne
Paramètre In Requis Description
MerchantUuid path oui
CampaignUuid path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/campaigns/RESOURCE_UUID" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /merchants/{merchant_uuid}/campaigns/{uuid}/approve
Campaigns
Approuver et déclencher une campagne en attente (`campaigns:approve`)

Requiert le scope `campaigns:approve` (jamais activé par défaut) et `Idempotency-Key`. Applique la règle des 4 yeux : une clé API ne peut jamais approuver un brouillon qu'elle a elle-même créé (`403 self_approval_forbidden`).

Paramètre In Requis Description
MerchantUuid path oui
CampaignUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/campaigns/RESOURCE_UUID/approve" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
POST /merchants/{merchant_uuid}/campaigns/{uuid}/reject
Campaigns
Rejeter une campagne en attente (`campaigns:approve`)
Paramètre In Requis Description
MerchantUuid path oui
CampaignUuid path oui
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/merchants/MERCHANT_UUID/campaigns/RESOURCE_UUID/reject" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
GET /webhooks
Webhooks
Lister les endpoints webhooks sortants de l'agence (`webhooks:manage`)
curl -X GET "https://www.mellio-agences.fr/api/v1/webhooks" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /webhooks
Webhooks
Créer un endpoint webhook HTTPS (`webhooks:manage`)
Paramètre In Requis Description
IdempotencyKey header oui
curl -X POST "https://www.mellio-agences.fr/api/v1/webhooks" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json"
PATCH /webhooks/{uuid}
Webhooks
Mettre à jour un endpoint webhook
Paramètre In Requis Description
WebhookUuid path oui
curl -X PATCH "https://www.mellio-agences.fr/api/v1/webhooks/RESOURCE_UUID" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
DELETE /webhooks/{uuid}
Webhooks
Supprimer un endpoint webhook
Paramètre In Requis Description
WebhookUuid path oui
curl -X DELETE "https://www.mellio-agences.fr/api/v1/webhooks/RESOURCE_UUID" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /webhooks/{uuid}/ping
Webhooks
Envoyer un événement test `webhook.ping`
Paramètre In Requis Description
WebhookUuid path oui
curl -X POST "https://www.mellio-agences.fr/api/v1/webhooks/RESOURCE_UUID/ping" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
GET /webhooks/{uuid}/deliveries
Webhooks
Inspecter l'historique des livraisons d'un webhook
Paramètre In Requis Description
WebhookUuid path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/webhooks/RESOURCE_UUID/deliveries" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
GET /catalog/themes
Onboarding DIY
Lister les thèmes Wallet par secteur d'activité
curl -X GET "https://www.mellio-agences.fr/api/v1/catalog/themes" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
POST /onboarding/drafts
Onboarding DIY
Créer un brouillon d'aperçu Wallet
curl -X POST "https://www.mellio-agences.fr/api/v1/onboarding/drafts" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
GET /onboarding/drafts/{token}
Onboarding DIY
Lire l'état d'un brouillon d'aperçu Wallet (et savoir si la carte a été installée)
Paramètre In Requis Description
token path oui
curl -X GET "https://www.mellio-agences.fr/api/v1/onboarding/drafts/DRAFT_TOKEN" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Accept: application/json"
PATCH /onboarding/drafts/{token}
Onboarding DIY
Mettre à jour le visuel, le cadrage ou la récompense d'un brouillon existant
Paramètre In Requis Description
token path oui
curl -X PATCH "https://www.mellio-agences.fr/api/v1/onboarding/drafts/DRAFT_TOKEN" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
POST /onboarding/email_verifications
Onboarding DIY
Envoyer un code OTP de vérification d'e-mail avant finalisation d'inscription
curl -X POST "https://www.mellio-agences.fr/api/v1/onboarding/email_verifications" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"
POST /onboarding/email_verifications/verify
Onboarding DIY
Vérifier le code OTP d'e-mail
curl -X POST "https://www.mellio-agences.fr/api/v1/onboarding/email_verifications/verify" \
-H "Authorization: Bearer sk_live_xxx" \
-H "Content-Type: application/json"

Webhooks Sortants (X-Mellio-Signature)

card.installed

Carte ajoutée dans Apple Wallet ou Google Wallet

card.uninstalled

Carte supprimée d'Apple Wallet

loyalty.transaction_created

Transaction fidélité enregistrée (caisse ou API)

reward.unlocked

Palier de récompense débloqué par le client

reward.redeemed

Récompense consommée en caisse ou via API

campaign.pending_approval

Nouvelle campagne préparée par API en attente de validation humaine

campaign.approved

Campagne validée par un responsable

campaign.rejected

Campagne rejetée

campaign.sent

Campagne envoyée avec métriques finales

campaign.failed

Échec d'envoi d'une campagne approuvée

customer.created

Nouveau porteur de carte inscrit

customer.unsubscribed

Client désabonné d'un canal marketing (SMS, Email, WhatsApp)

customer.anonymized

Client anonymisé RGPD (payload strictement sans PII)

webhook.ping

Événement de test déclenché manuellement depuis le portail ou l'API Webhooks

Schémas de données

ErrorResponse
{
  "type": "object",
  "required": [
    "error"
  ],
  "properties": {
    "error": {
      "type": "object",
      "required": [
        "code",
        "message"
      ],
      "properties": {
        "code": {
          "type": "string",
          "example": "insufficient_scope"
        },
        "message": {
          "type": "string",
          "example": "This API key does not have the required scope."
        }
      }
    }
  }
}
Pagination
{
  "type": "object",
  "properties": {
    "page": {
      "type": "integer",
      "example": 1
    },
    "per_page": {
      "type": "integer",
      "example": 50
    },
    "total_count": {
      "type": "integer",
      "example": 128
    },
    "total_pages": {
      "type": "integer",
      "example": 3
    }
  }
}
MerchantSummary
{
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": "string"
    },
    "active": {
      "type": "boolean"
    },
    "sandbox": {
      "type": "boolean"
    },
    "currency": {
      "type": "string",
      "example": "EUR"
    },
    "country_code": {
      "type": "string",
      "example": "FR"
    },
    "locale": {
      "type": "string",
      "example": "fr"
    },
    "loyalty_mode": {
      "type": "string",
      "enum": [
        "points",
        "tampons"
      ]
    },
    "active_card_types": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "stats": {
      "type": "object",
      "properties": {
        "customers_count": {
          "type": "integer"
        },
        "active_cards_count": {
          "type": "integer"
        },
        "wallet_installed_count": {
          "type": "integer"
        },
        "transactions_total_count": {
          "type": "integer"
        },
        "visits_last_30_days_count": {
          "type": "integer"
        }
      }
    },
    "credits": {
      "type": "object",
      "properties": {
        "sms_balance_micros": {
          "type": "integer",
          "format": "int64",
          "description": "1 EUR = 1_000_000 micros"
        },
        "sms_balance_eur": {
          "type": "number"
        },
        "sms_unlimited": {
          "type": "boolean"
        },
        "email_credits": {
          "type": "integer"
        },
        "email_unlimited": {
          "type": "boolean"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
CustomerPayload
{
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_name": {
      "type": [
        "string",
        "null"
      ]
    },
    "phone": {
      "type": [
        "string",
        "null"
      ]
    },
    "email": {
      "type": [
        "string",
        "null"
      ]
    },
    "birthdate": {
      "type": [
        "string",
        "null"
      ],
      "format": "date"
    },
    "rgpd_marketing_opt_in": {
      "type": "boolean"
    },
    "gdpr": {
      "type": "object",
      "properties": {
        "consent": {
          "type": "boolean"
        },
        "consented_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "marketing_opt_in": {
          "type": "boolean"
        },
        "sms_opt_in": {
          "type": "boolean"
        },
        "email_opt_in": {
          "type": "boolean"
        },
        "whatsapp_opt_in": {
          "type": "boolean"
        },
        "geoloc_opt_in": {
          "type": "boolean"
        },
        "anonymized": {
          "type": "boolean"
        }
      }
    },
    "pass": {
      "type": "object",
      "properties": {
        "serial_number": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "actif",
            "recompense_prete"
          ]
        },
        "reward_ready": {
          "type": "boolean"
        },
        "loyalty_mode": {
          "type": "string",
          "enum": [
            "points",
            "tampons"
          ]
        },
        "points_balance": {
          "type": "integer"
        },
        "stamps_balance": {
          "type": "integer"
        },
        "gift_card_balance_cents": {
          "type": "integer"
        },
        "prepaid_balance_cents": {
          "type": "integer"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "last_activity_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
CampaignPayload
{
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "id": {
      "type": "integer"
    },
    "merchant_uuid": {
      "type": "string",
      "format": "uuid"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending_approval",
        "rejected",
        "expired",
        "queued",
        "processing",
        "completed",
        "failed",
        "skipped"
      ]
    },
    "source": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "message",
        "offer"
      ]
    },
    "title": {
      "type": [
        "string",
        "null"
      ]
    },
    "content": {
      "type": "string"
    },
    "channels": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "push",
          "sms",
          "email",
          "whatsapp"
        ]
      }
    },
    "audience": {
      "type": "object",
      "properties": {
        "total_matched": {
          "type": "integer"
        },
        "eligible_by_channel": {
          "type": "object",
          "properties": {
            "push": {
              "type": "integer"
            },
            "sms": {
              "type": "integer"
            },
            "email": {
              "type": "integer"
            },
            "whatsapp": {
              "type": "integer"
            }
          }
        },
        "push_capped": {
          "type": "integer"
        }
      }
    },
    "cost_estimate": {
      "type": "object",
      "properties": {
        "sms_estimated_micros": {
          "type": "integer",
          "format": "int64"
        },
        "sms_estimated_eur": {
          "type": "number"
        },
        "sms_segments_per_recipient": {
          "type": "integer"
        },
        "email_credits_required": {
          "type": "integer"
        },
        "sufficient_credits": {
          "type": "boolean"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "approval": {
      "type": "object",
      "properties": {
        "required": {
          "type": "boolean"
        },
        "review_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        },
        "approval_expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "approved_by_type": {
          "type": [
            "string",
            "null"
          ]
        },
        "approved_by_label": {
          "type": [
            "string",
            "null"
          ]
        },
        "approved_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejected_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "rejection_reason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
WebhookEndpointPayload
{
  "type": "object",
  "properties": {
    "uuid": {
      "type": "string",
      "format": "uuid"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "active": {
      "type": "boolean"
    },
    "subscribed_events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "consecutive_failures_count": {
      "type": "integer"
    },
    "disabled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "disabled_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_success_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_failure_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  }
}