Metadata-Version: 2.5
Name: myle
Version: 0.1.0
Summary: The official Python SDK of the Myle API (https://api.myleapp.fr)
Project-URL: Homepage, https://developers.myleapp.fr
Project-URL: Source, https://github.com/myleapp/api
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agriculture,api,invoicing,myle,sdk
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx<1,>=0.27
Description-Content-Type: text/markdown

# myle

The official Python SDK of the [Myle API](https://developers.myleapp.fr): sync and async clients on httpx,
typed (dataclasses, `py.typed`), one exception class per error code, auto-pagination, idempotent retries,
`ETag` / `If-Match`. Generated from the API's OpenAPI document by `sdk/generator` (Apache-2.0).

SDK version `0.1.0`, built against `Myle-API-Version: 2026-11-21`. Python ≥ 3.11.

```sh
pip install myle
```

## Quick start

```python
from myle import Myle

myle = Myle()  # reads MYLE_API_KEY; or Myle(api_key="…")

me = myle.me.get()
org = myle.organization("organization_…")

for product in org.products.list(status="ACTIVE"):
    print(product.number, product.name)

product = org.products.create(number="A0012", name="Foin de prairie", vat_rate="5.5")
org.products.update(product.id, name="Foin de luzerne", if_match=product)
```

Async: the same with `AsyncMyle`, `await` and `async for`.

```python
import asyncio
from myle import AsyncMyle

async def main() -> None:
    async with AsyncMyle() as myle:
        async for company in myle.organization("organization_…").companies.list(q="gaec"):
            print(company.name)

asyncio.run(main())
```

## The client

```python
Myle(
    api_key="…",            # default: MYLE_API_KEY (an organization or a user key, opaque)
    api_version="2026-11-21",  # the Myle-API-Version sent; default: this SDK's
    base_url="https://api.myleapp.fr",  # default: MYLE_BASE_URL, else this
    max_retries=2,          # network errors, 429 and 5xx (when safe to repeat)
    timeout=60.0,           # httpx's, per phase of an attempt (connect, each read, write), in seconds
    accept_language="fr",   # the language of error messages; English by default
    on_deprecation=print,   # once per operation served with an older behavior
)
```

Resources follow the API's paths: `myle.organization(id).products` is `/organizations/{id}/products`,
`myle.me` is `/me`. A method takes the ids of its path positionally, then keyword arguments: the body's
members and the list's filters in snake_case (`vat_rate`, `updated_after`), `idempotency_key` or `if_match`
where the operation takes them, and the request options (`timeout`, `max_retries`, `extra_headers`,
`accept_language`). An optional argument left out is not sent; `None` is sent as `null` (a merge patch clears
the member). Resources come back as dataclasses with snake_case attributes; `to_dict()` gives the JSON.

## Lists

```python
for company in org.companies.list(q="gaec"):   # follows nextCursor page after page
    print(company.name)

page = org.products.list(limit=200).first_page()
page.data; page.has_more; next_page = page.next_page()
everything = org.products.list().to_list(max=1000)
```

## Files

An operation that answers a file (a PDF…) has a method of its own that returns a `FileDownload`: `content`
(the bytes, as received), `filename` (from `Content-Disposition`, or `None`), `content_type`,
`last_response`, and `save(path)`. It is never parsed nor typed as the JSON resource; errors are raised as for
any call.

```python
pdf = myle.organization("organization_…").invoices.download_pdf("invoice_…", format="facturx")
pdf.save(pdf.filename or "invoice.pdf")
```

## Errors

Every error answer of the API is raised as a `MyleApiError` subclass: the class of its error code, which
extends the class of its HTTP status (`ConflictError`, `NotFoundError`…). `code` is stable, `context` is
typed by the code, `message` is the human sentence (French or English: never parse it), `request_id` is
what support asks for. A network failure is a `MyleConnectionError` (`MyleTimeoutError` for a timeout).

```python
from myle import CoreConflictError, MyleApiError

try:
    org.products.create(number="A0012", name="Foin", vat_rate="5.5")
except CoreConflictError as e:
    print("number taken:", e.context.name)
except MyleApiError as e:
    print(e.status, e.code, e.message, e.request_id)
```

| Code | Status | Class |
|---|---|---|
| `core.bad-request` | 400 | `CoreBadRequestError` |
| `core.api-version-unsupported` | — | `CoreApiVersionUnsupportedError` |
| `core.module-required` | 402 | `CoreModuleRequiredError` |
| `core.subscription-required` | 402 | `CoreSubscriptionRequiredError` |
| `core.plan-limit-reached` | 402 | `CorePlanLimitReachedError` |
| `core.not-found` | 404 | `CoreNotFoundError` |
| `core.method-not-allowed` | 405 | `CoreMethodNotAllowedError` |
| `core.not-acceptable` | 406 | `CoreNotAcceptableError` |
| `core.conflict` | 409 | `CoreConflictError` |
| `core.precondition-failed` | 412 | `CorePreconditionFailedError` |
| `core.payload-too-large` | 413 | `CorePayloadTooLargeError` |
| `core.unsupported-media-type` | 415 | `CoreUnsupportedMediaTypeError` |
| `core.validation-failed` | 422 | `CoreValidationFailedError` |
| `core.idempotency-key-reused` | 422 | `CoreIdempotencyKeyReusedError` |
| `core.idempotency-key-in-use` | 409 | `CoreIdempotencyKeyInUseError` |
| `core.rate-limited` | 429 | `CoreRateLimitedError` |
| `core.internal-error` | 500 | `CoreInternalError` |
| `core.bad-gateway` | 502 | `CoreBadGatewayError` |
| `core.unavailable` | 503 | `CoreUnavailableError` |
| `auth.credential.missing` | 401 | `AuthCredentialMissingError` |
| `auth.credential.invalid` | 401 | `AuthCredentialInvalidError` |
| `auth.credential.expired` | 401 | `AuthCredentialExpiredError` |
| `auth.credential.revoked` | 401 | `AuthCredentialRevokedError` |
| `auth.right.missing` | 403 | `AuthRightMissingError` |
| `auth.email.unconfirmed` | 403 | `AuthEmailUnconfirmedError` |
| `auth.session.refused` | 403 | `AuthSessionRefusedError` |
| `auth.api-key.organization-not-allowed` | 403 | `AuthApiKeyOrganizationNotAllowedError` |
| `auth.session.required` | 403 | `AuthSessionRequiredError` |
| `auth.step-up.required` | 403 | `AuthStepUpRequiredError` |
| `auth.api-key.limit-reached` | 409 | `AuthApiKeyLimitReachedError` |
| `products.barcode.duplicate` | 409 | `ProductBarcodeDuplicateError` |
| `products.barcode.outside-company-prefix` | 422 | `ProductBarcodeOutsideCompanyPrefixError` |
| `crm.company.identifier-required` | 422 | `CrmCompanyIdentifierRequiredError` |
| `crm.company.invalid-identifier` | 422 | `CrmCompanyInvalidIdentifierError` |
| `crm.company.invalid-siret` | 422 | `CrmCompanyInvalidSiretError` |
| `crm.company.accounting-number-taken` | 409 | `CrmCompanyAccountingNumberTakenError` |
| `crm.postal-address.referenced` | 409 | `CrmPostalAddressReferencedError` |
| `billing.invoice.not-a-draft` | 409 | `BillingInvoiceNotADraftError` |
| `billing.invoice.stripe-imported` | 409 | `BillingInvoiceStripeImportedError` |
| `billing.invoice.foreign-product` | 422 | `BillingInvoiceForeignProductError` |
| `billing.invoice.out-of-scope-reference` | 422 | `BillingInvoiceOutOfScopeReferenceError` |
| `billing.invoice.partial-credit-note` | 409 | `BillingInvoicePartialCreditNoteError` |
| `billing.invoice.facturx-unavailable` | 409 | `BillingInvoiceFacturxUnavailableError` |
| `billing.invoice.not-payable` | 409 | `BillingInvoiceNotPayableError` |
| `billing.invoice.already-paid` | 409 | `BillingInvoiceAlreadyPaidError` |
| `billing.invoice.credit-note-linked` | 409 | `BillingInvoiceCreditNoteLinkedError` |
| `billing.payment.not-removable` | 409 | `BillingPaymentNotRemovableError` |
| `billing.payment.stripe-collected` | 409 | `BillingPaymentStripeCollectedError` |
| `billing.invoice.not-creditable` | 409 | `BillingInvoiceNotCreditableError` |
| `billing.invoice.already-credited` | 409 | `BillingInvoiceAlreadyCreditedError` |
| `billing.invoice.deposit-deducted` | 409 | `BillingInvoiceDepositDeductedError` |
| `billing.invoice.einvoice-required` | 409 | `BillingInvoiceEinvoiceRequiredError` |
| `billing.invoice.recipient-unsubscribed` | — | `BillingInvoiceRecipientUnsubscribedError` |
| `billing.invoice.transition-refused` | 409 | `BillingInvoiceTransitionRefusedError` |
| `billing.invoice.generated-credit-note` | 409 | `BillingInvoiceGeneratedCreditNoteError` |
| `billing.invoice.not-editable` | 409 | `BillingInvoiceNotEditableError` |
| `billing.invoice.not-reinvoiceable` | 409 | `BillingInvoiceNotReinvoiceableError` |
| `billing.invoice.already-reinvoiced` | 409 | `BillingInvoiceAlreadyReinvoicedError` |
| `billing.invoice.not-a-credit-note` | 409 | `BillingInvoiceNotACreditNoteError` |
| `billing.invoice.correction-fixed` | 409 | `BillingInvoiceCorrectionFixedError` |
| `billing.invoice.not-correctable` | 409 | `BillingInvoiceNotCorrectableError` |
| `billing.invoice.not-duplicable` | — | `BillingInvoiceNotDuplicableError` |
| `quotations.quotation.transition-refused` | 409 | `QuotationQuotationTransitionRefusedError` |
| `quotations.quotation.not-extendable` | 409 | `QuotationQuotationNotExtendableError` |
| `quotations.quotation.converted` | 409 | `QuotationQuotationConvertedError` |
| `quotations.quotation.already-invoiced` | 409 | `QuotationQuotationAlreadyInvoicedError` |
| `quotations.quotation.has-deposits` | 409 | `QuotationQuotationHasDepositsError` |
| `quotations.quotation.not-editable` | 409 | `QuotationQuotationNotEditableError` |
| `quotations.quotation.foreign-product` | 422 | `QuotationQuotationForeignProductError` |
| `quotations.quotation.out-of-scope-reference` | 422 | `QuotationQuotationOutOfScopeReferenceError` |
| `quotations.quotation.recipient-unsubscribed` | — | `QuotationQuotationRecipientUnsubscribedError` |
| `orders.order.transition-refused` | 409 | `OrderOrderTransitionRefusedError` |
| `orders.order.not-deletable` | 409 | `OrderOrderNotDeletableError` |
| `orders.order.not-editable` | 409 | `OrderOrderNotEditableError` |
| `orders.order.foreign-product` | 422 | `OrderOrderForeignProductError` |
| `orders.order.out-of-scope-reference` | 422 | `OrderOrderOutOfScopeReferenceError` |
| `orders.order.already-invoiced` | 409 | `OrderOrderAlreadyInvoicedError` |
| `orders.order.has-deposits` | 409 | `OrderOrderHasDepositsError` |
| `orders.order.shop-billed` | 409 | `OrderOrderShopBilledError` |
| `orders.order.recipient-unsubscribed` | — | `OrderOrderRecipientUnsubscribedError` |
| `einvoicing.organization.paid-plan-required` | 402 | `EinvoicingOrganizationPaidPlanRequiredError` |
| `einvoicing.organization.not-subject` | 409 | `EinvoicingOrganizationNotSubjectError` |
| `einvoicing.connection.not-connected` | 409 | `EinvoicingConnectionNotConnectedError` |
| `einvoicing.routing-address.not-published` | 422 | `EinvoicingRoutingAddressNotPublishedError` |
| `einvoicing.einvoice.not-eligible` | 409 | `EinvoicingEinvoiceNotEligibleError` |
| `einvoicing.einvoice.not-retryable` | 409 | `EinvoicingEinvoiceNotRetryableError` |
| `einvoicing.einvoice.credit-note-reference-missing` | 409 | `EinvoicingEinvoiceCreditNoteReferenceMissingError` |
| `einvoicing.incoming-einvoice.already-settled` | 409 | `EinvoicingIncomingEinvoiceAlreadySettledError` |
| `einvoicing.incoming-einvoice.not-on-platform` | 409 | `EinvoicingIncomingEinvoiceNotOnPlatformError` |
| `einvoicing.incoming-einvoice.not-accepted` | 409 | `EinvoicingIncomingEinvoiceNotAcceptedError` |
| `payments.account.not-connected` | 409 | `PaymentAccountNotConnectedError` |
| `payments.account.demo` | 409 | `PaymentAccountDemoError` |
| `payments.account.suspended` | 409 | `PaymentAccountSuspendedError` |
| `payments.collection.disabled` | 409 | `PaymentCollectionDisabledError` |
| `payments.collection.paused` | 409 | `PaymentCollectionPausedError` |
| `payments.plan.collection-required` | 402 | `PaymentPlanCollectionRequiredError` |
| `payments.mandate.missing` | 409 | `PaymentMandateMissingError` |
| `payments.mandate.foreign-iban` | 409 | `PaymentMandateForeignIbanError` |
| `payments.mandate.invitations-throttled` | 429 | `PaymentMandateInvitationsThrottledError` |
| `payments.debit.not-debitable` | 409 | `PaymentDebitNotDebitableError` |
| `payments.debit.nothing-due` | 409 | `PaymentDebitNothingDueError` |
| `payments.debit.below-minimum` | 409 | `PaymentDebitBelowMinimumError` |
| `payments.debit.above-maximum` | 409 | `PaymentDebitAboveMaximumError` |
| `payments.debit.quota-reached` | 409 | `PaymentDebitQuotaReachedError` |
| `payments.refund.nothing-to-refund` | 409 | `PaymentRefundNothingToRefundError` |

## Idempotency, retries, concurrency

- Operations that accept `Idempotency-Key` get one generated per call, reused by its retries: a create
  retried after a network error never creates twice. Pass `idempotency_key=` to choose it.
  `last_response.idempotent_replayed` tells a replay.
- Retries (`max_retries`, 2 by default): network errors and 5xx when the call is safe to repeat (`GET`, `PUT`,
  `DELETE`, or a write with an idempotency key); 429 always, after `Retry-After`; backoff with jitter.
- Every single resource comes with its `etag`. Pass the resource, or its `etag`, as `if_match=` to `update` /
  `delete`: if someone changed it since, the call raises `CorePreconditionFailedError` (412) and changes nothing.

## Versioning

Each SDK release pins the contract date it was generated against (`API_VERSION`, `2026-11-21` here) and
sends it as `Myle-API-Version`: an API change never changes what this code receives. When the API answers an
operation with an older behavior (`Deprecation`, `Sunset`), `on_deprecation` is called once per operation (a
`MyleDeprecationWarning` by default).

## Methods

### `myle.rights`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /rights` | List the rights |

### `myle.products`

| Method | HTTP | Summary |
|---|---|---|
| `search()` | `GET /products` | Search the products across organizations |

### `myle.companies`

| Method | HTTP | Summary |
|---|---|---|
| `search()` | `GET /companies` | Search the companies across organizations |

### `myle.invoices`

| Method | HTTP | Summary |
|---|---|---|
| `search()` | `GET /invoices` | Search the invoices across organizations |

### `myle.quotations`

| Method | HTTP | Summary |
|---|---|---|
| `search()` | `GET /quotations` | Search the quotations across organizations |

### `myle.orders`

| Method | HTTP | Summary |
|---|---|---|
| `search()` | `GET /orders` | Search the orders across organizations |

### `myle.me`

| Method | HTTP | Summary |
|---|---|---|
| `get()` | `GET /me` | Get the signed-in user |

### `myle.me.api_keys`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /me/api-keys` | List my API keys |
| `create()` | `POST /me/api-keys` | Create a user key |
| `get(api_key_id)` | `GET /me/api-keys/{apiKeyId}` | Get one of my API keys |
| `revoke(api_key_id)` | `DELETE /me/api-keys/{apiKeyId}` | Revoke one of my API keys |
| `update(api_key_id)` | `PATCH /me/api-keys/{apiKeyId}` | Change one of my API keys |
| `rotate(api_key_id)` | `POST /me/api-keys/{apiKeyId}/rotate` | Rotate one of my API keys |

### `myle.organization("organization_…")`

| Method | HTTP | Summary |
|---|---|---|
| `get()` | `GET /organizations/{id}` | Get an organization |

### `myle.organization("organization_…").api_keys`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/api-keys` | List the organization's API keys |
| `create()` | `POST /organizations/{id}/api-keys` | Create an organization key |
| `get(api_key_id)` | `GET /organizations/{id}/api-keys/{apiKeyId}` | Get one of the organization's API keys |
| `revoke(api_key_id)` | `DELETE /organizations/{id}/api-keys/{apiKeyId}` | Revoke one of the organization's API keys |
| `update(api_key_id)` | `PATCH /organizations/{id}/api-keys/{apiKeyId}` | Change one of the organization's API keys |
| `rotate(api_key_id)` | `POST /organizations/{id}/api-keys/{apiKeyId}/rotate` | Rotate one of the organization's API keys |

### `myle.organization("organization_…").products`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/products` | List the products |
| `create()` | `POST /organizations/{id}/products` | Create a product |
| `list_tags()` | `GET /organizations/{id}/products/tags` | List the products' tags |
| `get(product_id)` | `GET /organizations/{id}/products/{productId}` | Get a product |
| `delete(product_id)` | `DELETE /organizations/{id}/products/{productId}` | Delete a product |
| `update(product_id)` | `PATCH /organizations/{id}/products/{productId}` | Change a product |
| `get_neighbors(product_id)` | `GET /organizations/{id}/products/{productId}/neighbors` | Get a product's neighbors in the list |

### `myle.organization("organization_…").products.barcodes`

| Method | HTTP | Summary |
|---|---|---|
| `create(product_id)` | `POST /organizations/{id}/products/{productId}/barcodes` | Add a barcode to a product |
| `get(product_id, barcode_id)` | `GET /organizations/{id}/products/{productId}/barcodes/{barcodeId}` | Get a barcode of a product |
| `delete(product_id, barcode_id)` | `DELETE /organizations/{id}/products/{productId}/barcodes/{barcodeId}` | Remove a barcode from a product |
| `update(product_id, barcode_id)` | `PATCH /organizations/{id}/products/{productId}/barcodes/{barcodeId}` | Change a barcode of a product |

### `myle.organization("organization_…").companies`

| Method | HTTP | Summary |
|---|---|---|
| `list_tags()` | `GET /organizations/{id}/companies/tags` | List the companies' tags |
| `get_neighbors(company_id)` | `GET /organizations/{id}/companies/{companyId}/neighbors` | Get a company's neighbors in a list |
| `list()` | `GET /organizations/{id}/companies` | List the companies |
| `create()` | `POST /organizations/{id}/companies` | Create a company |
| `get(company_id)` | `GET /organizations/{id}/companies/{companyId}` | Get a company |
| `delete(company_id)` | `DELETE /organizations/{id}/companies/{companyId}` | Delete a company |
| `update(company_id)` | `PATCH /organizations/{id}/companies/{companyId}` | Change a company |
| `get_einvoicing_routing(company_id)` | `GET /organizations/{id}/companies/{companyId}/einvoicing-routing` | Get a customer's e-invoicing routing |
| `replace_einvoicing_routing(company_id)` | `PUT /organizations/{id}/companies/{companyId}/einvoicing-routing` | Choose a customer's electronic address |
| `get_sepa_mandate(company_id)` | `GET /organizations/{id}/companies/{companyId}/sepa-mandate` | Get a customer's SEPA mandate |

### `myle.organization("organization_…").companies.email_addresses`

| Method | HTTP | Summary |
|---|---|---|
| `create(company_id)` | `POST /organizations/{id}/companies/{companyId}/email-addresses` | Add an e-mail address to a company |
| `delete(company_id, company_email_address_id)` | `DELETE /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}` | Remove an e-mail address from a company |
| `update(company_id, company_email_address_id)` | `PATCH /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}` | Change an e-mail address of a company |
| `resubscribe(company_id, company_email_address_id)` | `POST /organizations/{id}/companies/{companyId}/email-addresses/{companyEmailAddressId}/resubscribe` | Subscribe an e-mail address of a company again |

### `myle.organization("organization_…").companies.postal_addresses`

| Method | HTTP | Summary |
|---|---|---|
| `create(company_id)` | `POST /organizations/{id}/companies/{companyId}/postal-addresses` | Add a postal address to a company |
| `get(company_id, postal_address_id)` | `GET /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` | Get a postal address of a company |
| `delete(company_id, postal_address_id)` | `DELETE /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` | Remove a postal address from a company |
| `update(company_id, postal_address_id)` | `PATCH /organizations/{id}/companies/{companyId}/postal-addresses/{postalAddressId}` | Change a postal address of a company |

### `myle.organization("organization_…").companies.sepa_mandate`

| Method | HTTP | Summary |
|---|---|---|
| `create_invitation(company_id)` | `POST /organizations/{id}/companies/{companyId}/sepa-mandate/invitation` | Invite a customer to sign a SEPA mandate |
| `revoke(company_id)` | `POST /organizations/{id}/companies/{companyId}/sepa-mandate/revoke` | Revoke a customer's SEPA mandate |

### `myle.organization("organization_…").invoices`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/invoices` | List the invoices |
| `create()` | `POST /organizations/{id}/invoices` | Create a draft invoice |
| `list_tags()` | `GET /organizations/{id}/invoices/tags` | List the invoices' tags |
| `get_eligibility()` | `GET /organizations/{id}/invoices/eligibility` | Count what each batch would act on |
| `get(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}` | Get an invoice |
| `download_pdf(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}` | Get an invoice as a PDF file |
| `delete(invoice_id)` | `DELETE /organizations/{id}/invoices/{invoiceId}` | Delete a draft invoice |
| `update(invoice_id)` | `PATCH /organizations/{id}/invoices/{invoiceId}` | Change a draft invoice |
| `get_neighbors(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/neighbors` | Get an invoice's neighbors in the list |
| `validate(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/validate` | Validate an invoice |
| `batch_validate()` | `POST /organizations/{id}/invoices/batch-validate` | Validate several invoices |
| `batch_share()` | `POST /organizations/{id}/invoices/batch-share` | Mark several invoices as handed to their customers |
| `batch_create_payments()` | `POST /organizations/{id}/invoices/batch-payments` | Record payments on several invoices |
| `batch_create_credit_notes()` | `POST /organizations/{id}/invoices/batch-credit-notes` | Cancel several invoices with credit notes |
| `batch_duplicate()` | `POST /organizations/{id}/invoices/batch-duplicate` | Duplicate several invoices as drafts |
| `send(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/send` | Send an invoice by e-mail |
| `edit(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/edit` | Change a draft's lines, customer or description |
| `get_editability(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/editability` | Tell whether a draft can still be changed |
| `share(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/share` | Mark an invoice as handed to its customer |
| `mark_lost(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/mark-lost` | Write an invoice off as lost |
| `unpay(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/unpay` | Take an invoice back to unpaid |
| `reinvoice(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/reinvoice` | Re-bill a credit note as a new draft |
| `set_corrected_invoice(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/set-corrected-invoice` | Name the invoice a credit note corrects |
| `get_einvoice(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/einvoice` | Get an invoice's e-invoice |
| `submit_einvoice(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/submit-einvoice` | Submit an invoice through the e-invoicing network |
| `debit(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/debit` | Debit an invoice by SEPA |
| `refund(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/refund` | Refund an invoice's Stripe payments |
| `get_payment_status(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/payment-status` | Get an invoice's payment status |

### `myle.organization("organization_…").invoices.credit_notes`

| Method | HTTP | Summary |
|---|---|---|
| `create(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/credit-notes` | Cancel an invoice with a credit note |

### `myle.organization("organization_…").invoices.correctable_invoices`

| Method | HTTP | Summary |
|---|---|---|
| `list(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/correctable-invoices` | List the invoices a credit note can correct |

### `myle.organization("organization_…").invoices.status_history`

| Method | HTTP | Summary |
|---|---|---|
| `list(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/status-history` | List an invoice's status history |

### `myle.organization("organization_…").invoices.payments`

| Method | HTTP | Summary |
|---|---|---|
| `list(invoice_id)` | `GET /organizations/{id}/invoices/{invoiceId}/payments` | List an invoice's payments |
| `create(invoice_id)` | `POST /organizations/{id}/invoices/{invoiceId}/payments` | Record a payment on an invoice |
| `get(invoice_id, payment_id)` | `GET /organizations/{id}/invoices/{invoiceId}/payments/{paymentId}` | Get a payment of an invoice |
| `delete(invoice_id, payment_id)` | `DELETE /organizations/{id}/invoices/{invoiceId}/payments/{paymentId}` | Remove a payment of an invoice |

### `myle.organization("organization_…").quotations`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/quotations` | List the quotations |
| `create()` | `POST /organizations/{id}/quotations` | Create a quotation |
| `list_tags()` | `GET /organizations/{id}/quotations/tags` | List the quotations' tags |
| `get_eligibility()` | `GET /organizations/{id}/quotations/eligibility` | Count what each batch would act on |
| `get(quotation_id)` | `GET /organizations/{id}/quotations/{quotationId}` | Get a quotation |
| `download_pdf(quotation_id)` | `GET /organizations/{id}/quotations/{quotationId}` | Get a quotation as a PDF file |
| `delete(quotation_id)` | `DELETE /organizations/{id}/quotations/{quotationId}` | Delete a quotation |
| `update(quotation_id)` | `PATCH /organizations/{id}/quotations/{quotationId}` | Change a quotation |
| `get_neighbors(quotation_id)` | `GET /organizations/{id}/quotations/{quotationId}/neighbors` | Get a quotation's neighbors in the list |
| `edit(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/edit` | Change a quotation's lines, customer or description |
| `get_editability(quotation_id)` | `GET /organizations/{id}/quotations/{quotationId}/editability` | Tell whether a quotation can still be changed |
| `share(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/share` | Mark a quotation as handed to its customer |
| `approve(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/approve` | Record that the customer accepted a quotation |
| `batch_share()` | `POST /organizations/{id}/quotations/batch-share` | Mark several quotations as handed to their customers |
| `batch_approve()` | `POST /organizations/{id}/quotations/batch-approve` | Record that customers accepted several quotations |
| `batch_order()` | `POST /organizations/{id}/quotations/batch-order` | Turn several accepted quotations into orders |
| `cancel(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/cancel` | Cancel a quotation (refused or withdrawn) |
| `extend(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/extend` | Extend a quotation's validity |
| `order(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/order` | Turn an accepted quotation into an order |
| `invoice(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/invoice` | Bill an accepted quotation |
| `send(quotation_id)` | `POST /organizations/{id}/quotations/{quotationId}/send` | Send a quotation by e-mail |

### `myle.organization("organization_…").quotations.status_history`

| Method | HTTP | Summary |
|---|---|---|
| `list(quotation_id)` | `GET /organizations/{id}/quotations/{quotationId}/status-history` | List a quotation's status history |

### `myle.organization("organization_…").orders`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/orders` | List the orders |
| `create()` | `POST /organizations/{id}/orders` | Create an order |
| `list_tags()` | `GET /organizations/{id}/orders/tags` | List the orders' tags |
| `get_eligibility()` | `GET /organizations/{id}/orders/eligibility` | Count what each batch would act on |
| `get(order_id)` | `GET /organizations/{id}/orders/{orderId}` | Get an order |
| `download_pdf(order_id)` | `GET /organizations/{id}/orders/{orderId}` | Get an order as a PDF file |
| `delete(order_id)` | `DELETE /organizations/{id}/orders/{orderId}` | Delete an order |
| `update(order_id)` | `PATCH /organizations/{id}/orders/{orderId}` | Change an order |
| `get_neighbors(order_id)` | `GET /organizations/{id}/orders/{orderId}/neighbors` | Get an order's neighbors in the list |
| `edit(order_id)` | `POST /organizations/{id}/orders/{orderId}/edit` | Change an order's lines, customer, delivery address or description |
| `get_editability(order_id)` | `GET /organizations/{id}/orders/{orderId}/editability` | Tell whether an order can still be changed |
| `share(order_id)` | `POST /organizations/{id}/orders/{orderId}/share` | Mark an order as handed to its customer |
| `approve(order_id)` | `POST /organizations/{id}/orders/{orderId}/approve` | Record that the customer confirmed an order |
| `mark_waiting_for_delivery(order_id)` | `POST /organizations/{id}/orders/{orderId}/mark-waiting-for-delivery` | Mark an order as prepared, waiting for its delivery |
| `cancel(order_id)` | `POST /organizations/{id}/orders/{orderId}/cancel` | Cancel an order |
| `batch_share()` | `POST /organizations/{id}/orders/batch-share` | Mark several orders as handed to their customers |
| `batch_approve()` | `POST /organizations/{id}/orders/batch-approve` | Record that customers confirmed several orders |
| `get_stock_availability(order_id)` | `GET /organizations/{id}/orders/{orderId}/stock-availability` | List the stocks an order's goods can leave from |
| `deliver(order_id)` | `POST /organizations/{id}/orders/{orderId}/deliver` | Deliver an order: make its delivery note |
| `invoice(order_id)` | `POST /organizations/{id}/orders/{orderId}/invoice` | Bill an order |
| `send(order_id)` | `POST /organizations/{id}/orders/{orderId}/send` | Send an order by e-mail |

### `myle.organization("organization_…").orders.status_history`

| Method | HTTP | Summary |
|---|---|---|
| `list(order_id)` | `GET /organizations/{id}/orders/{orderId}/status-history` | List an order's status history |

### `myle.organization("organization_…").delivery_notes`

| Method | HTTP | Summary |
|---|---|---|
| `get(delivery_note_id)` | `GET /organizations/{id}/delivery-notes/{deliveryNoteId}` | Get a delivery note |

### `myle.organization("organization_…").einvoicing`

| Method | HTTP | Summary |
|---|---|---|
| `get()` | `GET /organizations/{id}/einvoicing` | Get the organization's e-invoicing |
| `connect()` | `POST /organizations/{id}/einvoicing/connect` | Start connecting the organization to SuperPDP |
| `disconnect()` | `POST /organizations/{id}/einvoicing/disconnect` | Disconnect the organization from SuperPDP |
| `sync()` | `POST /organizations/{id}/einvoicing/sync` | Read the verification statuses from SuperPDP |
| `get_address()` | `GET /organizations/{id}/einvoicing/address` | Get the organization's electronic address |
| `replace_address()` | `PUT /organizations/{id}/einvoicing/address` | Choose the organization's electronic address |

### `myle.organization("organization_…").einvoices`

| Method | HTTP | Summary |
|---|---|---|
| `list_outgoing_failures()` | `GET /organizations/{id}/einvoices/outgoing-failures` | List the failed submissions |

### `myle.organization("organization_…").incoming_einvoices`

| Method | HTTP | Summary |
|---|---|---|
| `list()` | `GET /organizations/{id}/incoming-einvoices` | List the incoming e-invoices |
| `get(incoming_einvoice_id)` | `GET /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}` | Get an incoming e-invoice |
| `download_pdf(incoming_einvoice_id)` | `GET /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}` | Get an incoming e-invoice as a PDF file |
| `download_xml(incoming_einvoice_id)` | `GET /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}` | Get an incoming e-invoice as a XML file |
| `accept(incoming_einvoice_id)` | `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/accept` | Accept an incoming e-invoice |
| `refuse(incoming_einvoice_id)` | `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/refuse` | Refuse an incoming e-invoice |
| `dispute(incoming_einvoice_id)` | `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/dispute` | Dispute an incoming e-invoice |
| `accept_partially(incoming_einvoice_id)` | `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/accept-partially` | Accept an incoming e-invoice in part |
| `mark_paid(incoming_einvoice_id)` | `POST /organizations/{id}/incoming-einvoices/{incomingEinvoiceId}/mark-paid` | Mark an incoming e-invoice paid |

### `myle.organization("organization_…").payments_account`

| Method | HTTP | Summary |
|---|---|---|
| `get()` | `GET /organizations/{id}/payments-account` | Get the organization's Stripe account |
| `start_onboarding()` | `POST /organizations/{id}/payments-account/onboarding` | Start or resume the Stripe onboarding |
| `create_dashboard_link()` | `POST /organizations/{id}/payments-account/dashboard-link` | Open the Stripe dashboard |
| `get_online_payment_setting()` | `GET /organizations/{id}/payments-account/online-payment` | Get the online payment of invoices |
| `replace_online_payment_setting()` | `PUT /organizations/{id}/payments-account/online-payment` | Turn the online payment of invoices on or off |
| `list_sepa_fees()` | `GET /organizations/{id}/payments-account/sepa-fees` | List the SEPA debits' fees |
| `get_sepa_quota()` | `GET /organizations/{id}/payments-account/sepa-quota` | Get the SEPA quota |
