> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ignyt.si/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a line to an agent cart

> Adds a permitted catalog variant to the delegated shopper's cart, or increases its quantity. Requires an agent delegation credential with `cart:write`; the cart must belong to the delegated shopper. Earlier quotes become invalid; the same availability and currency errors as `POST /v1/carts/{cart_id}/lines` apply.



## OpenAPI

````yaml /agents-api.json post /v1/agent/carts/{cart_id}/lines
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 Agents API
  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: []
tags:
  - name: Grants and approval
    description: Partner-server calls that issue shopper grants and record exact approvals.
  - name: Agent identity
    description: The current delegation and its effective capabilities.
  - name: Discovery
    description: Merchants, products and variants the shopper may buy.
  - name: Checkout
    description: Read approval and start or follow delegated checkout.
  - name: Carts and quotes
    description: Shopper carts, lines, address, coupons and quotes.
  - name: Purchases
    description: The delegated shopper's purchase history.
paths:
  /v1/agent/carts/{cart_id}/lines:
    post:
      tags:
        - Carts and quotes
      summary: Add a line to an agent cart
      description: >-
        Adds a permitted catalog variant to the delegated shopper's cart, or
        increases its quantity. Requires an agent delegation credential with
        `cart:write`; the cart must belong to the delegated shopper. Earlier
        quotes become invalid; the same availability and currency errors as
        `POST /v1/carts/{cart_id}/lines` apply.
      operationId: add_line_v1_agent_carts__cart_id__lines_post
      parameters:
        - in: path
          name: cart_id
          required: true
          schema:
            title: Cart Id
            type: string
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LineIn'
        required: true
      responses:
        '200':
          content:
            application/json:
              example:
                attribution: {}
                country: AE
                coupon_codes:
                  con_01JDX3K2W7F5H9M3P8R4T6V2XA:
                    - WELCOME10
                currency: AED
                custom_fields: {}
                id: crt_01JDX3M8Q4RZ7V2K9T5N6B8C1D
                merchant_groups:
                  - connection_id: con_01JDX3K2W7F5H9M3P8R4T6V2XA
                    lines:
                      - line_id: lin_01JDX3N1A3C5E7G9J2L4N6Q8SD
                        merchant_id: mer_01JDX3J9C4D6F8H2K5M7P9R3TB
                        qty: 1
                        seen_unit_price_minor: 24900
                        sku: OUD-50
                        title: Royal Oud Perfume 50ml — 50ml
                        variant_id: var_01JDX3J4X6Z8B1D3F5H7K9M2PE
                review_reasons: []
                shipping_address:
                  city: Dubai
                  country: AE
                  emirate: Dubai
                  line1: 1 Example Street
                  name: Test Shopper
                  phone: '+971500000000'
                shopper_ref: shopper_8f3a1c
                status: open
                version: 4
              schema:
                $ref: '#/components/schemas/CartView'
          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: >-
            The resource does not exist or is not visible to this credential
            (`not_found`).
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The request conflicts with the resource's current state, repeats an
            idempotency key with a different body, or is not available here
            (`conflict`, `unsupported_operation` or a more specific code). Read
            the resource again before deciding how to proceed.
        '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:
        - AgentDelegation: []
components:
  schemas:
    LineIn:
      properties:
        qty:
          default: 1
          description: >-
            Units to add. Adding a variant already in the cart increases its
            quantity.
          minimum: 1
          title: Qty
          type: integer
        variant_id:
          description: Catalog variant identifier from `/v1/catalog` reads.
          examples:
            - var_01J8ZK
          title: Variant Id
          type: string
      required:
        - variant_id
      title: LineIn
      type: object
    CartView:
      description: >-
        A shopper cart: one market and currency, lines grouped by merchant
        connection.
      properties:
        attribution:
          additionalProperties: true
          description: Referral attribution, or `{}` when none is recorded.
          title: Attribution
          type: object
        country:
          description: ISO 3166-1 alpha-2 market country.
          title: Country
          type: string
        coupon_codes:
          additionalProperties:
            items:
              type: string
            type: array
          description: Coupon codes keyed by merchant `connection_id`.
          title: Coupon Codes
          type: object
        currency:
          description: ISO 4217 currency for every amount in this cart.
          title: Currency
          type: string
        custom_fields:
          additionalProperties: true
          description: Custom field values, or `{}`.
          title: Custom Fields
          type: object
        id:
          description: Cart identifier.
          title: Id
          type: string
        merchant_groups:
          description: Cart lines grouped by merchant connection.
          items:
            $ref: '#/components/schemas/CartMerchantGroup'
          title: Merchant Groups
          type: array
        review_reasons:
          description: >-
            Changes awaiting shopper review; empty unless `status` is
            `requires_review`.
          items:
            $ref: '#/components/schemas/CartReviewReason'
          title: Review Reasons
          type: array
        shipping_address:
          additionalProperties: true
          description: Delivery address, or `{}` until one is set.
          title: Shipping Address
          type: object
        shopper_ref:
          description: Your non-personal shopper reference.
          title: Shopper Ref
          type: string
        status:
          description: >-
            `open` accepts changes and quotes; `requires_review` needs
            `accept-review` after price or stock changes; `submitted` has a
            purchase; `closed` is no longer usable.
          enum:
            - open
            - requires_review
            - submitted
            - closed
          title: Status
          type: string
        version:
          description: Increases on every change; a quote is valid only for its version.
          title: Version
          type: integer
      required:
        - id
        - status
        - version
        - shopper_ref
        - country
        - currency
        - shipping_address
        - coupon_codes
        - custom_fields
        - attribution
        - review_reasons
        - merchant_groups
      title: CartView
      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
    CartMerchantGroup:
      properties:
        connection_id:
          description: Merchant connection; key coupon codes by this value.
          title: Connection Id
          type: string
        lines:
          description: Lines sold through this connection, oldest first.
          items:
            $ref: '#/components/schemas/CartLineView'
          title: Lines
          type: array
      required:
        - connection_id
        - lines
      title: CartMerchantGroup
      type: object
    CartReviewReason:
      additionalProperties: true
      description: A change the shopper must see before the cart can be quoted again.
      properties:
        available_qty:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Units the merchant still has. Present only for `sold_out` found
            while quoting.
          title: Available Qty
        from_minor:
          description: >-
            Unit price the shopper saw, in integer minor units. Present only for
            `price_changed`.
          title: From Minor
          type: integer
        line_id:
          description: Cart line affected by the change.
          title: Line Id
          type: string
        reason:
          description: >-
            Why review is needed: `price_changed`, `sold_out` or
            `merchant_unavailable`.
          title: Reason
          type: string
        sku:
          description: Merchant SKU of the affected line.
          title: Sku
          type: string
        to_minor:
          description: >-
            New merchant unit price, in integer minor units. Present only for
            `price_changed`.
          title: To Minor
          type: integer
      required:
        - line_id
        - sku
        - reason
      title: CartReviewReason
      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
    CartLineView:
      properties:
        line_id:
          description: Cart line identifier, used to change its quantity.
          title: Line Id
          type: string
        merchant_id:
          description: Merchant that sells this variant.
          title: Merchant Id
          type: string
        qty:
          description: Units on the line.
          title: Qty
          type: integer
        seen_unit_price_minor:
          description: >-
            Unit price shown when the line was added, in integer minor units of
            the cart currency.
          title: Seen Unit Price Minor
          type: integer
        sku:
          description: Merchant SKU.
          title: Sku
          type: string
        title:
          description: Product and variant title.
          title: Title
          type: string
        variant_id:
          description: Catalog variant identifier.
          title: Variant Id
          type: string
      required:
        - line_id
        - variant_id
        - sku
        - title
        - qty
        - seen_unit_price_minor
        - merchant_id
      title: CartLineView
      type: object
  securitySchemes:
    AgentDelegation:
      description: Shopper-bound downstream credential; never an MCP OAuth token.
      scheme: bearer
      type: http

````

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