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

# Submit a contract confirmation

> Records a contract event for the milestone — exactly one action per call. Send `party_id` to record a contractor's completion confirmation (the contract record is created implicitly on the first event). Send `client_confirmed` to relay the client's final decision: `true` checks that every contractor assigned to the milestone has confirmed and, if complete, disburses the milestone to each party per its split — if confirmations are missing, the contract is rejected and flagged for PCX review; `false` rejects the contract immediately. `agency_notes` is only accepted alongside `client_confirmed`. Requires the `escrow` feature.




## OpenAPI

````yaml /api-reference/external/openapi.yaml post /virtual-accounts/escrow/{escrow_id}/milestones/{milestone_id}/contract
openapi: 3.0.3
info:
  title: PCX API
  description: >
    The PCX integration API. Every request requires two headers: `Authorization`
    (Bearer JWT for user-facing flows, or the literal string `NONE`) and
    `X-Api-Key` (your API key for server-to-server calls, or the literal string
    `NONE`). Pass `NONE` for whichever header you are not using.
  version: '1.0'
servers:
  - url: https://prod-api.pcxpay.com/v1
    description: Production
  - url: https://devs.pcxpay.com/v1
    description: Development
security: []
tags:
  - name: Payment Initiation
    description: Initiate payments and poll for status
  - name: API Keys
    description: Create and manage API keys for programmatic access
  - name: Webhooks
    description: Register endpoints and receive transaction notifications
  - name: Beneficiaries
    description: Manage payment recipients
  - name: Payments
    description: Initiate and track payments
  - name: Bank Validation
    description: Validate bank accounts before initiating a payment
  - name: Transactions
    description: Query the financial transaction ledger
  - name: Virtual Accounts
    description: Multi-currency virtual account provisioning and fund operations
  - name: Payment Links
    description: Generate shareable payment links for customer checkout
  - name: Escrow
    description: Milestone-based escrow projects, parties, contracts, and funding
paths:
  /virtual-accounts/escrow/{escrow_id}/milestones/{milestone_id}/contract:
    parameters:
      - $ref: '#/components/parameters/AuthorizationHeader'
      - $ref: '#/components/parameters/XApiKeyHeader'
    post:
      tags:
        - Escrow
      summary: Submit a contract confirmation
      description: >
        Records a contract event for the milestone — exactly one action per
        call. Send `party_id` to record a contractor's completion confirmation
        (the contract record is created implicitly on the first event). Send
        `client_confirmed` to relay the client's final decision: `true` checks
        that every contractor assigned to the milestone has confirmed and, if
        complete, disburses the milestone to each party per its split — if
        confirmations are missing, the contract is rejected and flagged for PCX
        review; `false` rejects the contract immediately. `agency_notes` is only
        accepted alongside `client_confirmed`. Requires the `escrow` feature.
      operationId: submitEscrowContract
      parameters:
        - name: escrow_id
          in: path
          required: true
          schema:
            type: string
        - name: milestone_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EscrowContractActionRequest'
      responses:
        '201':
          description: Updated contract record
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/StandardResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/EscrowContract'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          description: >
            Conflicting confirmation — e.g. the party has already confirmed, or
            the milestone has already been disbursed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      description: >-
        Bearer JWT for user-facing flows (`Bearer eyJraWQ...`), or the literal
        string `NONE` when authenticating via API key.
      schema:
        type: string
        default: NONE
        example: Bearer eyJraWQ...
    XApiKeyHeader:
      name: X-Api-Key
      in: header
      required: true
      description: >-
        API key for server-to-server flows, or the literal string `NONE` when
        authenticating via JWT.
      schema:
        type: string
        default: NONE
        example: pcx_abc123_xxxx
  schemas:
    EscrowContractActionRequest:
      type: object
      description: |
        Exactly one of `party_id` or `client_confirmed` must be provided.
      properties:
        party_id:
          type: string
          description: Record this contractor's completion confirmation
        client_confirmed:
          type: boolean
          description: Relay the client's final decision on the milestone
        agency_notes:
          type: string
          description: Only accepted alongside `client_confirmed`
    StandardResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - success
            - error
          example: success
        message:
          type: string
    EscrowContract:
      type: object
      properties:
        contract_id:
          type: string
        milestone_id:
          type: string
        created_at:
          type: string
        status:
          $ref: '#/components/schemas/EscrowContractStatus'
        contractor_confirmations:
          type: array
          items:
            $ref: '#/components/schemas/EscrowContractorConfirmation'
        client_confirmed_at:
          type: string
          nullable: true
        agency_notes:
          type: string
          nullable: true
        reviewed_at:
          type: string
          nullable: true
        rejection_reason:
          type: string
          nullable: true
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
        status:
          type: string
          enum:
            - error
    EscrowContractStatus:
      type: string
      enum:
        - pending_review
        - approved
        - rejected
      example: approved
    EscrowContractorConfirmation:
      type: object
      properties:
        party_id:
          type: string
        confirmed_at:
          type: string
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Insufficient permissions
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````