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

# Register a customer

> Registers the business the cargo is insured for, by its commercial registration (CR) number. When the commercial registry knows the business, its legal name and address come from there and the customer is `verified`; anything you send for those fields is ignored. When it does not, the call answers `40031`: send it again with `legal_name` and `address`, and the customer is kept as entered, `unverified`.

Registering a CR number you already registered updates that customer and answers `200` instead of `201`.



## OpenAPI

````yaml /cargo-api-reference/openapi.json post /customers
openapi: 3.0.1
info:
  title: OpenAPI For Cargo Insurance
  description: >-
    APIs to insure a single shipment or run a marine open cover for your
    customers
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.yasmina.ai/api/v1/cargo
security:
  - bearerAuth: []
paths:
  /customers:
    post:
      tags:
        - Customers
      summary: Register a customer
      description: >-
        Registers the business the cargo is insured for, by its commercial
        registration (CR) number. When the commercial registry knows the
        business, its legal name and address come from there and the customer is
        `verified`; anything you send for those fields is ignored. When it does
        not, the call answers `40031`: send it again with `legal_name` and
        `address`, and the customer is kept as entered, `unverified`.


        Registering a CR number you already registered updates that customer and
        answers `200` instead of `201`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                cr_number:
                  type: string
                  description: The business's 10-digit commercial registration number.
                  example: '1010456789'
                role:
                  type: string
                  description: >-
                    The business's part in the trade. One of the
                    `customer_roles` values from Get the options.
                contact:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      type: string
                      format: email
                    mobile:
                      type: string
                      example: '+966500000001'
                  required:
                    - name
                    - email
                    - mobile
                  description: The person at the business to contact about its policies.
                vat_number:
                  type: string
                  description: The business's 15-digit VAT number.
                legal_name:
                  type: string
                  description: Only used when the registry has no record of the CR number.
                legal_name_ar:
                  type: string
                  description: Only used when the registry has no record of the CR number.
                address:
                  type: object
                  properties:
                    building_number:
                      type: string
                    street:
                      type: string
                    district:
                      type: string
                    city:
                      type: string
                    postal_code:
                      type: string
                    country:
                      type: string
                      description: 'Two-letter country code, one of the `countries` values. '
                      example: SA
                  description: >-
                    Only used when the registry has no record of the CR number.
                    `street` and `city` are required when it is sent.
              required:
                - cr_number
                - role
                - contact
            example:
              cr_number: '1010456789'
              role: importer
              vat_number: '310123456700003'
              contact:
                name: Sara Alharbi
                email: sara@example.com
                mobile: '+966500000001'
      responses:
        '200':
          description: The customer you had already registered, updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '201':
          description: The customer, newly registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
              example:
                cr_number: '1010456789'
                legal_name: Sample Trading Company 6789
                legal_name_ar: شركة التجارة النموذجية 6789
                address:
                  building_number: '6789'
                  street: King Fahd Road
                  district: Al Olaya
                  city: Riyadh
                  postal_code: '16789'
                  country: SA
                role: importer
                vat_number: '310123456700003'
                contact:
                  name: Sara Alharbi
                  email: sara@example.com
                  mobile: '+966500000001'
                verification:
                  status: verified
                  source: commercial_registry
                  registration_status: active
                  checked_at: '2026-11-23T08:31:05+00:00'
                updated_at: '2026-11-23T08:31:05.000000Z'
                created_at: '2026-11-23T08:31:05.000000Z'
                id: 2
        '400':
          description: >-
            `40031` when the commercial registry has no record of the CR number
            and `legal_name` or `address` is missing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: '40031'
                message: >-
                  This commercial registration could not be verified. Send
                  legal_name and address to register the business manually.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    Customer:
      type: object
      properties:
        id:
          type: integer
        cr_number:
          type: string
        legal_name:
          type: string
        legal_name_ar:
          type: string
          nullable: true
        address:
          type: object
          properties:
            building_number:
              type: string
            street:
              type: string
            district:
              type: string
            city:
              type: string
            postal_code:
              type: string
            country:
              type: string
              description: 'Two-letter country code, one of the `countries` values. '
              example: SA
        role:
          type: string
        vat_number:
          type: string
          nullable: true
        contact:
          type: object
          properties:
            name:
              type: string
            email:
              type: string
              format: email
            mobile:
              type: string
              example: '+966500000001'
          required:
            - name
            - email
            - mobile
          description: The person at the business to contact about its policies.
        verification:
          type: object
          properties:
            status:
              type: string
              enum:
                - verified
                - unverified
            source:
              type: string
              description: >-
                `commercial_registry` when the legal name and address came from
                the registry, `manual` when you sent them.
              enum:
                - commercial_registry
                - manual
            registration_status:
              type: string
              nullable: true
              example: active
            checked_at:
              type: string
              format: date-time
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        details:
          type: object
          description: >-
            On `42201`, the messages for each field that failed, keyed by the
            field's path.
        missing_fields:
          type: array
          description: On `40033`, the shipment details still needed.
          items:
            type: string
        policy_id:
          type: integer
          description: On `40026`, the policy the quote was already issued as.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '40101'
            message: Unauthenticated
    UnprocessableEntity:
      description: A field is missing or not valid. `details` names each one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: '42201'
            message: >-
              The shipment.goods.description field cannot be empty. (and 1 more
              error)
            details:
              shipment.goods.description:
                - The shipment.goods.description field cannot be empty.
              shipment.goods.category:
                - The selected shipment.goods.category is invalid.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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