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

# Exchange an application-managed payment authorization

> Private preview. Requires a verified application end-user OAuth grant for the selected AI, a transaction owned by that user, and a transaction-scoped Shared Payment Token. The application identity comes from the grant, never the request body. Retries require the same Idempotency-Key.



## OpenAPI

````yaml /openapi-v2.json post /act/transactions/{transactionId}/payment-authorizations
openapi: 3.1.0
info:
  title: Darwin API v2
  version: 2.0.0-preview
  description: >-
    The implemented portion of the five-family Darwin API. Operations are added
    only after runtime and contract verification.
servers:
  - url: https://api.darwin.so/api/v2
    description: Production — use live `darwin_…` keys.
  - url: https://api.dev.darwin.so/api/v2
    description: Sandbox — use isolated `darwin_test_…` keys.
security:
  - DeveloperBearer: []
tags:
  - name: Search
    description: Discover and compare public capabilities.
  - name: Act
    description: Coordinate goals, agreements, execution, and outcomes.
  - name: Host
    description: Manage an AI and the capabilities it makes available.
  - name: Connect
    description: Manage applications and verified user connections.
  - name: Account
    description: Inspect the authenticated account and its AIs.
paths:
  /act/transactions/{transactionId}/payment-authorizations:
    post:
      tags:
        - Act
      summary: Exchange an application-managed payment authorization
      description: >-
        Private preview. Requires a verified application end-user OAuth grant
        for the selected AI, a transaction owned by that user, and a
        transaction-scoped Shared Payment Token. The application identity comes
        from the grant, never the request body. Retries require the same
        Idempotency-Key.
      operationId: authorizeActTransactionPayment
      parameters:
        - name: transactionId
          in: path
          required: true
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: A caller-generated key, unique to this operation and payload.
          schema:
            type: string
            minLength: 1
            maxLength: 200
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - aiId
                - type
                - networkProfileId
                - grantedToken
              properties:
                aiId:
                  type: string
                  maxLength: 200
                type:
                  type: string
                  const: STRIPE_SHARED_PAYMENT_TOKEN
                networkProfileId:
                  type: string
                  maxLength: 200
                  description: >-
                    Darwin seller network identifier used when the application
                    provisions the SPT.
                grantedToken:
                  type: string
                  maxLength: 200
                  pattern: ^spt_[A-Za-z0-9]+$
                  writeOnly: true
                  description: >-
                    One transaction-scoped, time-limited Stripe Shared Payment
                    Token.
      responses:
        '201':
          description: The transaction-scoped payment authorization state.
          content:
            application/json:
              schema:
                type: object
                required:
                  - paymentAuthorization
                properties:
                  paymentAuthorization:
                    $ref: '#/components/schemas/ApplicationPaymentAuthorization'
        '400':
          description: The request was invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: The bearer key is missing, invalid, expired, or revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The principal does not have the required scope or resource access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The resource was not found for this principal.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ApplicationPaymentAuthorization:
      type: object
      additionalProperties: false
      required:
        - authorizationId
        - transactionId
        - status
      properties:
        authorizationId:
          type: string
        transactionId:
          type: string
        status:
          type: string
        providerPaymentIntentId:
          type:
            - string
            - 'null'
        nextActionRequired:
          type: boolean
        clientSecret:
          type:
            - string
            - 'null'
          writeOnly: true
    Error:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        error:
          type: string
  securitySchemes:
    DeveloperBearer:
      type: http
      scheme: bearer
      bearerFormat: Darwin API key
      description: >-
        Production keys begin with `darwin_`. Isolated sandbox keys begin with
        `darwin_test_`. Create keys in Developer settings.

````