> ## Documentation Index
> Fetch the complete documentation index at: https://808-labs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Grant or revoke automatic billing collection

> Grant (`automatic_collection=true`) or revoke (`false`) the workspace payer's consent to automatic invoice collection under the approved billing terms (`terms_id`). A grant must send `expected_generation` equal to the payer's current `consent_generation` (`409 billing_consent_stale` otherwise); revocation needs no generation. Requires a dashboard sign-in with the Owner or Admin role and recent sign-in verification. Exact retries reuse the body and `Idempotency-Key`; a new authorization needs a new key.

### Raw HTTP template

Replace path, credential and schema placeholders using valid resources. The planned host requires activation; use your assigned API URL meanwhile. Preserve a write's original idempotency key when its contract supports retry. If sending raw HTTP/1.1, use CRLF for request and header lines. Set Content-Length to the byte length of the final encoded body after replacing placeholders, including multipart delimiters and line endings.

```http
POST /v1/portal/workspaces/{tenant_id}/billing/consents?environment=REPLACE_WITH_VALID_VALUE HTTP/1.1
Host: sandbox.ignite-checkout.ai
Authorization: Bearer <CustomerOIDC-credential>
Idempotency-Key: <persisted-value-for-this-operation>
Content-Type: application/json
Content-Length: <body-length-in-bytes>

{
  "automatic_collection": true,
  "expected_generation": 0,
  "terms_id": "REPLACE_WITH_TERMS_ID"
}
```

### HTTP/2 header equivalent

Logical headers over negotiated HTTPS HTTP/2, not a wire-format message. The endpoint, JSON and idempotency rules are unchanged. See [HTTP and transport](/http-and-transports).

```text
:method: POST
:scheme: https
:authority: sandbox.ignite-checkout.ai
:path: /v1/portal/workspaces/{tenant_id}/billing/consents?environment=REPLACE_WITH_VALID_VALUE
authorization: Bearer <CustomerOIDC-credential>
idempotency-key: <persisted-value-for-this-operation>
content-type: application/json

{
  "automatic_collection": true,
  "expected_generation": 0,
  "terms_id": "REPLACE_WITH_TERMS_ID"
}
```



## OpenAPI

````yaml /api-reference.json post /v1/portal/workspaces/{tenant_id}/billing/consents
openapi: 3.1.0
info:
  description: >-
    Multi-merchant checkout infrastructure (808labs). UAE/AED first on Stripe;
    Saudi/SAR follows separate certification. OpenAPI is canonical; customers
    can integrate without an SDK. Customer dashboard authentication uses
    verified OIDC; workspace access requires an invitation or explicitly enabled
    Sandbox self-registration; machine integrations use scoped API keys. Plans
    and usage are defined in the developer guide. Internal operator and provider
    callback contracts are excluded.
  title: Ignyt
  version: 0.1.0
servers:
  - url: https://sandbox.ignite-checkout.ai
    description: 'Planned Sandbox host: use assigned deployment URL until activated'
  - url: https://api.ignite-checkout.ai
    description: 'Planned Production host: separate approval and Live credentials required'
security: []
paths:
  /v1/portal/workspaces/{tenant_id}/billing/consents:
    post:
      tags:
        - access
      summary: Grant or revoke automatic billing collection
      description: >-
        Grant (`automatic_collection=true`) or revoke (`false`) the workspace
        payer's consent to automatic invoice collection under the approved
        billing terms (`terms_id`). A grant must send `expected_generation`
        equal to the payer's current `consent_generation` (`409
        billing_consent_stale` otherwise); revocation needs no generation.
        Requires a dashboard sign-in with the Owner or Admin role and recent
        sign-in verification. Exact retries reuse the body and
        `Idempotency-Key`; a new authorization needs a new key.


        ### Raw HTTP template


        Replace path, credential and schema placeholders using valid resources.
        The planned host requires activation; use your assigned API URL
        meanwhile. Preserve a write's original idempotency key when its contract
        supports retry. If sending raw HTTP/1.1, use CRLF for request and header
        lines. Set Content-Length to the byte length of the final encoded body
        after replacing placeholders, including multipart delimiters and line
        endings.


        ```http

        POST
        /v1/portal/workspaces/{tenant_id}/billing/consents?environment=REPLACE_WITH_VALID_VALUE
        HTTP/1.1

        Host: sandbox.ignite-checkout.ai

        Authorization: Bearer <CustomerOIDC-credential>

        Idempotency-Key: <persisted-value-for-this-operation>

        Content-Type: application/json

        Content-Length: <body-length-in-bytes>


        {
          "automatic_collection": true,
          "expected_generation": 0,
          "terms_id": "REPLACE_WITH_TERMS_ID"
        }

        ```


        ### HTTP/2 header equivalent


        Logical headers over negotiated HTTPS HTTP/2, not a wire-format message.
        The endpoint, JSON and idempotency rules are unchanged. See [HTTP and
        transport](/http-and-transports).


        ```text

        :method: POST

        :scheme: https

        :authority: sandbox.ignite-checkout.ai

        :path:
        /v1/portal/workspaces/{tenant_id}/billing/consents?environment=REPLACE_WITH_VALID_VALUE

        authorization: Bearer <CustomerOIDC-credential>

        idempotency-key: <persisted-value-for-this-operation>

        content-type: application/json


        {
          "automatic_collection": true,
          "expected_generation": 0,
          "terms_id": "REPLACE_WITH_TERMS_ID"
        }

        ```
      operationId: consent_v1_portal_workspaces__tenant_id__billing_consents_post
      parameters:
        - in: path
          name: tenant_id
          required: true
          schema:
            maxLength: 40
            minLength: 1
            title: Tenant Id
            type: string
        - in: query
          name: environment
          required: true
          schema:
            enum:
              - sandbox
              - live
            title: Environment
            type: string
        - description: >-
            Required. A client-generated key that identifies this operation so
            it can be retried safely. Repeating the request with the same key
            and the same body returns the original result instead of performing
            the action again; reusing a key with a different body is rejected
            with `409`. After a timeout or network error, retry with the same
            key, never a new one.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            description: >-
              Required. A client-generated key that identifies this operation so
              it can be retried safely. Repeating the request with the same key
              and the same body returns the original result instead of
              performing the action again; reusing a key with a different body
              is rejected with `409`. After a timeout or network error, retry
              with the same key, never a new one.
            maxLength: 80
            minLength: 1
            pattern: ^[A-Za-z0-9_-]+$
            title: Idempotency-Key
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            examples:
              revoke:
                description: >-
                  Replace terms_id with the approved agreement; generation is
                  not required to revoke.
                summary: Revoke without a generation precondition
                value:
                  automatic_collection: false
                  terms_id: REPLACE_WITH_TERMS_ID
            schema:
              $ref: >-
                #/components/schemas/ignite__access__billing_api__collection__ConsentIn
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: Missing, expired or invalid credentials (`unauthorized`).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The credential is valid but lacks the required scope, role,
            environment or ownership for this resource (`forbidden` or a more
            specific code).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: Billing terms not found in the requested workspace and environment.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            billing_consent_stale: the supplied expected_generation no longer
            matches the payer's consent_generation. Read and review current
            consent before a fresh grant. Other conflicts include mismatched
            idempotency requests, an unprepared payer, or terms that do not
            permit automatic collection.
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      details:
                        anyOf:
                          - items:
                              properties:
                                loc:
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: integer
                                  type: array
                                msg:
                                  type: string
                                type:
                                  type: string
                              required:
                                - type
                                - loc
                                - msg
                              type: object
                            type: array
                          - type: object
                      message:
                        type: string
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - details
                      - request_id
                    type: object
                required:
                  - error
                type: object
          description: Validation Error
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            A plan allowance, rate limit or resource limit was reached. For
            `rate_limited` (a per-second ceiling) or the monthly API allowance
            (`plan_quota_exceeded`), wait for the `Retry-After` interval before
            retrying. A specific `*_rate_limited` code, such as
            `invitation_email_rate_limited`, is an hourly limit sent without
            `Retry-After`: retry later with bounded backoff. A resource limit
            described by the operation, such as active merchant requests or
            uploads, does not clear by waiting: complete or withdraw existing
            items first. Monthly allowance and cost limits never block servicing
            of accepted orders; per-second ceilings still apply to servicing
            routes.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying, sent only when the monthly API
                allowance is exhausted (`plan_quota_exceeded`) or a per-second
                rate limit (`rate_limited`) is reached; specific
                `*_rate_limited` codes omit it.
              schema:
                type: integer
      security:
        - CustomerOIDC: []
components:
  schemas:
    ignite__access__billing_api__collection__ConsentIn:
      additionalProperties: false
      example:
        automatic_collection: true
        expected_generation: 0
        terms_id: REPLACE_WITH_TERMS_ID
      examples:
        - automatic_collection: true
          expected_generation: 0
          terms_id: REPLACE_WITH_TERMS_ID
      oneOf:
        - properties:
            automatic_collection:
              const: true
            expected_generation:
              type: integer
          required:
            - automatic_collection
            - expected_generation
        - properties:
            automatic_collection:
              const: false
          required:
            - automatic_collection
      properties:
        automatic_collection:
          title: Automatic Collection
          type: boolean
        expected_generation:
          anyOf:
            - maximum: 2147483647
              minimum: 0
              type: integer
            - type: 'null'
          description: >-
            Required for automatic_collection=true; use consent_generation from
            the payer response.
          title: Expected Generation
        terms_id:
          maxLength: 40
          minLength: 1
          title: Terms Id
          type: string
      required:
        - terms_id
        - automatic_collection
      title: ConsentIn
      type: object
    IgniteErrorEnvelope:
      description: Document the existing error handler without changing its serialization.
      properties:
        error:
          $ref: '#/components/schemas/IgniteErrorDetail'
      required:
        - error
      title: IgniteErrorEnvelope
      type: object
    IgniteErrorDetail:
      description: Stable error fields; details remain open to each domain's JSON evidence.
      properties:
        code:
          title: Code
          type: string
        details:
          title: Details
        message:
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      required:
        - code
        - message
        - details
        - request_id
      title: IgniteErrorDetail
      type: object
  securitySchemes:
    CustomerOIDC:
      bearerFormat: JWT
      description: >-
        Customer access token; current membership, role and app selection are
        enforced. Protected actions use recent email-code verification in the
        configured Sandbox or recent authenticator verification in legacy
        password mode. Available when customer authentication is enabled.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.