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

# Add KYC Data

> Sends a customer's KYC data. The fields follow the customer's capabilities.

Add KYC Data

Add the Zapyd "Add KYC Data" call (`POST /cms/api/v1/kyc/add-data`) to my backend. Sends a customer's KYC data. The fields follow the customer's capabilities.

* Sandbox: `POST https://api-sandbox.zapyd.com/cms/api/v1/kyc/add-data`
* Production: `POST https://api.zapyd.com/cms/api/v1/kyc/add-data`

JSON body:

* `customer_id` (string, uuid, required): Zapyd customer ID from Create Customer.
* `tax_number` (string, optional): PAN for India. Required with PAYIN or India PAYOUT; optional for REMITTANCE\_PAYOUT. Example: `ABCPG1234N`.
* `income_range` (string, optional): Required for India PAYOUT without PAYIN. A configuration choice. Example: `10L-15L`.
* `profession` (string, optional): Required for India PAYOUT without PAYIN. A configuration choice. Example: `Private Sector Employee`.
* `full_name` (string, optional): Required with PAYIN. Name on the identity document. Example: `John Doe`.
* `phone` (string, optional): Required with PAYIN. National mobile number without country code. Example: `9911002211`.
* `full_address` (string, optional): Required with PAYIN. Optional without PAYIN. Residential address. Example: `FULL_ADDRESS_OF_THE_CUSTOMER`.
* `dob` (string, date, optional): Required with PAYIN. Date of birth, DD-MM-YYYY. Example: `DD-MM-YYYY`.
* `registered_date` (string, date, optional): Required with PAYIN. Registration date, DD-MM-YYYY. Example: `DD-MM-YYYY`.
* `document_type` (string, optional): Required with PAYIN: one of kyc.document\_types. Optional without PAYIN: ONLY\_PAN, GOVT\_ID or PASSPORT.
* `document_front_image_url` (string, optional): Front image URL. Required with PAYIN, except AADHAAR with aadhaar\_json. Optional without PAYIN.
* `document_back_image_url` (string, optional): Back image URL. Same rule as document\_front\_image\_url.
* `document_details` (object, optional): Required with PAYIN. Must include document\_number.
  * `document_number` (string, required): Document number: 6–20 letters, digits or hyphens. Example: `123456123456`.
  * `additional_data` (object, optional): For AADHAAR without images, send aadhaar\_json or aadhaar\_xml here.
* `selfie_url` (string, optional): Required with PAYIN. JPG, JPEG or PNG link.
* `additional_info` (object, optional): With PAYIN, the keys in kyc.additional\_info. Unknown keys are rejected.
* `street` (string, conditional): Required when address\_fields lists it. Example: `Av. Paulista 1000`.
* `city` (string, conditional): Required when address\_fields lists it. Example: `São Paulo`.
* `state_province` (string, conditional): Required when address\_fields lists it. Example: `SP`.
* `postal_code` (string, conditional): Required when address\_fields lists it. Example: `01310-100`.
* `account_holder_name` (string, optional): Name on the account. Example: `Maria Silva`.
* `beneficiary_identifiers` (object, conditional): Required when the payout method lists beneficiary\_identifiers.
* `ip_address` (string, optional): The end user's IP address. Example: `203.0.113.10`.

Success: HTTP 200, `{status: true, message, data}`. `data`: `id`, `status`, `failure_reason`, `capabilities`.
Errors (`{status: false, message, err_code, errors}`):

* 400 `Customer not found or access denied`: Customer not found; Customer does not belong to the organization
* 400 `KYC already exists`: KYC already exists for the customer
* 400 `KYC already in use`: KYC is being used by another customer
* 400 `Not accepted for this customer's capabilities`: Field not in the capabilities
* 400 `This field is required for `country\`\`: A field the customer's capabilities require is missing
* 400 `This field is required for IND PAYOUT customers`: A required India `PAYOUT` field is missing
* 400 `PAN is already linked to another customer within this organization`: `tax_number` belongs to another customer
* 500 `Internal Server Error`
  Every endpoint can also return 401 `AUTH_*` (signature, timestamp or key: fix, don't retry), and 429 or 5xx (retry with backoff).

Rules:

* Read `GET /kyc/configuration/{customer_id}` first. Without `PAYIN`, the first call verifies the customer: send the required fields, or only `customer_id` if none.
* Customer with `PAYIN` (KYC sharing, India only; USA uses `POST /kyc/generate-link`):
  Dates are DD-MM-YYYY. Image URLs Zapyd can download, never base64. The customer moves to `PROCESSING`. The result arrives as a `CUSTOMER` webhook, usually within 60 seconds (manual review up to 24 hours).
  On `FAILED`, fix only the failed part: `DOCUMENT_VERIFICATION_FAILED` with `PATCH /kyc/update-document-info`, `TAX_VERIFICATION_FAILED` with `PATCH /kyc/update-tax-info`. `KYC_FAILED` is final: contact support. 3 attempts per customer. A face mismatch holds it in `MANUAL_REVIEW`: wait.
  Payins in India need an Aadhaar-verified customer.

Signing (every request):

* Headers: `X-API-KEY`, `X-TIMESTAMP` (Unix seconds, within 300 s of server time; generate per request) and `X-SIGNATURE`.
* `X-SIGNATURE` = Base64(HMAC-SHA256(key = API secret, message = apiKey + "|" + timestamp + "|" + canonicalBody)). Base64 of the raw digest, not hex.
* canonicalBody: the JSON body with keys sorted at every nesting level, no whitespace (separators `,` and `:`), and every non-ASCII character escaped as lowercase `\uXXXX` (Python `json.dumps(body, sort_keys=True, separators=(",", ":"))`). Requests with no body (GET, DELETE) sign `{}`. Query parameters are not signed.
* Send the exact canonicalBody string you signed as the request body, with `Content-Type: application/json`.
* Test vector: key `3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d`, secret `test-secret-do-not-use`, timestamp `1735689600`. Signing `{}` gives `6sCtVSRQjU9+2/af8gdwUAvY1l6Ii6ENcbRfanPkhY0=`. Body `{"customer_id":"78c99d71-f28f-47a9-8302-93b286efbe0e","amount":100.5,"currency":"INR","meta":{"note":"Café","b":2,"a":1}}` gives `l+DvQrzlKbsOSxSYOdWoWHEehcFRZfDJPKlLDkm2cSI=`.

Deliver:

1. A typed `addKycData` function in this codebase's language and HTTP client. Reuse an existing Zapyd client and signer, or write one small shared client.
2. Config from `ZAPYD_API_KEY`, `ZAPYD_API_SECRET` and `ZAPYD_BASE_URL`. The secret stays on the server, never in a browser or app.
3. Return `data`. When `status` is false, throw an error with the HTTP status, `err_code`, `message` and `errors`. Don't show raw errors to end users.
4. Retry only 429 and 5xx: exponential backoff from 1 s, capped at 30 s, at most 5 attempts.
5. Amounts as strings. Types for every field above.
6. Tests: the signer against the test vector, and this call against sandbox.

Reference: `https://docs.zapyd.com/api-reference-exchange/endpoint/kyc/add-data.md`

## What to send

Read [Fetch KYC Configuration](https://docs.zapyd.com/api-reference-exchange/endpoint/kyc/configuration-\{customer_id}) first. It lists the fields for each of the customer's capabilities.

| Customer capabilities | Body | Result |
| - | - | - |
| With `PAYIN` | KYC sharing: identity document, selfie, personal details and `additional_info`. India only; USA customers use [Generate KYC Link](https://docs.zapyd.com/api-reference-exchange/endpoint/kyc/generate-link.md). | KYC starts as `PROCESSING` |
| Without `PAYIN` (`PAYOUT`, `REMITTANCE_PAYOUT` or both) | The required fields in `kyc.fields`, `address_fields` and the method's `beneficiary_identifiers`. A customer with none required sends only `customer_id`. | The first call verifies the customer. Until then it's `UNVERIFIED` |

India customers without `PAYIN`:

* `PAYOUT` requires `tax_number` (PAN), `income_range` and `profession`. The customer is `PROCESSING` while the PAN is checked, then `VERIFIED` or `FAILED`.
* `REMITTANCE_PAYOUT` alone takes only an optional `tax_number`. Send `{"customer_id": "..."}` to verify the customer without one. Sending `income_range` or `profession` returns 400.

`POST /customer/create` never verifies a customer without `PAYIN`, so call this endpoint before you quote.

> [!NOTE]
>
> Payins in India need an Aadhaar-verified customer.

## Error Codes and Messages

| API Status Code | Response | Reason |
| - | - | - |
| 400 | Customer not found or access denied | Customer not found |
| 400 | Customer not found or access denied | Customer does not belong to the organization |
| 400 | KYC already exists | KYC already exists for the customer |
| 400 | KYC already in use | KYC is being used by another customer |
| 400 | Not accepted for this customer's capabilities. | Field not in the capabilities |
| 400 | This field is required for `<country>`. | A field the customer's capabilities require is missing |
| 400 | This field is required for IND PAYOUT customers. | A required India `PAYOUT` field is missing |
| 400 | PAN is already linked to another customer within this organization. | `tax_number` belongs to another customer |
| 500 | Internal Server Error | Internal Server Error |


## OpenAPI

````yaml POST /kyc/add-data
openapi: 3.1.0
info:
  title: Zapyd API
  description: API for Zapyd - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-sandbox.zapyd.com/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://api-sandbox.zapyd.com
  - url: https://api-sandbox.zapyd.com/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://api-sandbox.zapyd.com
security:
  - ApiKeyAuth: []
    TimestampAuth: []
    SignatureAuth: []
tags:
  - name: Customer
    description: Customer related operations
    x-displayName: Customer
    x-traitTag: true
  - name: Payout
    description: Payout related operations
  - name: Webhooks
    description: Webhook related operations
  - name: Widget
    description: Hosted buy/sell widget session initialization
paths:
  /kyc/add-data:
    post:
      tags:
        - KYC
      description: >-
        Send a customer's KYC data; fields follow its capabilities. With PAYIN:
        KYC sharing (India). Without PAYIN: the first call verifies the
        customer.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - customer_id
              properties:
                customer_id:
                  type: string
                  format: uuid
                  example: 4e6f1b20-a73c-11ec-b909-0242ac120002
                  description: Zapyd customer ID from Create Customer.
                tax_number:
                  type: string
                  example: ABCPG1234N
                  description: >-
                    PAN for India. Required with PAYIN or India PAYOUT; optional
                    for REMITTANCE_PAYOUT.
                income_range:
                  type: string
                  description: >-
                    Required for India PAYOUT without PAYIN. A configuration
                    choice.
                  example: 10L-15L
                profession:
                  type: string
                  description: >-
                    Required for India PAYOUT without PAYIN. A configuration
                    choice.
                  example: Private Sector Employee
                full_name:
                  type: string
                  example: John Doe
                  description: Required with PAYIN. Name on the identity document.
                phone:
                  type: string
                  example: '9911002211'
                  description: >-
                    Required with PAYIN. National mobile number without country
                    code.
                full_address:
                  type: string
                  example: FULL_ADDRESS_OF_THE_CUSTOMER
                  description: >-
                    Required with PAYIN. Optional without PAYIN. Residential
                    address.
                dob:
                  type: string
                  format: date
                  example: DD-MM-YYYY
                  description: Required with PAYIN. Date of birth, DD-MM-YYYY.
                registered_date:
                  type: string
                  format: date
                  example: DD-MM-YYYY
                  description: Required with PAYIN. Registration date, DD-MM-YYYY.
                document_type:
                  type: string
                  description: >-
                    Required with PAYIN: one of kyc.document_types. Optional
                    without PAYIN: ONLY_PAN, GOVT_ID or PASSPORT.
                document_front_image_url:
                  type: string
                  description: >-
                    Front image URL. Required with PAYIN, except AADHAAR with
                    aadhaar_json. Optional without PAYIN.
                  format: uri
                document_back_image_url:
                  type: string
                  description: Back image URL. Same rule as document_front_image_url.
                  format: uri
                document_details:
                  type: object
                  required:
                    - document_number
                  properties:
                    document_number:
                      type: string
                      example: '123456123456'
                      description: 'Document number: 6–20 letters, digits or hyphens.'
                    additional_data:
                      type: object
                      description: >-
                        Optional. For AADHAAR without images, send aadhaar_json
                        or aadhaar_xml here.
                  description: Required with PAYIN. Must include document_number.
                selfie_url:
                  type: string
                  description: Required with PAYIN. JPG, JPEG or PNG link.
                  format: uri
                additional_info:
                  type: object
                  description: >-
                    Optional. With PAYIN, the keys in kyc.additional_info.
                    Unknown keys are rejected.
                street:
                  type: string
                  description: Required when address_fields lists it.
                  example: Av. Paulista 1000
                city:
                  type: string
                  description: Required when address_fields lists it.
                  example: São Paulo
                state_province:
                  type: string
                  description: Required when address_fields lists it.
                  example: SP
                postal_code:
                  type: string
                  description: Required when address_fields lists it.
                  example: 01310-100
                account_holder_name:
                  type: string
                  description: Optional. Name on the account.
                  example: Maria Silva
                beneficiary_identifiers:
                  type: object
                  description: >-
                    Required when the payout method lists
                    beneficiary_identifiers.
                  example:
                    beneficiary_id_doc_number: GODE561231HDFRRN09
                    beneficiary_dob: '1990-01-15'
                ip_address:
                  type: string
                  description: Optional. The end user's IP address.
                  example: 203.0.113.10
      responses:
        '200':
          description: KYC data added successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        example: 550e8400-e29b-41d4-a716-446655440000
                      status:
                        type: string
                        enum:
                          - UNVERIFIED
                          - PROCESSING
                          - MANUAL_REVIEW
                          - VERIFIED
                          - FAILED
                        description: Customer status.
                        example: PROCESSING
                      failure_reason:
                        type: string
                        example: null
                      capabilities:
                        type: array
                        items:
                          type: string
                          enum:
                            - PAYIN
                            - PAYOUT
                            - REMITTANCE_PAYOUT
                        description: The customer's capabilities.
                        example:
                          - PAYIN
                          - PAYOUT
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
      servers:
        - url: https://api-sandbox.zapyd.com/cms/api/v1
          description: KYC API Base URL
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key for authentication
    TimestampAuth:
      type: apiKey
      in: header
      name: X-TIMESTAMP
      description: Current timestamp in seconds since epoch
    SignatureAuth:
      type: apiKey
      in: header
      name: X-SIGNATURE
      description: HMAC SHA256 signature of the request encoded in Base64

````

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