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

# Register User

> Registers a user (end customer) under your company. Available for the B2B2B model. The user starts as `pending` and can operate once Kravata approves it.

#### Request

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| Authorization | Header | Yes | `Bearer <access>` obtained from **POST /api/token**. |
| clientId | Path | Yes | Your client ID, from **GET /api/infoClient**. |
| relatedUserId | Query | No | Register the user under one of your existing users instead of directly under your company. |

#### Request Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| constitutionCountry | object | Yes | `{"code": "CO"}` and/or `{"name": "Colombia"}`, from **GET /api/helpers/countries**. |
| constitutionCity | string | Yes | City name, from **GET /api/helpers/cities**. |
| constitutionState | string | No | Department, state or province. |
| constitutionDate | string | No | Incorporation date, or birth date for natural persons. Format `YYYY-MM-DD`. |
| tradeName | string | No | Commercial name, or full legal name for natural persons. |
| person | object | Yes | Identity data (below). |
| person.identificationType | string | Yes | `cc`, `nit`, `ce`, `pp` or `nitf` (foreign tax ID). |
| person.identificationNro | string | Yes, except `nitf` | ID number (max 32 characters). |
| person.verificateDigit | integer | No | Verification digit, for `nit`. |
| person.businessName | string | Yes for `nitf` | Legal name of the company or person. |
| person.firstName / middleName / firstSurname / lastName | string | No | Names of a natural person (max 50 characters each). |
| person.contactsData | array | Yes | Contacts as `{"dataTypeContact", "dataValue", "postalCode", "city"}`. Must include at least one `email` and one `address`. |

If a person with the same ID type and number already exists, it is reused.

#### Response

The registered user, with the same fields as **GET /api/b2b2b/&#123;clientId&#125;/users**.



## OpenAPI

````yaml /business/openapi.json post /api/b2b2b/{clientId}/users
openapi: 3.1.0
info:
  title: Kravata Business API
  version: '1.0'
  description: >-
    Kravata Business API: on-ramp and off-ramp orders, accounts and wallets,
    users, custody wallets and transfers.
servers:
  - url: https://testapi.kravata.co
    description: Test
  - url: https://apiv2.kravata.co
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Accounts
  - name: Wallets
  - name: Users
  - name: Ramp Orders
  - name: Custody
  - name: Webhooks
paths:
  /api/b2b2b/{clientId}/users:
    post:
      tags:
        - Users
      summary: Register User
      description: >-
        Registers a user (end customer) under your company. Available for the
        B2B2B model. The user starts as `pending` and can operate once Kravata
        approves it.


        #### Request


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | Authorization | Header | Yes | `Bearer <access>` obtained from **POST
        /api/token**. |

        | clientId | Path | Yes | Your client ID, from **GET /api/infoClient**.
        |

        | relatedUserId | Query | No | Register the user under one of your
        existing users instead of directly under your company. |


        #### Request Body


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | constitutionCountry | object | Yes | `{"code": "CO"}` and/or `{"name":
        "Colombia"}`, from **GET /api/helpers/countries**. |

        | constitutionCity | string | Yes | City name, from **GET
        /api/helpers/cities**. |

        | constitutionState | string | No | Department, state or province. |

        | constitutionDate | string | No | Incorporation date, or birth date for
        natural persons. Format `YYYY-MM-DD`. |

        | tradeName | string | No | Commercial name, or full legal name for
        natural persons. |

        | person | object | Yes | Identity data (below). |

        | person.identificationType | string | Yes | `cc`, `nit`, `ce`, `pp` or
        `nitf` (foreign tax ID). |

        | person.identificationNro | string | Yes, except `nitf` | ID number
        (max 32 characters). |

        | person.verificateDigit | integer | No | Verification digit, for `nit`.
        |

        | person.businessName | string | Yes for `nitf` | Legal name of the
        company or person. |

        | person.firstName / middleName / firstSurname / lastName | string | No
        | Names of a natural person (max 50 characters each). |

        | person.contactsData | array | Yes | Contacts as `{"dataTypeContact",
        "dataValue", "postalCode", "city"}`. Must include at least one `email`
        and one `address`. |


        If a person with the same ID type and number already exists, it is
        reused.


        #### Response


        The registered user, with the same fields as **GET
        /api/b2b2b/&#123;clientId&#125;/users**.
      operationId: register-user
      parameters:
        - name: clientId
          in: path
          required: true
          description: ''
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                constitutionDate:
                  type: string
                tradeName:
                  type: string
                constitutionCountry:
                  type: object
                  properties:
                    code:
                      type: string
                constitutionState:
                  type: string
                constitutionCity:
                  type: string
                person:
                  type: object
                  properties:
                    firstName:
                      type: string
                    middleName:
                      type: string
                    lastName:
                      type: string
                    identificationType:
                      type: string
                    identificationNro:
                      type: string
                    verificateDigit:
                      type: integer
                    businessName:
                      type: string
                    contactsData:
                      type: array
                      items:
                        type: object
                        properties:
                          dataTypeContact:
                            type: string
                          dataValue:
                            type: string
                          postalCode:
                            type: string
                          city: {}
            example:
              constitutionDate: '2002-04-13'
              tradeName: TEST K USER 1
              constitutionCountry:
                code: CO
              constitutionState: Cundinamarca
              constitutionCity: Bogotá
              person:
                firstName: TEST
                middleName: K
                lastName: USER
                identificationType: nit
                identificationNro: '223333222'
                verificateDigit: 8
                businessName: TEST K USER 1
                contactsData:
                  - dataTypeContact: address
                    dataValue: Fake Street 123
                    postalCode: None
                    city: null
                  - dataTypeContact: email
                    dataValue: user@example.com
                  - dataTypeContact: phone
                    dataValue: '3001234567'
      responses:
        '200':
          description: Successful response
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Access token from POST /api/token (valid 5 minutes).

````