# Create business

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/businesses:
    post:
      summary: Create business
      deprecated: false
      description: >
        Create a business entity in the closed-loop ecosystem.

        When a business is created, the system automatically provisions an
        operational account and the corresponding wallet structure required for
        managing funds internally.


        This setup enables the business to participate in the closed-loop
        environment — allowing wallet creation, payouts, and internal transfers
        without connecting to external banking rails.


        ### Account Structure

        Account Type            |
        Description                                                           |
        Ownership           | Example        |

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

        **Clearance Account**   | Tracks all reconciliation and settlement
        inflows/outflows.            | System / Business   | `000019283740` |

        **Operational Account** | Holds the business’ active funds for payouts
        and internal transfers. | Business            | `100019283740` |
      operationId: create-business
      tags:
        - Vrtx Closed loop/Businesses
        - Businesses
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BusinessCreateRequest'
            examples:
              BusinessCreateRequest:
                value:
                  unified_number: '7009873774'
                  cr_number: '1234567811'
                  vat_number: '312345678900003'
                  official_name_ar: شركة فرتكس العربية
                  official_name_en: Vrtx Arabia Trading Co.
                  short_name_ar: فرتكس العربية
                  short_name_en: Vrtx KSA
                  cr_expiry_date: '2025-12-31T00:00:00.000Z'
                  email: ops@vrtx.sa
                  mobile: '+966501234567'
                  status: ACTIVE
                summary: BusinessCreateRequest
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                x-apidog-orders: []
                properties: {}
                x-apidog-ignore-properties: []
              examples:
                BusinessCreated:
                  summary: BusinessCreated
                  value:
                    id: 85fee10b-e47f-46c6-b5c3-e0d34c5060b3
                    unified_number: '7000102991'
                    cr_number: '1234567897'
                    vat_number: '312345678900003'
                    official_name_ar: شركة فرتكس العربية
                    official_name_en: Vrtx Arabia Trading Co.
                    short_name_ar: فرتكس العربية
                    short_name_en: Vrtx KSA
                    cr_expiry_date: '2025-12-31T00:00:00.000Z'
                    email: ops@vrtx.sa
                    mobile: '+966501234567'
                    prefix3: '103'
                    account_number: '010300006011'
                    status: ACTIVE
                    created_at: '2025-10-25T12:35:16.446Z'
                    updated_at: '2025-10-25T12:35:16.446Z'
          headers: {}
          x-apidog-name: Created
        '400':
          description: Bad Request
          content:
            application/json:
              schema: &ref_0
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequest:
                  summary: BadRequest
                  value:
                    error_code: INVALID_INPUT
                    error_message: Input parameters failed validation
                    details:
                      - field: unified_number
                        message: Invalid unified number format
                        code: invalid_format
                    status_code: 400
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Not Authorized
          content:
            application/json:
              schema: *ref_0
              examples:
                Unauthorized:
                  summary: Unauthorized
                  value:
                    error_code: UNAUTHORIZED_ACCESS
                    error_message: You are not authorized to access this resource.
                    details:
                      - field: authorization
                        message: Valid Bearer token required
                        code: unauthorized_access
                    status_code: 401
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: Not Allowed
          content:
            application/json:
              schema: *ref_0
              examples:
                Forbidden:
                  summary: Forbidden
                  value:
                    error_code: FORBIDDEN
                    error_message: Forbidden
                    details:
                      - field: authorization
                        message: Insufficient permissions to access this resource
                        code: forbidden
                    status_code: 403
          headers: {}
          x-apidog-name: Forbidden
      security:
        - bearerAuth3: []
          x-apidog:
            schemeGroups:
              - id: RgHLLn0Mheg4mscnX1GEc
                schemeIds:
                  - bearerAuth3
            required: true
            use:
              id: RgHLLn0Mheg4mscnX1GEc
            scopes:
              RgHLLn0Mheg4mscnX1GEc:
                bearerAuth3: []
      x-apidog-folder: Vrtx Closed loop/Businesses
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1053095/apis/api-24814163-run
components:
  schemas:
    BusinessCreateRequest:
      type: object
      required:
        - cr_number
        - vat_number
      description: Request body for registering a business.
      properties:
        unified_number:
          type: string
          examples:
            - '7123456787'
          pattern: 7\d{9}
          description: Unified national number
        cr_number:
          type: string
          examples:
            - '1234567890'
          pattern: ^[0-9]{10}$
          description: Commercial registration number
        vat_number:
          type: string
          examples:
            - '312345678900003'
          pattern: ^3\d{12}03$
          description: VAT registration number (15 digits, starts with 3 and ends with 03)
        official_name_ar:
          type: string
          examples:
            - شركة فرتكس العربية
          maxLength: 240
          description: Official Arabic name
        official_name_en:
          type: string
          examples:
            - Vrtx Arabia Trading Co.
          maxLength: 240
          description: Official English name
        short_name_ar:
          type: string
          minLength: 1
          examples:
            - فرتكس العربية
          maxLength: 120
          description: Short Arabic name
        short_name_en:
          type: string
          minLength: 1
          examples:
            - Vrtx KSA
          maxLength: 120
          description: Short English name
        cr_expiry_date:
          type: string
          examples:
            - '2025-12-31T00:00:00.000Z'
          pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2}$
          description: Commercial registration expiry date
        email:
          type: string
          examples:
            - ops@vrtx.sa
          description: Contact email
        mobile:
          type: string
          examples:
            - '+966501234567'
          description: Contact phone in E.164 format
        status:
          type: string
          examples:
            - ACTIVE
          pattern: ^(?i)(ACTIVE|INACTIVE)$
          description: Business status
      x-apidog-orders:
        - unified_number
        - cr_number
        - vat_number
        - official_name_ar
        - official_name_en
        - short_name_ar
        - short_name_en
        - cr_expiry_date
        - email
        - mobile
        - status
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ErrorResponse:
      type: object
      properties:
        error_code:
          type: string
        error_message:
          type: string
        details:
          type: array
          items:
            $ref: '#/components/schemas/ErrorDetail'
        status_code:
          type: integer
          format: int32
      x-apidog-orders:
        - error_code
        - error_message
        - details
        - status_code
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
        code:
          type: string
      x-apidog-orders:
        - field
        - message
        - code
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth1:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
    bearerAuth2:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth3:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT issued by Keycloak. The client_id/azp in the token must map to a
        configured tenant (public, fai, neomrs; e.g., fai-sandbox -> fai) or
        requests will return 403.
    bearerAuth4:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.sandbox.vrtx.sa
    description: Sandbox
security:
  - bearer: []

```
