{
  "openapi": "3.1.0",
  "info": {
    "title": "Terudo Partner API",
    "version": "1",
    "description": "Travel eSIMs for partners: catalogue, trip quotes, orders, eSIMs, webhooks, statements. Documentation: https://terudo.com/developers/api/",
    "contact": {
      "email": "contact@terudo.com"
    }
  },
  "servers": [
    {
      "url": "https://terudo.com/api/partner/v1"
    }
  ],
  "security": [
    {
      "secretKey": []
    }
  ],
  "components": {
    "securitySchemes": {
      "secretKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "sk_live_… or sk_test_…"
      },
      "publishableKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "pk_live_… or pk_test_…, public routes only"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Your account",
        "description": "The key’s account, its mode, whether the member rate is on, and the prepaid credit left for net orders.",
        "tags": [
          "Account"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"account\", \"id\": 12, \"name\": \"SimpleVisa\", \"mode\": \"live\", \"member_rate\": false, \"payments_open\": true, \"credit_cents\": 48200, \"currency\": \"EUR\" }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/destinations": {
      "get": {
        "operationId": "getDestinations",
        "summary": "Destinations",
        "description": "The destinations of the catalogue, with their fixed plan ids and whether daily plans exist.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"list\", \"data\": [ { \"code\": \"MA\", \"name\": \"Maroc\", \"name_en\": \"Morocco\", \"fixed_plans\": [\"MA-3\", \"MA-10\"], \"daily_plans\": true }, … ] }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/plans": {
      "get": {
        "operationId": "getPlans",
        "summary": "Plans",
        "description": "Plans at your rate: recommended public price, default client price, net price and commission. With destination and days, daily plans of that length are added.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "destination",
            "in": "query",
            "required": false,
            "description": "ISO code (MA) or region (EU-35). Omitted: the whole grid.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Length of the daily plans to add.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"list\", \"data\": [ { \"id\": \"MA-10\", \"object\": \"plan\", \"kind\": \"fixed\", \"destination\": \"MA\", \"name\": \"Maroc\", \"gb\": 10, \"days\": 30, \"public_price_cents\": 2999, \"client_price_cents\": 2849, \"net_cents\": 1780, \"commission_cents\": 594 }, { \"id\": \"MA-DAY2-7D\", \"kind\": \"daily\", \"gb\": 2, \"days\": 7, \"speed_after_quota\": \"1 Mbit/s\", … } ] }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/plans/{id}": {
      "get": {
        "operationId": "getPlansId",
        "summary": "One plan",
        "description": "One plan by id, fixed or daily.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quotes": {
      "post": {
        "operationId": "postQuotes",
        "summary": "Quote for a trip",
        "description": "Give the destination and dates: the answer lists the plans that cover the stay and recommends one, the cheapest that covers it all, with a buffer day for a late flight. Nothing is created.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"quote\", \"trip_days\": 7, \"covered_days\": 8, \"needed_gb\": 7,\n  \"options\": [\n    { \"id\": \"MA-DAY1-8D\", \"kind\": \"daily\", \"gb\": 1, \"days\": 8, \"public_price_cents\": 2099, \"net_cents\": 1246, \"covers_trip\": true, \"recommended\": true, \"reason\": \"1 Go par jour pendant 8 jours, puis débit réduit\" },\n    { \"id\": \"MA-10\", \"kind\": \"fixed\", \"gb\": 10, \"days\": 30, \"public_price_cents\": 2999, \"covers_trip\": true, \"recommended\": false, \"reason\": \"10 Go sur 30 jours, couvre 7 Go estimés\" },\n    …\n  ] }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "destination": {
                    "description": "string — Destination code."
                  },
                  "start_date": {
                    "description": "date — Arrival, YYYY-MM-DD."
                  },
                  "end_date": {
                    "description": "date — Departure, YYYY-MM-DD. 60 days at most."
                  },
                  "profile": {
                    "description": "light | normal | heavy — Estimated use: 0.5, 1 or 2 GB a day. Default normal."
                  },
                  "buffer_days": {
                    "description": "integer 0–3 — Days added to the covered length. Default 1."
                  }
                },
                "required": [
                  "destination",
                  "start_date",
                  "end_date"
                ]
              },
              "example": "{ \"destination\": \"MA\", \"start_date\": \"2026-12-03\", \"end_date\": \"2026-12-09\", \"profile\": \"normal\" }"
            }
          }
        }
      }
    },
    "/coverage/{destination}": {
      "get": {
        "operationId": "getCoverageDestination",
        "summary": "Does the traveller’s plan already cover it?",
        "description": "Which main French mobile plans already include the destination, from our verified records. With brand and plan, checks one plan. To tell the client the truth before selling.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [
          {
            "name": "destination",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "description": "The traveller’s plan brand (Free, Sosh, …).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "plan",
            "in": "query",
            "required": false,
            "description": "Plan name.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"coverage\", \"destination\": \"MA\", \"french_plans_including\": [], \"checked_plan\": null, \"advice\": \"Aucun forfait français principal n'inclut cette destination : une eSIM est le bon réflexe.\" }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/compatibility": {
      "get": {
        "operationId": "getCompatibility",
        "summary": "Does the phone take an eSIM?",
        "description": "From the model as the traveller gives it: yes, depends (some versions only, the note says which), no or unknown (model not in our list, the note describes the brand’s range). The two checks to do on the phone always come along: *#06# for the EID, phone not carrier-locked.",
        "tags": [
          "Catalogue"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [
          {
            "name": "device",
            "in": "query",
            "required": true,
            "description": "Model: iPhone 13 mini, Galaxy S23, Pixel 7a…",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"object\": \"compatibility\", \"device\": \"iPhone 13 mini\", \"brand\": \"Apple\", \"compatible\": \"yes\", \"note\": \"Sauf modèle acheté en Chine continentale…\", \"checks\": [\"Composer *#06# : si un numéro EID s'affiche, le téléphone prend une eSIM.\", \"Le téléphone doit être désimlocké…\"] }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders": {
      "post": {
        "operationId": "postOrders",
        "summary": "Create an order",
        "description": "Creates the order. In commission mode, returns a checkout_url to show the client (or notify_client to have us mail the link). In net mode, debits the credit and starts delivery, now or at deliver_at.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{\n  \"id\": \"6b1f…\",\n  \"object\": \"order\",\n  \"reference\": \"visa-48213\",\n  \"mode\": \"live\",\n  \"kind\": \"commission\",\n  \"status\": \"pending\",\n  \"plan\": { \"id\": \"MA-DAY2-8D\", \"kind\": \"daily\", \"destination\": \"MA\", \"name\": \"Maroc\", \"gb\": 2, \"days\": 8 },\n  \"client\": { \"email\": \"marie@example.com\", \"locale\": \"fr\" },\n  \"trip\": { \"start_date\": \"2026-12-03\", \"end_date\": \"2026-12-09\" },\n  \"price_cents\": 2944, \"currency\": \"EUR\", \"discount_percent\": 5,\n  \"net_cents\": 1840, \"commission_cents\": 613,\n  \"checkout_url\": \"https://terudo.com/pay/…/\",\n  \"return_url\": \"https://partner.example/trips/48213\",\n  \"deliver_at\": null, \"auto_topup_max\": 0,\n  \"metadata\": { \"trip_id\": \"48213\" },\n  \"created_at\": \"2026-11-08T10:12:00Z\", \"paid_at\": null, \"esim\": null\n}"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "description": "string — Plan id, fixed or daily."
                  },
                  "kind": {
                    "description": "commission | net — Default commission."
                  },
                  "client.email": {
                    "description": "string — The traveller. The eSIM goes to this address."
                  },
                  "client.locale": {
                    "description": "fr | en — Language of the emails and the pay page."
                  },
                  "reference": {
                    "description": "string ≤ 120 — Your id (file, booking). Unique per account, idempotency key: the same reference returns the same order (200). An Idempotency-Key header stands in for it when the body has none."
                  },
                  "trip.start_date, trip.end_date": {
                    "description": "date — Trip dates. Refused if the plan is too short. Drives reminders."
                  },
                  "discount_percent": {
                    "description": "integer 0–15 — Commission only. Client discount taken from your commission. Default 5."
                  },
                  "return_url": {
                    "description": "https URL — Where the pay page sends the client once paid."
                  },
                  "notify_client": {
                    "description": "boolean — Commission: we email the payment link. Default false."
                  },
                  "deliver_at": {
                    "description": "datetime ISO 8601 — Deferred delivery, 90 days at most. Or days_before_trip (integer) with trip. A daily plan must be installed within 30 days: sold more than 25 days before the trip, it is delivered 7 days before departure unless told otherwise."
                  },
                  "auto_topup_max": {
                    "description": "integer 0–10 — Net only: dynamic plan. When data runs low, the same plan is added from your credit, at most this many times."
                  },
                  "metadata": {
                    "description": "object ≤ 20 clés — Your data, returned as is."
                  }
                },
                "required": [
                  "plan",
                  "client.email"
                ]
              },
              "example": "{ \"plan\": \"MA-DAY2-8D\", \"kind\": \"commission\", \"reference\": \"visa-48213\",\n  \"client\": { \"email\": \"marie@example.com\", \"locale\": \"fr\" },\n  \"trip\": { \"start_date\": \"2026-12-03\", \"end_date\": \"2026-12-09\" },\n  \"return_url\": \"https://partner.example/trips/48213\", \"metadata\": { \"trip_id\": \"48213\" } }"
            }
          }
        }
      },
      "get": {
        "operationId": "getOrders",
        "summary": "List",
        "description": "Your orders, newest first, 50 a page (starting_after = last id). Filters: reference, status, email.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "operationId": "getOrdersId",
        "summary": "One order",
        "description": "By Terudo id or by your reference. Statuses: pending, paid, ordered, delivered, failed, refunded, cancelled, expired. The esim object appears once delivered.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{id}/cancel": {
      "post": {
        "operationId": "postOrdersIdCancel",
        "summary": "Cancel",
        "description": "An unpaid link is cancelled. A paid order is refunded while the eSIM was never installed: to your credit in net mode, to the client’s card in commission mode.",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "description": "string — Reason, kept in the log."
                  }
                },
                "required": []
              }
            }
          }
        }
      }
    },
    "/orders/{id}/remind": {
      "post": {
        "operationId": "postOrdersIdRemind",
        "summary": "Remind the client",
        "description": "Mails the payment link again (commission, two reminders at most, 24 h apart).",
        "tags": [
          "Orders"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/esims/{id}": {
      "get": {
        "operationId": "getEsimsId",
        "summary": "One eSIM",
        "description": "Status, installation, usage, activation code, iOS and Android install links, QR code.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{\n  \"id\": \"k8Zs…\",            // esim id, also the token of the client's page\n  \"object\": \"esim\",\n  \"status\": \"active\", \"profile_status\": \"enabled\",\n  \"installed_at\": \"2026-12-02T18:04:11Z\", \"expires_at\": \"2026-12-11T00:00:00Z\",\n  \"used_bytes\": 1431655765, \"total_bytes\": 17179869184,\n  \"iccid\": \"8944…\", \"activation_code\": \"LPA:1$…$…\", \"smdp_address\": \"…\", \"matching_id\": \"…\",\n  \"ios_install_url\": \"https://esimsetup.apple.com/…\", \"android_install_url\": \"https://esimsetup.android.com/…\",\n  \"page_url\": \"https://terudo.com/esim/k8Zs…/\", \"qr_url\": \"https://terudo.com/api/esims/k8Zs…/qr/\",\n  \"topups\": 0\n}"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/esims/{id}/usage": {
      "get": {
        "operationId": "getEsimsIdUsage",
        "summary": "Usage",
        "description": "Used and total data, refreshed from the supplier at most every 10 minutes.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/esims/{id}/topups": {
      "get": {
        "operationId": "getEsimsIdTopups",
        "summary": "Available top-ups",
        "description": "The same plan again and, for a daily plan, extra days (1, 3, 7), on the same eSIM when the supplier allows it.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postEsimsIdTopups",
        "summary": "Top up",
        "description": "Net: the top-up is taken from the credit and added to the eSIM. Commission: a payment link opens for the client and comes back as a new order.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "description": "string — A plan of the same destination. Default: the eSIM’s."
                  }
                },
                "required": []
              }
            }
          }
        }
      }
    },
    "/esims/{id}/resend": {
      "post": {
        "operationId": "postEsimsIdResend",
        "summary": "Resend the instructions",
        "description": "Mails the install e-mail (QR code, install link) again to the traveller’s address on the order: lost e-mail, new phone. Delivered eSIMs only, three times a day at most.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/esims/{id}/suspend": {
      "post": {
        "operationId": "postEsimsIdSuspend",
        "summary": "Suspend",
        "description": "Cuts the data of an eSIM bought at the net price (traveller gone, lost device). Nothing is refunded, the plan keeps running.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/esims/{id}/resume": {
      "post": {
        "operationId": "postEsimsIdResume",
        "summary": "Resume",
        "description": "Restores the data.",
        "tags": [
          "eSIMs"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "getWebhooks",
        "summary": "List",
        "description": "Your endpoints in the key’s mode, and the list of events.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "postWebhooks",
        "summary": "Create",
        "description": "public https url (port 443) and events (empty: all). The secret is returned.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "example": "{ \"id\": 3, \"object\": \"webhook_endpoint\", \"url\": \"https://partner.example/hooks/terudo\", \"mode\": \"live\", \"events\": [ … ], \"secret\": \"whsec_…\" }"
              }
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              },
              "example": "{ \"url\": \"https://partner.example/hooks/terudo\", \"events\": [\"order.paid\", \"order.delivered\", \"esim.installed\", \"esim.low_data\"] }"
            }
          }
        }
      }
    },
    "/webhooks/{id}": {
      "patch": {
        "operationId": "patchWebhooksId",
        "summary": "Update",
        "description": "url, events, enabled.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhooksId",
        "summary": "Delete",
        "description": "",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/test": {
      "post": {
        "operationId": "postWebhooksIdTest",
        "summary": "Send a test",
        "description": "A signed test event, right away.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "getWebhooksIdDeliveries",
        "summary": "Deliveries",
        "description": "The last 100 deliveries, with their state and your server’s answer.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/{id}/deliveries/{delivery_id}/resend": {
      "post": {
        "operationId": "postWebhooksIdDeliveriesDelivery_idResend",
        "summary": "Resend",
        "description": "",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/statements": {
      "get": {
        "operationId": "getStatements",
        "summary": "By month",
        "description": "Sales, commissions due and net purchases per month, with the payout once made.",
        "tags": [
          "Statements"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/statements/{month}": {
      "get": {
        "operationId": "getStatementsMonth",
        "summary": "One month",
        "description": "The paid sales of the month (YYYY-MM).",
        "tags": [
          "Statements"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/element_sessions": {
      "post": {
        "operationId": "postElement_sessions",
        "summary": "Session for a page",
        "description": "Returns client_token, valid 2 hours, to pass to the Elements (session option).",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "secretKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "discount_percent": {
                    "description": "integer 0–15 — Client discount on this page."
                  },
                  "client_email, reference, return_url, locale, metadata": {
                    "description": " — As for an order."
                  },
                  "trip": {
                    "description": "object — destination, start_date, end_date, profile."
                  }
                },
                "required": []
              }
            }
          }
        }
      }
    },
    "/public/destinations": {
      "get": {
        "operationId": "getPublicDestinations",
        "summary": "Destinations",
        "description": "",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/plans": {
      "get": {
        "operationId": "getPublicPlans",
        "summary": "Plans at the public price",
        "description": "?destination, ?days, ?session.",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/public/quotes": {
      "post": {
        "operationId": "postPublicQuotes",
        "summary": "Quote",
        "description": "As /quotes, at the public price.",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/public/checkout": {
      "post": {
        "operationId": "postPublicCheckout",
        "summary": "Hosted checkout",
        "description": "Creates a commission order and returns checkout_url. 30 an hour per IP address.",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan": {
                    "description": "string — "
                  },
                  "email": {
                    "description": "string — Unless the session carries it."
                  },
                  "return_url, locale, trip, session": {
                    "description": " — return_url is kept only when its origin is among the sites listed on the publishable key, or when it comes from the signed session. A key with no site list takes no return address from the page."
                  }
                },
                "required": [
                  "plan",
                  "email"
                ]
              }
            }
          }
        }
      }
    },
    "/public/esims/{id}": {
      "get": {
        "operationId": "getPublicEsimsId",
        "summary": "eSIM page",
        "description": "The “My eSIM” page data, without the activation code.",
        "tags": [
          "Elements: the publishable key"
        ],
        "security": [
          {
            "publishableKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {}
            }
          },
          "default": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "x-webhook-events": [
    "order.paid",
    "order.delivered",
    "order.failed",
    "order.refunded",
    "order.cancelled",
    "esim.installed",
    "esim.low_data",
    "esim.used_up",
    "esim.expiring",
    "esim.expired",
    "esim.deleted",
    "esim.suspended",
    "esim.resumed",
    "topup.delivered"
  ]
}