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

# Replace a customer document

> Overwrite file bytes for an existing vault document (same ``id`` and ``category``). Use this to correct a document without creating a second slot — individuals are capped (e.g. ``address`` max 1; re-POST of the same category returns 400). Editable while ``incomplete`` or ``rejected``, or after failed deposit-account KYC (approved/active + deposit_account failed → demoted to incomplete). Approved + deposit_account ready stays locked for partners (409).



## OpenAPI

````yaml /api-reference/openapi.json put /partner/customers/{customer_id}/documents/{document_id}
openapi: 3.1.0
info:
  title: Element Pay Partner API
  description: >
    Provider-neutral fiat ↔ crypto ramps for partners. Discover corridors,
    create a binding quote, accept it, and receive webhooks. African local fiat
    (mobile money and bank) is auto-routed by corridor.


    ## Agent / integrator notes


    - Canonical machine-readable contract: `openapi.yaml` (this document) and
    `openapi.json`.

    - Human/agent quickstart: `docs/agents.md` - local fiat <-> USDC/USDT:
    `docs/integration-fiat-stablecoin.md` - gaps: `docs/KNOWN_GAPS.md`.

    - All partner routes are under `/partner/*` relative to the server base URL.

    - Settlement source of truth: webhooks (see `webhooks` section); poll `GET
    /partner/orders/{order_id}` as backup.
  version: 1.0.0
servers:
  - url: https://sandbox.elementpay.net/api/v1
    description: Sandbox (API keys prefixed is_test_)
  - url: https://api.elementpay.net/api/v1
    description: Production (API keys prefixed is_live_)
security:
  - APIKeyHeader: []
tags:
  - name: partner
    description: >-
      Corridor discovery, indicative rates, binding quotes, and order acceptance
      (including order-path account currency conversion rails). Customer ledger
      conversions use partner-customer-transfers `/conversions`.
    x-group: Partner
  - name: partner-customers
    description: >-
      Vault KYC: requirements, create, list, get/update, documents, submit, and
      revoke (`pcus_*`).
    x-group: Customers
  - name: partner-customer-accounts
    description: >-
      Customer deposit rails: open / list / get accounts and deposit
      instructions.
    x-group: Customer accounts
  - name: partner-customer-transfers
    description: >-
      On-ledger money movement: stablecoin sends, same-currency book transfers,
      and cross-currency conversions.
    x-group: Customer transfers
  - name: partner-customer-payouts
    description: >-
      External bank payouts: scheme discovery, local bank directory
      (NGN/GHS/CAD), preview, confirm, and status.
    x-group: Customer payouts
paths:
  /partner/customers/{customer_id}/documents/{document_id}:
    put:
      tags:
        - partner-customers
      summary: Replace a customer document
      description: >-
        Overwrite file bytes for an existing vault document (same ``id`` and
        ``category``). Use this to correct a document without creating a second
        slot — individuals are capped (e.g. ``address`` max 1; re-POST of the
        same category returns 400). Editable while ``incomplete`` or
        ``rejected``, or after failed deposit-account KYC (approved/active +
        deposit_account failed → demoted to incomplete). Approved +
        deposit_account ready stays locked for partners (409).
      operationId: >-
        partner_customer_replace_document_partner_customers__customer_id__documents__document_id__put
      parameters:
        - name: customer_id
          in: path
          required: true
          schema:
            type: string
            description: Public customer id returned on create
            examples:
              - pcus_a1b2c3d4e5f6
            title: Customer Id
            example: pcus_a1b2c3d4e5f6
          description: Public customer id returned on create
          example: pcus_a1b2c3d4e5f6
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: Public document id from GET customer or upload response
            examples:
              - pdoc_a1b2c3d4e5f6
            title: Document Id
            example: pdoc_a1b2c3d4e5f6
          description: Public document id from GET customer or upload response (`pdoc_*`)
          example: pdoc_a1b2c3d4e5f6
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PartnerCustomerDocumentReplaceRequest'
            examples:
              default:
                summary: Replace proof of address
                value:
                  content_base64: >-
                    JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvQ291bnQgMC9LaWRzW10+PmVuZG9iagp4cmVmCjAgMwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDA2OCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMy9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjEyMQolJUVPRgo=
                  content_type: application/pdf
                  file_name: utility_bill.pdf
            example:
              content_base64: >-
                JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvQ291bnQgMC9LaWRzW10+PmVuZG9iagp4cmVmCjAgMwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDA2OCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMy9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjEyMQolJUVPRgo=
              content_type: application/pdf
              file_name: utility_bill.pdf
      responses:
        '200':
          description: Document bytes replaced; same document id and category.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/PartnerCustomerDocumentReplaceSuccessResponse
              example:
                status: success
                message: Document replaced
                data:
                  document:
                    id: pdoc_a1b2c3d4e5f6
                    category: address
                    content_type: application/pdf
                    created_at: '2026-08-01T12:00:00+00:00'
                  customer:
                    id: pcus_a1b2c3d4e5f6
                    partner_customer_ref: cust-ke-001
                    type: individual
                    status: incomplete
                    profile:
                      first_name: Jane
                      last_name: Doe
                      email: jane@example.com
                      date_of_birth: '1990-01-15'
                      country_of_residence: GB
                      phone: '+447700900123'
                      gender: f
                      address:
                        line1: 1 Example Street
                        city: London
                        country: GB
                        postal_code: E1 6AN
                    documents:
                      - id: pdoc_a1b2c3d4e5f6
                        category: address
                        content_type: application/pdf
                        created_at: '2026-08-01T12:00:00+00:00'
                    products:
                      deposit_account:
                        status: none
                    missing: []
                    created_at: '2026-08-01T11:55:00+00:00'
                    updated_at: '2026-08-01T12:05:00+00:00'
                    submitted_at: null
        '400':
          description: Invalid content_type or content_base64
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type:
                      - object
                      - 'null'
              example:
                status: error
                message: content_type is required
                data:
                  field: content_type
                  allowed:
                    - application/pdf
                    - image/jpeg
                    - image/jpg
                    - image/png
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type:
                      - object
                      - 'null'
              example:
                status: error
                message: Unauthorized
                data: null
        '404':
          description: Document or customer not found for this API key
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type:
                      - object
                      - 'null'
              example:
                status: error
                message: Document not found
                data: null
        '409':
          description: Customer can no longer be modified
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type:
                      - object
                      - 'null'
              example:
                status: error
                message: Customer can no longer be modified
                data:
                  status: approved
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                type: object
                required:
                  - status
                  - message
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type:
                      - object
                      - 'null'
              example:
                status: error
                message: Validation error
                data: null
      security:
        - APIKeyHeader: []
components:
  schemas:
    PartnerCustomerDocumentReplaceRequest:
      properties:
        content_base64:
          type: string
          maxLength: 12000000
          minLength: 1
          title: Content Base64
          description: Base64-encoded file bytes (max ~8 MiB decoded).
          example: >-
            JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvQ291bnQgMC9LaWRzW10+PmVuZG9iagp4cmVmCjAgMwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDA2OCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMy9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjEyMQolJUVPRgo=
        content_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Type
          description: 'MIME type. Required: image/jpeg, image/png, or application/pdf.'
          examples:
            - image/jpeg
            - application/pdf
          example: application/pdf
        file_name:
          anyOf:
            - type: string
              maxLength: 128
            - type: 'null'
          title: File Name
          description: >-
            Optional original filename for the partner only; not stored in
            object keys.
          example: utility_bill.pdf
      type: object
      required:
        - content_base64
      title: PartnerCustomerDocumentReplaceRequest
      description: Replace bytes for an existing vault document (same id + category).
      example:
        content_base64: >-
          JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFI+PmVuZG9iagoyIDAgb2JqCjw8L1R5cGUvUGFnZXMvQ291bnQgMC9LaWRzW10+PmVuZG9iagp4cmVmCjAgMwowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMTUgMDAwMDAgbiAKMDAwMDAwMDA2OCAwMDAwMCBuIAp0cmFpbGVyCjw8L1NpemUgMy9Sb290IDEgMCBSPj4Kc3RhcnR4cmVmCjEyMQolJUVPRgo=
        content_type: application/pdf
        file_name: utility_bill.pdf
    PartnerCustomerDocumentReplaceSuccessResponse:
      type: object
      required:
        - status
        - message
        - data
      title: PartnerCustomerDocumentReplaceSuccessResponse
      properties:
        status:
          type: string
          enum:
            - success
          example: success
        message:
          type: string
          example: Document replaced
        data:
          $ref: '#/components/schemas/PartnerCustomerDocumentUploadData'
    PartnerCustomerDocumentUploadData:
      type: object
      required:
        - document
        - customer
      properties:
        document:
          $ref: '#/components/schemas/PartnerCustomerDocumentMeta'
        customer:
          $ref: '#/components/schemas/PartnerCustomerVaultRow'
      title: PartnerCustomerDocumentUploadData
    PartnerCustomerDocumentMeta:
      type: object
      required:
        - id
        - category
        - content_type
        - created_at
      properties:
        id:
          type: string
          description: Public document id (pdoc_*).
          example: pdoc_a1b2c3d4e5f6
        category:
          type: string
          description: Document key from requirements (e.g. identity, address).
          example: identity
        content_type:
          type: string
          example: application/pdf
        created_at:
          type: string
          format: date-time
      title: PartnerCustomerDocumentMeta
      description: Uploaded document metadata (no file bytes).
    PartnerCustomerVaultRow:
      type: object
      required:
        - id
        - partner_customer_ref
        - type
        - status
        - profile
        - documents
        - products
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Public customer id (pcus_*).
          example: pcus_a1b2c3d4e5f6
        partner_customer_ref:
          type: string
          description: Partner-stable customer reference.
          example: partner-cust-001
        type:
          type: string
          enum:
            - individual
            - business
        status:
          type: string
          enum:
            - incomplete
            - pending_review
            - approved
            - active
            - rejected
            - suspended
        profile:
          type: object
          description: Collected identity / KYB fields.
          additionalProperties: true
        documents:
          type: array
          items:
            $ref: '#/components/schemas/PartnerCustomerDocumentMeta'
          description: >-
            Document metadata. Populated on ref lookup and GET by id; often
            empty on unpaginated list rows.
        products:
          type: object
          required:
            - deposit_account
          properties:
            deposit_account:
              type: object
              required:
                - status
              properties:
                status:
                  type: string
                  enum:
                    - none
                    - provisioning
                    - ready
                    - failed
                    - unavailable
        missing:
          type: array
          items:
            type: string
          description: >-
            Present when status is incomplete — fields/docs still required
            before submit.
        review_note:
          type: string
          description: Partner-safe rejection summary when status is rejected.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        submitted_at:
          type:
            - string
            - 'null'
          format: date-time
      title: PartnerCustomerVaultRow
      description: One customer vault case returned to partners.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Partner API key. Sandbox keys start with `is_test_`; production keys
        start with `is_live_`. Keys are not interchangeable across environments.
        Send on every request. Never expose in browser or mobile clients.

````

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