---
title: "Associate Customer"
method: POST
path: "/customers/bulk"
---

# Associate Customer

`POST /customers/bulk`

Lets you batch register customers, or associate a customer with company or hierarchy. This API registers parent and child customers (if not registered), and associates the customer with hierarchy code, company role, parent and child customers.

## Headers

- `X-CAP-API-OAUTH-TOKEN` string

## Request body

- object
  - `loyaltyInfo` object
    - `loyaltyType` 'loyalty' | 'non-loyalty'
  - `profiles` object — Meta information of the customer.
    - `firstName` string
    - `lastName` string
    - `identifiers` object
      - `type` 'mobile' | 'email' | 'externalId' | 'wechat' | 'martjackId' | 'fbId mobile' | 'tmall_uname' | 'cuid' | 'ali_uname' | 'jd_uname' | 'vip_uname' | 'mobilePush' | 'line' | 'card'
    - object
      - `identifiers` object
        - `value` string
        - `seriesId` integer
        - `seriesCode` string
        - `statusLabel` string
        - `lastViewedDate` string, date
  - `RAW_BODY` string, json

## Response `200`

200

- object[]
  - `entity` object
    - `id` integer
    - `profiles` object[]
      - `firstName` string
      - `lastName` string
      - `attribution` object
        - `createDate` string
        - `createdBy` object
          - `id` integer
          - `code` string
          - `description` string
          - `name` string
          - `type` string
          - `adminType` string
          - `isActive` boolean
          - `isOuEnabled` boolean
          - `timeZoneId` integer
          - `currencyId` integer
          - `languageId` integer
        - `modifiedBy` object
          - `id` integer
          - `code` string
          - `description` string
          - `name` string
          - `type` string
          - `adminType` string
          - `isActive` boolean
          - `isOuEnabled` boolean
          - `timeZoneId` integer
          - `currencyId` integer
          - `languageId` integer
        - `modifiedDate` string
      - `fields` object
        - `gender` string
      - `identifiers` object[]
        - `type` string
        - `value` string
      - `commChannels` object[]
        - `type` string
        - `value` string
        - `primary` boolean
        - `verified` boolean
        - `meta` object
          - `residence` boolean
          - `office` boolean
        - `attributes` object
      - `source` string
      - `userId` integer
      - `accountId` string
      - `conflictingProfileList` unknown[]
        - unknown
      - `autoUpdateTime` string
      - `identifiersAll` object[]
        - `type` string
        - `value` string
    - `loyaltyInfo` object
      - `loyaltyType` string
    - `segments` object
    - `referralCode` string
    - `associationDetails` object
      - `hierarchyCode` string
      - `hierarchyId` integer
      - `roleCode` string
      - `childCustomers` object[]
        - `profiles` object[]
          - `firstName` string
          - `lastName` string
          - `attribution` object
            - `createDate` string
            - `createdBy` object
              - …
            - `modifiedBy` object
              - …
            - `modifiedDate` string
          - `fields` object
            - `gender` string
          - `identifiers` object[]
            - `type` string
            - `value` string
          - `commChannels` object[]
            - `type` string
            - `value` string
            - `primary` boolean
            - `verified` boolean
            - `meta` object
              - …
            - `attributes` object
          - `source` string
          - `userId` integer
          - `accountId` string
          - `conflictingProfileList` unknown[]
            - unknown
          - `autoUpdateTime` string
          - `identifiersAll` object[]
            - `type` string
            - `value` string
        - `extendedFields` object
          - `city` string
          - `gender` string
      - `fleetCompany` object
        - `externalId` string
        - `companyId` integer
      - `childRoleCode` string
      - `skipLevelAllowed` boolean
      - `new` boolean
      - `childCustomer` boolean
    - `extendedFields` object
      - `city` string
      - `gender` string
    - `warnings` object[]
      - `status` boolean
      - `code` integer
      - `message` string
  - `childEntities` object[]
    - `id` integer
    - `profiles` object[]
      - `firstName` string
      - `lastName` string
      - `attribution` object
        - `createDate` string
        - `createdBy` object
          - `id` integer
          - `code` string
          - `description` string
          - `name` string
          - `type` string
          - `adminType` string
          - `isActive` boolean
          - `isOuEnabled` boolean
          - `timeZoneId` integer
          - `currencyId` integer
          - `languageId` integer
        - `modifiedBy` object
          - `id` integer
          - `code` string
          - `description` string
          - `name` string
          - `type` string
          - `adminType` string
          - `isActive` boolean
          - `isOuEnabled` boolean
          - `timeZoneId` integer
          - `currencyId` integer
          - `languageId` integer
        - `modifiedDate` string
      - `fields` object
        - `gender` string
      - `identifiers` object[]
        - `type` string
        - `value` string
      - `commChannels` object[]
        - `type` string
        - `value` string
        - `primary` boolean
        - `verified` boolean
        - `meta` object
          - `residence` boolean
          - `office` boolean
        - `attributes` object
      - `source` string
      - `userId` integer
      - `accountId` string
      - `conflictingProfileList` unknown[]
        - unknown
      - `autoUpdateTime` string
      - `identifiersAll` object[]
        - `type` string
        - `value` string
    - `loyaltyInfo` object
      - `loyaltyType` string
    - `segments` object
    - `associationDetails` object
      - `hierarchyId` integer
      - `roleCode` string
      - `fleetCompany` object
        - `externalId` string
        - `companyId` integer
      - `parentRoleId` integer
      - `skipLevelAllowed` boolean
      - `new` boolean
      - `childCustomer` boolean
    - `extendedFields` object
      - `city` string
      - `gender` string
    - `warnings` object[]
      - `status` boolean
      - `code` integer
      - `message` string
  - `childCount` integer
  - `childFailureCount` integer
  - `childSuccessCount` integer

## Other responses

- `400` — 400

---

[API](https://skmtc.net/capillarytech/apis/sample-api.md) · [All operations](https://skmtc.net/capillarytech/apis/sample-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/capillarytech/sample-api/versions/de241f2ed9b3/schema)
