beel_discard_payment_event
Discard a payment event, removing it and all eligible events sharing its payment identity from the default list while retaining them in the audit trail for restoration.
Instructions
Removes a payment event from the default list (soft delete). The event stays in the audit trail and can be brought back with the restore operation.
The operation applies to the whole payment the event belongs to. Its scope is every active,
eligible event of the connection that shares the payment identity of the event named in
the request: when the event carries a payment identifier (external_payment_id), every
event with that same identifier, whatever its kind (the sale, its failed attempts, its
refunds); otherwise, when it carries a source object (source_object_id, such as a credit
note or a dispute), every event with that same source object; otherwise, the event alone.
All of them are discarded together, in a single transaction and with the same deleted_at
timestamp. Events that are not eligible remain unchanged, and so do events still in
RECEIVED state other than the one named in the request: they have not been processed
yet and are left for processing. The response carries the event named in the request.
Eligible events: an event already linked to an issued invoice, or currently being processed, cannot be discarded; the request returns
400.
Endpoint: POST /v1/companies/{company_id}/payment-connections/{connection_id}/events/{event_id}/discard
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | Identifier of the payment event, as returned by the list operation. | |
| 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. | |
| connection_id | Yes | Unique identifier (UUID) of the payment connection the operation acts on, as returned by `GET /v1/companies/{company_id}/payment-connections`. A NIF can hold several connections of the same provider, so the provider slug alone does not name one. A connection of another NIF answers `404`, exactly like one that does not exist. | |
| 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. |