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

# Initiate Checkout

> Agent initiates a checkout (purchase). Sends a push notification to the user for biometric approval of the payment amount + merchant. When invoked with a CIBA-approved token (approve:payment scope), the payment is auto-approved without a second push.



## OpenAPI

````yaml post /v1/checkout/initiate
openapi: 3.1.0
info:
  title: BKey API
  description: Biometric approval infrastructure for AI agents — OAuth 2.1 + CIBA
  version: 1.0.0
  contact:
    name: BKey
    url: https://bkey.id
    email: dev@bkey.id
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.bkey.id
    description: Production
security:
  - bearerAuth: []
tags:
  - name: OAuth
    description: OAuth 2.1 token, device auth, CIBA, revocation
  - name: Checkout
    description: Agent-initiated checkout with biometric approval
  - name: Vault
    description: Encrypted secret storage with biometric access
  - name: Payments
    description: Payment methods and shared payment tokens
  - name: Identity
    description: DID and identity management
paths:
  /v1/checkout/initiate:
    post:
      tags:
        - Checkout
      summary: Initiate Checkout
      description: >-
        Agent initiates a checkout (purchase). Sends a push notification to the
        user for biometric approval of the payment amount + merchant. When
        invoked with a CIBA-approved token (approve:payment scope), the payment
        is auto-approved without a second push.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                merchantName:
                  type: string
                  minLength: 1
                  maxLength: 256
                merchantDomain:
                  type: string
                  minLength: 1
                  maxLength: 512
                checkoutUrl:
                  type: string
                  format: uri
                  maxLength: 2048
                amount:
                  type: integer
                  minimum: 1
                currency:
                  type: string
                  minLength: 3
                  maxLength: 3
                  default: USD
                lineItems:
                  type: array
                  items:
                    type: object
                    properties:
                      title:
                        type: string
                        minLength: 1
                        maxLength: 256
                      quantity:
                        type: integer
                        minimum: 1
                      price:
                        type: integer
                        minimum: 0
                    required:
                      - title
                      - quantity
                      - price
                    additionalProperties: false
                  minItems: 1
                  maxItems: 50
                expiresInSecs:
                  type: integer
                  minimum: 60
                  maximum: 3600
                  default: 600
              required:
                - merchantName
                - merchantDomain
                - checkoutUrl
                - amount
                - lineItems
              additionalProperties: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  checkoutRequest:
                    type: object
                    properties:
                      id:
                        type: string
                      status:
                        type: string
                        description: >-
                          Initial status — "pending" for standard flow,
                          "approved" when created with a CIBA auto-approve
                          token, "completed" when the auto-approve Stripe
                          payment succeeded synchronously
                      challengeHex:
                        type: string
                      expiresAt:
                        type: string
                        format: date-time
                      createdAt:
                        type: string
                        format: date-time
                      sptId:
                        type: string
                        nullable: true
                        description: >-
                          Stripe Payment Token ID. Present when CIBA
                          auto-approve + Stripe payment succeeded synchronously.
                      paymentIntentId:
                        type: string
                        nullable: true
                        description: >-
                          Stripe PaymentIntent ID. Present when CIBA
                          auto-approve + Stripe payment succeeded synchronously.
                    required:
                      - id
                      - status
                      - challengeHex
                      - expiresAt
                      - createdAt
                    additionalProperties: false
                required:
                  - success
                  - checkoutRequest
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code
                      message:
                        type: string
                        description: Human-readable error message
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code
                      message:
                        type: string
                        description: Human-readable error message
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Stable machine-readable error code
                      message:
                        type: string
                        description: Human-readable error message
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - success
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: EdDSA-signed JWT obtained via OAuth 2.1 client_credentials or CIBA

````