# Myle API > The Myle API (https://api.myleapp.fr) gives programs access to the data of Myle, a farm and business management app: an organization's catalog, customers and more. JSON over HTTPS, bearer API keys, one typed error per code, cursor pagination, idempotent writes, optimistic concurrency. ## Essentials - Base URL: `https://api.myleapp.fr`. No version in paths. Organization data lives under `/organizations/{id}/…`, the caller's own under `/me`. - Authentication: `Authorization: Bearer `. An organization key acts as its own robot account with the rights configured on it; a user key acts as its owner. Keys are opaque strings: never parse them. Each operation requires a Myle right (`ARTICLES_LIST`…): missing it answers `403 auth.right.missing`. - JSON: camelCase members; ids are opaque strings `_` (`product_…`); every resource has `object` (its entity name); money is `{"amount": "1250.00", "currency": "EUR"}` (a decimal string); dates `YYYY-MM-DD`, instants RFC 3339 UTC; an empty optional member is `null`, never absent. Enums are open: tolerate unknown values. Ignore unknown members. - Errors: every 4xx/5xx answers `{code, context, error, request_id}`. Branch on `code` (`..`, stable, one HTTP status per code); read `context` with that code's shape; show `error` to a person (French or English from `Accept-Language`), never parse it; quote `request_id` (also the `Myle-Request-Id` header) to support. - Lists answer `{data, nextCursor}`: pass `nextCursor` as `?cursor=` for the next page, until it is absent. `?limit=` (50 by default, 200 at most). Filters are named after the field; repeat a parameter for several values. - Idempotency: a `POST` that accepts `Idempotency-Key` (a unique string, kept 24 h) replays the first answer for the same key and body (`Myle-Idempotent-Replayed: true`); another body with the same key answers `422 core.idempotency-key-reused`; a request still running with it answers `409 core.idempotency-key-in-use` with `Retry-After`. Send one on every create, and reuse it when you retry. - Concurrency: every single resource answers an `ETag`. Send it back as `If-Match` on `PATCH` / `DELETE`: if the resource changed since, `412 core.precondition-failed` and nothing is written. `PATCH` takes `application/merge-patch+json`: an absent member is unchanged, `null` clears it. - Rate limits per key: `read` 600/min, `write` 120/min, `export` 20/min; `RateLimit-Policy` and `RateLimit` headers on every answer; `429 core.rate-limited` with `Retry-After` when exceeded. - Versioning: send `Myle-API-Version: YYYY-MM-DD`, the date your code was written against (`2026-11-21` for this document); absent means the latest behavior. Changes are additive; a breaking change applies only to later dates, and an older behavior is answered with `Deprecation`, `Sunset` and `Link: <…/changelog/YYYY-MM-DD>; rel="deprecation"`. - Identify your program with `Myle-Client: /`. ## SDKs Not published yet: the SDKs, the CLI and the MCP server are written and tested, but none is on its registry, so there is nothing to install today. Do not suggest an install command. Call the API over HTTP from any language, or generate a client from the OpenAPI document (https://api.myleapp.fr/openapi.json). Status and planned names: https://developers.myleapp.fr/en/#sdks. - Planned names: TypeScript/Node npm `@myleapp/myle`; Python PyPI `myle`; Go `github.com/myleapp/myle-go`; Rust crates.io `myle`; Java Maven `fr.myleapp:myle`; Scala Maven `fr.myleapp::myle-scala`; PHP Packagist `myleapp/myle`; .NET NuGet `Myle`; CLI `myle` (crates.io `myle-cli`); MCP server npm `@myleapp/myle-mcp`. - Each SDK will send `Myle-API-Version`, retry `429` and `503` after `Retry-After`, set an `Idempotency-Key` on every write that takes one, and follow the cursors. ## Docs - [Getting started](https://developers.myleapp.fr/en/guides/getting-started): create a key, make a first call - [Authentication](https://developers.myleapp.fr/en/guides/authentication): user keys and organization keys, rights, rotation, revocation - [Conventions](https://developers.myleapp.fr/en/guides/conventions): ids, `object`, money, dates, enums that grow, `null` - [Errors](https://developers.myleapp.fr/en/guides/errors): the envelope, codes, French and English messages, request ids - [Pagination, filters, sorting](https://developers.myleapp.fr/en/guides/pagination): cursors, `updatedAfter` for delta sync - [Writes](https://developers.myleapp.fr/en/guides/writes): idempotency keys, `ETag` / `If-Match`, batches, asynchronous jobs - [Rate limits](https://developers.myleapp.fr/en/guides/rate-limits): policies, headers, backing off on 429 - [Versioning](https://developers.myleapp.fr/en/guides/versioning): `Myle-API-Version`, deprecation and sunset headers, the changelog - [Recipes](https://developers.myleapp.fr/en/guides/recipes): accounting exports, e-shop orders, CRM sync - [API reference](https://developers.myleapp.fr/en/reference): every operation, interactive - [OpenAPI document](https://api.myleapp.fr/openapi.json): OpenAPI 3.1, one `Error.` schema per error code - [Changelog](https://developers.myleapp.fr/en/changelog): dated changes and deprecations - [Full text for language models](https://developers.myleapp.fr/llms-full.txt): every operation with its parameters and errors ## Operations ### Me The signed-in user. - `GET /me` (getMe): Get the signed-in user. ### Organizations The organizations the caller is a member of. - `GET /organizations/{id}` (getOrganization): Get an organization. ### API keys Credentials for programs: user keys act as their owner, organization keys as their own robot account, with Myle rights. Managed with a signed-in session only. - `GET /me/api-keys` (listMyApiKeys): List my API keys. - `POST /me/api-keys` (createMyApiKey): Create a user key. - `GET /me/api-keys/{apiKeyId}` (getMyApiKey): Get one of my API keys. - `DELETE /me/api-keys/{apiKeyId}` (revokeMyApiKey): Revoke one of my API keys. - `PATCH /me/api-keys/{apiKeyId}` (updateMyApiKey): Change one of my API keys. - `POST /me/api-keys/{apiKeyId}/rotate` (rotateMyApiKey): Rotate one of my API keys. - `GET /organizations/{id}/api-keys` (listApiKeys): List the organization's API keys. - `POST /organizations/{id}/api-keys` (createApiKey): Create an organization key. - `GET /organizations/{id}/api-keys/{apiKeyId}` (getApiKey): Get one of the organization's API keys. - `DELETE /organizations/{id}/api-keys/{apiKeyId}` (revokeApiKey): Revoke one of the organization's API keys. - `PATCH /organizations/{id}/api-keys/{apiKeyId}` (updateApiKey): Change one of the organization's API keys. - `POST /organizations/{id}/api-keys/{apiKeyId}/rotate` (rotateApiKey): Rotate one of the organization's API keys. ### Rights The rights of the Myle permission model, which members and API keys hold. - `GET /rights` (listRights): List the rights. ### Products The organization's catalog: the products and services it sells, with their prices and barcodes. - `GET /organizations/{id}/products` (listProducts): List the products. - `POST /organizations/{id}/products` (createProduct): Create a product. - `GET /organizations/{id}/products/tags` (listProductTags): List the products' tags. - `GET /organizations/{id}/products/{productId}` (getProduct): Get a product. - `DELETE /organizations/{id}/products/{productId}` (deleteProduct): Delete a product. - `PATCH /organizations/{id}/products/{productId}` (updateProduct): Change a product. - `GET /organizations/{id}/products/{productId}/neighbors` (getProductNeighbors): Get a product's neighbors in the list. - `POST /organizations/{id}/products/{productId}/barcodes` (createProductBarcode): Add a barcode to a product. - `GET /organizations/{id}/products/{productId}/barcodes/{barcodeId}` (getProductBarcode): Get a barcode of a product. - `DELETE /organizations/{id}/products/{productId}/barcodes/{barcodeId}` (deleteProductBarcode): Remove a barcode from a product. - `PATCH /organizations/{id}/products/{productId}/barcodes/{barcodeId}` (updateProductBarcode): Change a barcode of a product. - `GET /products` (searchProducts): Search the products across organizations. ### Companies The organization's customers: businesses, consumers and foreign clients, with their addresses and e-mail addresses. - `GET /organizations/{id}/companies/tags` (listCompanyTags): List the companies' tags. - `GET /organizations/{id}/companies/{companyId}/neighbors` (getCompanyNeighbors): Get a company's neighbors in a list. - `POST /organizations/{id}/companies/{companyId}/email-addresses` (createCompanyEmailAddress): Add an e-mail address to a company. - `DELETE /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}` (deleteCompanyEmailAddress): Remove an e-mail address from a company. - `PATCH /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}` (updateCompanyEmailAddress): Change an e-mail address of a company. - `POST /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}/resubscribe` (resubscribeCompanyEmailAddress): Subscribe an e-mail address of a company again. - `POST /organizations/{id}/companies/{companyId}/postal-addresses` (createCompanyPostalAddress): Add a postal address to a company. - `GET /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` (getCompanyPostalAddress): Get a postal address of a company. - `DELETE /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` (deleteCompanyPostalAddress): Remove a postal address from a company. - `PATCH /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` (updateCompanyPostalAddress): Change a postal address of a company. - `GET /organizations/{id}/companies` (listCompanies): List the companies. - `POST /organizations/{id}/companies` (createCompany): Create a company. - `GET /organizations/{id}/companies/{companyId}` (getCompany): Get a company. - `DELETE /organizations/{id}/companies/{companyId}` (deleteCompany): Delete a company. - `PATCH /organizations/{id}/companies/{companyId}` (updateCompany): Change a company. - `GET /companies` (searchCompanies): Search the companies across organizations. ### Invoices The organization's sales invoices: drafts, their validation (the legal number), their PDF and Factur-X. - `GET /organizations/{id}/invoices` (listInvoices): List the invoices. - `POST /organizations/{id}/invoices` (createInvoice): Create a draft invoice. - `GET /organizations/{id}/invoices/tags` (listInvoiceTags): List the invoices' tags. - `GET /organizations/{id}/invoices/eligibility` (getInvoiceEligibility): Count what each batch would act on. - `GET /organizations/{id}/invoices/{invoiceId}` (getInvoice): Get an invoice. - `DELETE /organizations/{id}/invoices/{invoiceId}` (deleteInvoice): Delete a draft invoice. - `PATCH /organizations/{id}/invoices/{invoiceId}` (updateInvoice): Change a draft invoice. - `GET /organizations/{id}/invoices/{invoiceId}/neighbors` (getInvoiceNeighbors): Get an invoice's neighbors in the list. - `POST /organizations/{id}/invoices/{invoiceId}/validate` (validateInvoice): Validate an invoice. - `POST /organizations/{id}/invoices/batch-validate` (batchValidateInvoices): Validate several invoices. - `POST /organizations/{id}/invoices/batch-share` (batchShareInvoices): Mark several invoices as handed to their customers. - `POST /organizations/{id}/invoices/batch-payments` (batchCreateInvoicePayments): Record payments on several invoices. - `POST /organizations/{id}/invoices/batch-credit-notes` (batchCreateInvoiceCreditNotes): Cancel several invoices with credit notes. - `POST /organizations/{id}/invoices/batch-duplicate` (batchDuplicateInvoices): Duplicate several invoices as drafts. - `POST /organizations/{id}/invoices/{invoiceId}/send` (sendInvoice): Send an invoice by e-mail. - `POST /organizations/{id}/invoices/{invoiceId}/credit-notes` (createInvoiceCreditNote): Cancel an invoice with a credit note. - `POST /organizations/{id}/invoices/{invoiceId}/edit` (editInvoice): Change a draft's lines, customer or description. - `GET /organizations/{id}/invoices/{invoiceId}/editability` (getInvoiceEditability): Tell whether a draft can still be changed. - `POST /organizations/{id}/invoices/{invoiceId}/share` (shareInvoice): Mark an invoice as handed to its customer. - `POST /organizations/{id}/invoices/{invoiceId}/mark-lost` (markInvoiceLost): Write an invoice off as lost. - `POST /organizations/{id}/invoices/{invoiceId}/unpay` (unpayInvoice): Take an invoice back to unpaid. - `POST /organizations/{id}/invoices/{invoiceId}/reinvoice` (reinvoiceInvoice): Re-bill a credit note as a new draft. - `GET /organizations/{id}/invoices/{invoiceId}/correctable-invoices` (listInvoiceCorrectableInvoices): List the invoices a credit note can correct. - `POST /organizations/{id}/invoices/{invoiceId}/set-corrected-invoice` (setInvoiceCorrectedInvoice): Name the invoice a credit note corrects. - `GET /organizations/{id}/invoices/{invoiceId}/status-history` (listInvoiceStatusHistory): List an invoice's status history. - `GET /organizations/{id}/invoices/{invoiceId}/payments` (listInvoicePayments): List an invoice's payments. - `POST /organizations/{id}/invoices/{invoiceId}/payments` (createInvoicePayment): Record a payment on an invoice. - `GET /organizations/{id}/invoices/{invoiceId}/payments/{paymentId}` (getInvoicePayment): Get a payment of an invoice. - `DELETE /organizations/{id}/invoices/{invoiceId}/payments/{paymentId}` (deleteInvoicePayment): Remove a payment of an invoice. - `GET /invoices` (searchInvoices): Search the invoices across organizations. ### Quotations The organization's quotations: the offers it makes its customers, sent, accepted or refused, extended, and billed as invoices. - `GET /organizations/{id}/quotations` (listQuotations): List the quotations. - `POST /organizations/{id}/quotations` (createQuotation): Create a quotation. - `GET /organizations/{id}/quotations/tags` (listQuotationTags): List the quotations' tags. - `GET /organizations/{id}/quotations/eligibility` (getQuotationEligibility): Count what each batch would act on. - `GET /organizations/{id}/quotations/{quotationId}` (getQuotation): Get a quotation. - `DELETE /organizations/{id}/quotations/{quotationId}` (deleteQuotation): Delete a quotation. - `PATCH /organizations/{id}/quotations/{quotationId}` (updateQuotation): Change a quotation. - `GET /organizations/{id}/quotations/{quotationId}/neighbors` (getQuotationNeighbors): Get a quotation's neighbors in the list. - `POST /organizations/{id}/quotations/{quotationId}/edit` (editQuotation): Change a quotation's lines, customer or description. - `GET /organizations/{id}/quotations/{quotationId}/editability` (getQuotationEditability): Tell whether a quotation can still be changed. - `POST /organizations/{id}/quotations/{quotationId}/share` (shareQuotation): Mark a quotation as handed to its customer. - `POST /organizations/{id}/quotations/{quotationId}/approve` (approveQuotation): Record that the customer accepted a quotation. - `POST /organizations/{id}/quotations/batch-share` (batchShareQuotations): Mark several quotations as handed to their customers. - `POST /organizations/{id}/quotations/batch-approve` (batchApproveQuotations): Record that customers accepted several quotations. - `POST /organizations/{id}/quotations/batch-order` (batchOrderQuotations): Turn several accepted quotations into orders. - `POST /organizations/{id}/quotations/{quotationId}/cancel` (cancelQuotation): Cancel a quotation (refused or withdrawn). - `POST /organizations/{id}/quotations/{quotationId}/extend` (extendQuotation): Extend a quotation's validity. - `POST /organizations/{id}/quotations/{quotationId}/order` (orderQuotation): Turn an accepted quotation into an order. - `POST /organizations/{id}/quotations/{quotationId}/invoice` (invoiceQuotation): Bill an accepted quotation. - `POST /organizations/{id}/quotations/{quotationId}/send` (sendQuotation): Send a quotation by e-mail. - `GET /organizations/{id}/quotations/{quotationId}/status-history` (listQuotationStatusHistory): List a quotation's status history. - `GET /quotations` (searchQuotations): Search the quotations across organizations. ### Orders The organization's orders: what its customers order, confirmed, prepared, delivered (with the stock lots the goods leave from) and billed. - `GET /organizations/{id}/orders` (listOrders): List the orders. - `POST /organizations/{id}/orders` (createOrder): Create an order. - `GET /organizations/{id}/orders/tags` (listOrderTags): List the orders' tags. - `GET /organizations/{id}/orders/eligibility` (getOrderEligibility): Count what each batch would act on. - `GET /organizations/{id}/orders/{orderId}` (getOrder): Get an order. - `DELETE /organizations/{id}/orders/{orderId}` (deleteOrder): Delete an order. - `PATCH /organizations/{id}/orders/{orderId}` (updateOrder): Change an order. - `GET /organizations/{id}/orders/{orderId}/neighbors` (getOrderNeighbors): Get an order's neighbors in the list. - `POST /organizations/{id}/orders/{orderId}/edit` (editOrder): Change an order's lines, customer, delivery address or description. - `GET /organizations/{id}/orders/{orderId}/editability` (getOrderEditability): Tell whether an order can still be changed. - `POST /organizations/{id}/orders/{orderId}/share` (shareOrder): Mark an order as handed to its customer. - `POST /organizations/{id}/orders/{orderId}/approve` (approveOrder): Record that the customer confirmed an order. - `POST /organizations/{id}/orders/{orderId}/mark-waiting-for-delivery` (markOrderWaitingForDelivery): Mark an order as prepared, waiting for its delivery. - `POST /organizations/{id}/orders/{orderId}/cancel` (cancelOrder): Cancel an order. - `POST /organizations/{id}/orders/batch-share` (batchShareOrders): Mark several orders as handed to their customers. - `POST /organizations/{id}/orders/batch-approve` (batchApproveOrders): Record that customers confirmed several orders. - `GET /organizations/{id}/orders/{orderId}/stock-availability` (getOrderStockAvailability): List the stocks an order's goods can leave from. - `POST /organizations/{id}/orders/{orderId}/deliver` (deliverOrder): Deliver an order: make its delivery note. - `POST /organizations/{id}/orders/{orderId}/invoice` (invoiceOrder): Bill an order. - `POST /organizations/{id}/orders/{orderId}/send` (sendOrder): Send an order by e-mail. - `GET /organizations/{id}/orders/{orderId}/status-history` (listOrderStatusHistory): List an order's status history. - `GET /orders` (searchOrders): Search the orders across organizations. ### Delivery notes The organization's delivery notes: the goods handed to a customer, with the lots they left from. - `GET /organizations/{id}/delivery-notes/{deliveryNoteId}` (getDeliveryNote): Get a delivery note. ### E-invoicing E-invoicing through the organization's approved platform (SuperPDP): its connection and address, a customer's routing, the e-invoice of an invoice, and the e-invoices suppliers send. - `GET /organizations/{id}/einvoicing` (getEinvoicing): Get the organization's e-invoicing. - `POST /organizations/{id}/einvoicing/connect` (connectEinvoicing): Start connecting the organization to SuperPDP. - `POST /organizations/{id}/einvoicing/disconnect` (disconnectEinvoicing): Disconnect the organization from SuperPDP. - `POST /organizations/{id}/einvoicing/sync` (syncEinvoicing): Read the verification statuses from SuperPDP. - `GET /organizations/{id}/einvoicing/address` (getEinvoicingAddress): Get the organization's electronic address. - `PUT /organizations/{id}/einvoicing/address` (replaceEinvoicingAddress): Choose the organization's electronic address. - `GET /organizations/{id}/companies/{companyId}/einvoicing-routing` (getCompanyEinvoicingRouting): Get a customer's e-invoicing routing. - `PUT /organizations/{id}/companies/{companyId}/einvoicing-routing` (replaceCompanyEinvoicingRouting): Choose a customer's electronic address. - `GET /organizations/{id}/invoices/{invoiceId}/einvoice` (getInvoiceEinvoice): Get an invoice's e-invoice. - `POST /organizations/{id}/invoices/{invoiceId}/submit-einvoice` (submitInvoiceEinvoice): Submit an invoice through the e-invoicing network. - `GET /organizations/{id}/einvoices/outgoing-failures` (listOutgoingEinvoiceFailures): List the failed submissions. - `GET /organizations/{id}/incoming-einvoices` (listIncomingEinvoices): List the incoming e-invoices. - `GET /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}` (getIncomingEinvoice): Get an incoming e-invoice. - `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/accept` (acceptIncomingEinvoice): Accept an incoming e-invoice. - `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/refuse` (refuseIncomingEinvoice): Refuse an incoming e-invoice. - `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/dispute` (disputeIncomingEinvoice): Dispute an incoming e-invoice. - `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/accept-partially` (acceptIncomingEinvoicePartially): Accept an incoming e-invoice in part. - `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/mark-paid` (markIncomingEinvoicePaid): Mark an incoming e-invoice paid. ### Payments The organization's Stripe account, its customers' SEPA mandates, the debit and the refund of an invoice, its payment status. - `GET /organizations/{id}/payments-account` (getPaymentsAccount): Get the organization's Stripe account. - `POST /organizations/{id}/payments-account/onboarding` (startPaymentsAccountOnboarding): Start or resume the Stripe onboarding. - `POST /organizations/{id}/payments-account/dashboard-link` (createPaymentsAccountDashboardLink): Open the Stripe dashboard. - `GET /organizations/{id}/payments-account/online-payment` (getOnlinePaymentSetting): Get the online payment of invoices. - `PUT /organizations/{id}/payments-account/online-payment` (replaceOnlinePaymentSetting): Turn the online payment of invoices on or off. - `GET /organizations/{id}/payments-account/sepa-fees` (listSepaFees): List the SEPA debits' fees. - `GET /organizations/{id}/payments-account/sepa-quota` (getSepaQuota): Get the SEPA quota. - `GET /organizations/{id}/companies/{companyId}/sepa-mandate` (getCompanySepaMandate): Get a customer's SEPA mandate. - `POST /organizations/{id}/companies/{companyId}/sepa-mandate/invitation` (createSepaMandateInvitation): Invite a customer to sign a SEPA mandate. - `POST /organizations/{id}/companies/{companyId}/sepa-mandate/revoke` (revokeSepaMandate): Revoke a customer's SEPA mandate. - `POST /organizations/{id}/invoices/{invoiceId}/debit` (debitInvoice): Debit an invoice by SEPA. - `POST /organizations/{id}/invoices/{invoiceId}/refund` (refundInvoice): Refund an invoice's Stripe payments. - `GET /organizations/{id}/invoices/{invoiceId}/payment-status` (getInvoicePaymentStatus): Get an invoice's payment status.