beel_generate_payment_event_draft
Build a reviewable draft invoice from a Stripe payment event that was not auto-invoiced, reusing the standard recipient and tax logic.
Instructions
Builds a draft invoice from a payment event that could not be invoiced automatically, applying the same recipient resolution and tax treatment the automatic flow would have applied, under the NIF in the path.
Draft only: the document is not issued, not numbered against the series and not emailed. Issue it yourself once it is right.
Eligible events: only those that produced no invoice can produce a draft; otherwise the request returns
400.Rejected documents: if invoicing rules reject the resulting document the request returns
422and no draft is created.
Endpoint: POST /v1/companies/{company_id}/payment-connections/{provider}/events/{event_id}/draft
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | Identifier of the payment event, as returned by the list operation. | |
| provider | Yes | Payment provider slug in **lowercase**. Currently only `stripe` (Stripe Connect) is operative; `woocommerce` and `shopify` are reserved for future providers. | |
| company_id | Yes | Unique identifier (UUID) of the company the events belong to — its identifier, not its NIF. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. | |
| idempotency_key | No | Optional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created. |