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

# Bind a store transaction to a purchase intent

> Records the store transaction the device's purchase produced on the org's store purchase intent, for attribution only; nothing is granted until the store reports the purchase. Binding the same transaction again succeeds without change.



## OpenAPI

````yaml api-reference/openapi.account.json POST /billing/checkout-sessions/{checkoutSessionID}/transaction
openapi: 3.1.0
info:
  title: Aether Account & Integrations API
  version: 0.1.0
  description: >-
    Account, billing, and integration-management endpoints used by the Aether
    web app and CLI. Root-mounted; NOT part of the versioned /v1 contract.
servers:
  - url: https://api.runaether.dev
security:
  - bearerAuth: []
paths:
  /billing/checkout-sessions/{checkoutSessionID}/transaction:
    post:
      tags:
        - billing
      summary: Bind a store transaction to a purchase intent
      description: >-
        Records the store transaction the device's purchase produced on the
        org's store purchase intent, for attribution only; nothing is granted
        until the store reports the purchase. Binding the same transaction again
        succeeds without change.
      operationId: bindBillingCheckoutSessionTransaction
      parameters:
        - in: path
          name: checkoutSessionID
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/BindBillingCheckoutSessionTransactionRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                discriminator:
                  mapping:
                    credit_pack: '#/components/schemas/BillingCreditPackCheckoutSession'
                    inference_topup: '#/components/schemas/BillingInferenceTopUpCheckoutSession'
                    subscription: '#/components/schemas/BillingSubscriptionCheckoutSession'
                  propertyName: checkout_type
                oneOf:
                  - $ref: '#/components/schemas/BillingSubscriptionCheckoutSession'
                  - $ref: '#/components/schemas/BillingCreditPackCheckoutSession'
                  - $ref: '#/components/schemas/BillingInferenceTopUpCheckoutSession'
          description: OK
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/OrgAuthorizationErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
components:
  schemas:
    BindBillingCheckoutSessionTransactionRequest:
      additionalProperties: false
      properties:
        transaction_id:
          description: The store transaction the device's purchase produced.
          pattern: ^[A-Za-z0-9._:-]{1,128}$
          type: string
      required:
        - transaction_id
      type: object
    BillingCreditPackCheckoutSession:
      additionalProperties: false
      properties:
        amount_usd:
          format: double
          type: number
        checkout_session_id:
          format: uuid
          type: string
        checkout_session_token:
          pattern: ^pcs_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
        checkout_type:
          enum:
            - credit_pack
          type: string
        claimed_store_purchase:
          description: >-
            Present and true when binding the store transaction claimed the
            purchase the store had already reported: the intent completed and
            granted from it.
          type: boolean
        credit_pack_id:
          type: string
        credits:
          format: int64
          type: integer
        purchase_status:
          enum:
            - failed
            - granted
            - pending
            - pending_grant
          type: string
        status:
          enum:
            - created
            - completed
            - expired
            - failed
          type: string
        store_app_user_id:
          description: >-
            The store identity the device buys as. Present only when a store
            purchase intent is created.
          format: uuid
          type: string
        store_product_id:
          description: >-
            The store product the device buys. Present only when a store
            purchase intent is created.
          type: string
        url:
          description: >-
            The Stripe hosted checkout to open. Absent for a store purchase
            intent.
          type: string
      required:
        - checkout_session_id
        - checkout_session_token
        - checkout_type
        - status
        - purchase_status
        - credit_pack_id
        - credits
        - amount_usd
      type: object
    BillingInferenceTopUpCheckoutSession:
      additionalProperties: false
      properties:
        amount_usd:
          format: double
          type: number
        checkout_session_id:
          format: uuid
          type: string
        checkout_session_token:
          pattern: ^pcs_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
        checkout_type:
          enum:
            - inference_topup
          type: string
        claimed_store_purchase:
          description: >-
            Present and true when binding the store transaction claimed the
            purchase the store had already reported: the intent completed and
            granted from it.
          type: boolean
        fee_usd:
          format: double
          type: number
        purchase_status:
          enum:
            - failed
            - granted
            - pending
            - pending_grant
          type: string
        status:
          enum:
            - created
            - completed
            - expired
            - failed
          type: string
        store_app_user_id:
          description: >-
            The store identity the device buys as. Present only when a store
            purchase intent is created.
          format: uuid
          type: string
        store_product_id:
          description: >-
            The store product the device buys. Present only when a store
            purchase intent is created.
          type: string
        url:
          description: >-
            The Stripe hosted checkout to open. Absent for a store purchase
            intent.
          type: string
      required:
        - checkout_session_id
        - checkout_session_token
        - checkout_type
        - status
        - purchase_status
        - amount_usd
        - fee_usd
      type: object
    BillingSubscriptionCheckoutSession:
      additionalProperties: false
      properties:
        checkout_session_id:
          format: uuid
          type: string
        checkout_session_token:
          pattern: ^pcs_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          type: string
        checkout_type:
          enum:
            - subscription
          type: string
        claimed_store_purchase:
          description: >-
            Present and true when binding the store transaction claimed the
            purchase the store had already reported: the intent completed and
            granted from it.
          type: boolean
        status:
          enum:
            - created
            - completed
            - expired
            - failed
          type: string
        store_app_user_id:
          description: >-
            The store identity the device buys as. Present only when a store
            purchase intent is created.
          format: uuid
          type: string
        store_product_id:
          description: >-
            The store product the device buys. Present only when a store
            purchase intent is created.
          type: string
        subscription_status:
          enum:
            - active
            - failed
            - pending
            - pending_webhook
          type: string
        target_tier:
          enum:
            - starter
            - pro
            - max
            - team
          type: string
        url:
          description: >-
            The Stripe hosted checkout to open. Absent for a store purchase
            intent.
          type: string
      required:
        - checkout_session_id
        - checkout_session_token
        - checkout_type
        - status
        - target_tier
        - subscription_status
      type: object
    ErrorResponse:
      additionalProperties: false
      properties:
        code:
          type: string
        error:
          minLength: 1
          type: string
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
      required:
        - error
      type: object
    OrgAuthorizationErrorResponse:
      additionalProperties: false
      properties:
        code:
          enum:
            - org_membership_required
            - org_role_insufficient
            - org_suspended
            - account_deleting
          type: string
        error:
          minLength: 1
          type: string
      required:
        - error
        - code
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      scheme: bearer
      type: http

````

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