beel_initiate_payment_connection
Generates an authorization URL for a company to connect a payment provider like Stripe. The holder approves to activate the connection.
Instructions
Opens an authorization session so the holder of a NIF (company) your account
manages can connect a payment provider (stripe), and returns the
authorization_url where they authorize it. Once they do, BeeL's callback finalizes
the connection and redirects back to the return_url of your portal, if you supplied
one, with the parameters described under return_url.
The connection is created only when the holder authorizes, so it does not appear in
GET /v1/companies/{company_id}/payment-connections until then. It is sealed under
the NIF in the path, so auto-invoicing issues under that NIF.
The NIF must be activated in the mode of your API key (beel_sk_test_* → Test,
beel_sk_live_* → Live); otherwise the request answers 400
COMPANY_NOT_ACTIVATED_IN_ENVIRONMENT and no authorization_url is issued, because
without activation there is no invoice series or tax configuration to invoice with.
Test and Live activations are independent — a NIF activated in one mode still needs
activating in the other.
Endpoint: POST /v1/companies/{company_id}/payment-connections/authorizations
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| company_id | Yes | NIF (company) the authorization is opened for. 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 NIF you do not reach answers `403`, and so does a NIF 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. |