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

# 创建顾客

> 创建顾客



## OpenAPI

````yaml openapi/v1-zh.yaml POST /api/v1/front/customer/create
openapi: 3.0.3
info:
  title: Subotiz API
  description: Subotiz OpenAPI
  version: 1.0.0
servers:
  - url: https://{api}.subotiz.com
    variables:
      api:
        default: api
security:
  - sec0: []
tags:
  - name: 折扣
    description: 折扣
  - name: 发票
    description: 发票
  - name: 退款
    description: 退款
  - name: 商品管理
    description: 商品管理
  - name: 订阅
    description: 订阅
  - name: 商品定价
    description: 商品定价方案
  - name: 交易单
    description: 交易单
  - name: 支付流水
    description: 支付流水
  - name: 结账会话
    description: 结账会话
  - name: 顾客
    description: 顾客
  - name: 顾客门户
    description: 顾客门户
  - name: Webhook
    description: Webhook
  - name: 争议
    description: 争议订单
paths:
  /api/v1/front/customer/create:
    post:
      tags:
        - 顾客
      summary: 创建顾客
      description: 创建顾客
      operationId: v1-customer-create-customer
      parameters:
        - $ref: '#/components/parameters/HeaderRequestID'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerResponse'
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: 请求的唯一标识符
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    CreateCustomerRequest:
      type: object
      properties:
        email:
          type: string
          description: 顾客邮箱，与 payer_id 二选一
        phone:
          type: string
          description: 顾客手机号
        name:
          type: string
          description: 顾客名称
        address:
          allOf:
            - $ref: '#/components/schemas/CustomerAddress'
          description: 顾客地址
        metadata:
          type: object
          description: 一组可附加到对象上的键值对，允许您以结构化格式存储附加信息。
        payer_id:
          type: string
          description: 接入方顾客 ID
        email_subscription:
          type: integer
          description: |-
            订阅营销标记
             - 1：不订阅
             - 2：订阅
          format: int32
    CreateCustomerResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/CreateCustomerResponse_Data'
    CustomerAddress:
      type: object
      properties:
        line1:
          type: string
          description: 地址行1
        line2:
          type: string
          description: 地址行2
        city:
          type: string
          description: 城市
        province:
          type: string
          description: 省/州代码
        postal_code:
          type: string
          description: 邮政编码
        country:
          type: string
          description: 国家/地区代码
    CreateCustomerResponse_Data:
      type: object
      properties:
        customer_id:
          type: string
          description: Subotiz 顾客唯一标识
  securitySchemes:
    sec0:
      type: http
      description: 'Bearer API Key 鉴权。格式：Authorization: Bearer {your_api_key}'
      scheme: bearer

````