# Update a customer

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/customers/{id}:
    post:
      summary: Update a customer
      deprecated: false
      description: ''
      tags:
        - API Reference/Customers
      parameters:
        - name: id
          in: path
          description: ''
          required: true
          schema:
            type: string
        - name: Accept
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              x-apifox-refs:
                01GMQ91SE9DJPS5H3JBKACBQ32: &ref_1
                  $ref: '#/components/schemas/Customer'
                  x-apifox-overrides:
                    id: null
                    object: null
                    created: null
                    currency: null
                    livemode: null
                    preferred_locales: null
                    balance: null
                    default_source: null
                    cash_balance: null
                    tax_ids: null
                    tax: null
                    subscriptions: null
                    sources: null
                    next_invoice_sequence: null
                    test_clock: null
                    tax_exempt: null
                    invoice_settings: null
                    invoice_prefix: null
                    discount: null
                    delinquent: null
              x-apifox-orders:
                - 01GMQ91SE9DJPS5H3JBKACBQ32
              properties:
                address: &ref_0
                  $ref: '#/components/schemas/Address'
                  description: The customer’s address.
                description:
                  type: string
                  description: >-
                    An arbitrary string attached to the object. Often useful for
                    displaying to users.
                email:
                  type: string
                  description: The customer’s email address.
                metadata:
                  type: object
                  properties: {}
                  x-apifox-orders: []
                  description: >-
                    Set of key-value pairs that you can attach to an object.
                    This can be useful for storing additional information about
                    the object in a structured format.
                  x-apifox-ignore-properties: []
                name:
                  type: string
                  description: The customer’s full name or business name.
                phone:
                  type: string
                  description: The customer’s phone number.
                shipping:
                  type: object
                  x-apifox-refs:
                    01GMQ58B4B49QTDXFCFTCM2G9D: &ref_2
                      $ref: '#/components/schemas/Shipping'
                      x-apifox-overrides:
                        carrier: null
                        tracking_number: null
                  x-apifox-orders:
                    - 01GMQ58B4B49QTDXFCFTCM2G9D
                  properties:
                    address: *ref_0
                    name:
                      type: string
                      description: 'Recipient name. '
                    phone:
                      type: string
                      description: 'Recipient phone (including extension). '
                  description: Mailing and shipping address for the customer.
                  x-apifox-ignore-properties:
                    - address
                    - name
                    - phone
              x-apifox-ignore-properties:
                - address
                - description
                - email
                - metadata
                - name
                - phone
                - shipping
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                x-apifox-refs:
                  01GMQ9A2GYFMBPRE68HQ96ZA0Q: *ref_1
                x-apifox-orders:
                  - 01GMQ9A2GYFMBPRE68HQ96ZA0Q
                properties:
                  id:
                    type: string
                    description: Unique identifier for the object, like "cus_XXX".
                  object:
                    type: string
                    description: '''customer'''
                  address: *ref_0
                  created:
                    type: integer
                    description: >-
                      Time at which the object was created. Measured in seconds
                      since the Unix epoch.
                  currency:
                    type: string
                    description: >-
                      Three-letter ISO code for the currency the customer can be
                      charged in for recurring billing purposes.
                  description:
                    type: string
                    description: >-
                      An arbitrary string attached to the object. Often useful
                      for displaying to users.
                  email:
                    type: string
                    description: The customer’s email address.
                  livemode:
                    type: boolean
                    description: >-
                      Has the value true if the object exists in live mode or
                      the value false if the object exists in test mode.
                  metadata:
                    type: object
                    properties: {}
                    x-apifox-orders: []
                    description: >-
                      Set of key-value pairs that you can attach to an object.
                      This can be useful for storing additional information
                      about the object in a structured format.
                    x-apifox-ignore-properties: []
                  name:
                    type: string
                    description: The customer’s full name or business name.
                  phone:
                    type: string
                    description: The customer’s phone number.
                  preferred_locales:
                    type: array
                    items:
                      type: string
                    description: >-
                      The customer’s preferred locales (languages), ordered by
                      preference.
                  shipping:
                    type: object
                    x-apifox-refs:
                      01GMQ58B4B49QTDXFCFTCM2G9D:
                        x-apifox-overrides:
                          carrier: null
                          tracking_number: null
                        type: object
                        properties: {}
                    x-apifox-orders:
                      - 01GMQ58B4B49QTDXFCFTCM2G9D
                    properties:
                      address: *ref_0
                      name:
                        type: string
                        description: 'Recipient name. '
                      phone:
                        type: string
                        description: 'Recipient phone (including extension). '
                    description: Mailing and shipping address for the customer.
                    x-apifox-ignore-properties:
                      - address
                      - name
                      - phone
                x-apifox-ignore-properties:
                  - id
                  - object
                  - address
                  - created
                  - currency
                  - description
                  - email
                  - livemode
                  - metadata
                  - name
                  - phone
                  - preferred_locales
                  - shipping
          headers: {}
          x-apifox-name: OK
      security:
        - basic: []
      x-apifox-folder: API Reference/Customers
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/1296482/apis/api-55532470-run
components:
  schemas:
    Shipping:
      type: object
      properties:
        address: *ref_0
        carrier:
          type: string
          description: >-
            The delivery service that shipped a physical product, such as FedEx,
            UPS, USPS, etc. 
        name: &ref_3
          type: string
          description: 'Recipient name. '
        phone: &ref_4
          type: string
          description: 'Recipient phone (including extension). '
        tracking_number:
          type: string
          description: >-
            The tracking number for a physical product, obtained from the
            delivery service. If multiple tracking numbers were generated for
            this purchase, please separate them with commas.
      x-apifox-orders:
        - address
        - carrier
        - name
        - phone
        - tracking_number
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Address:
      type: object
      properties:
        city:
          type: string
          description: City, district, suburb, town, or village.
        country:
          type: string
          description: Two-letter country code (ISO 3166-1 alpha-2 ).
        line1:
          type: string
          description: Address line 1 (e.g., street, PO Box, or company name).
        line2:
          type: string
          description: Address line 2 (e.g., apartment, suite, unit, or building).
        postal_code:
          type: string
          description: ZIP or postal code.
        state:
          type: string
          description: State, county, province, or region.
      x-apifox-orders:
        - city
        - country
        - line1
        - line2
        - postal_code
        - state
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    Customer:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the object, like "cus_XXX".
        object:
          type: string
          description: '''customer'''
        address: *ref_0
        created:
          type: integer
          description: >-
            Time at which the object was created. Measured in seconds since the
            Unix epoch.
        currency:
          type: string
          description: >-
            Three-letter ISO code for the currency the customer can be charged
            in for recurring billing purposes.
        description:
          type: string
          description: >-
            An arbitrary string attached to the object. Often useful for
            displaying to users.
        email:
          type: string
          description: The customer’s email address.
        livemode:
          type: boolean
          description: >-
            Has the value true if the object exists in live mode or the value
            false if the object exists in test mode.
        metadata:
          type: object
          properties: {}
          x-apifox-orders: []
          description: >-
            Set of key-value pairs that you can attach to an object. This can be
            useful for storing additional information about the object in a
            structured format.
          x-apifox-ignore-properties: []
        name:
          type: string
          description: The customer’s full name or business name.
        phone:
          type: string
          description: The customer’s phone number.
        preferred_locales:
          type: array
          items:
            type: string
          description: The customer’s preferred locales (languages), ordered by preference.
        shipping:
          type: object
          x-apifox-refs:
            01GMQ58B4B49QTDXFCFTCM2G9D: *ref_2
          x-apifox-orders:
            - 01GMQ58B4B49QTDXFCFTCM2G9D
          properties:
            address: *ref_0
            name: *ref_3
            phone: *ref_4
          description: Mailing and shipping address for the customer.
          x-apifox-ignore-properties:
            - address
            - name
            - phone
        balance:
          type: integer
          description: >-
            （未实现）Current balance, if any, being stored on the customer. If
            negative, the customer has credit to apply to their next invoice. If
            positive, the customer has an amount owed that will be added to
            their next invoice. The balance does not refer to any unpaid
            invoices; it solely takes into account amounts that have yet to be
            successfully applied to any invoice. This balance is only taken into
            account as invoices are finalized.
        default_source:
          type: string
          description: （未实现）ID of the default payment source for the customer.
        delinquent:
          type: boolean
          description: >-
            （未实现）When the customer’s latest invoice is billed by charging
            automatically, delinquent is true if the invoice’s latest charge
            failed. When the customer’s latest invoice is billed by sending an
            invoice, delinquent is true if the invoice isn’t paid by its due
            date.If an invoice is marked uncollectible by dunning, delinquent
            doesn’t get reset to false.
        discount:
          type: string
          description: >-
            （未实现）Describes the current discount active on the customer, if there
            is one.
        invoice_prefix:
          type: string
          description: The prefix for the customer used to generate unique invoice numbers.
        invoice_settings:
          type: object
          properties:
            custom_fields:
              type: object
              properties:
                name:
                  type: string
                  description: The name of the custom field.
                value:
                  type: string
                  description: The value of the custom field.
              x-apifox-orders:
                - name
                - value
              description: >-
                Default custom fields to be displayed on invoices for this
                customer.
              x-apifox-ignore-properties: []
            default_payment_method:
              type: string
              description: >-
                ID of a payment method that’s attached to the customer, to be
                used as the customer’s default payment method for subscriptions
                and invoices.
          x-apifox-orders:
            - custom_fields
            - default_payment_method
          description: The customer’s default invoice settings.
          x-apifox-ignore-properties: []
        tax_exempt:
          type: string
          description: >-
            （未实现）Describes the customer’s tax exemption status. One of none,
            exempt, or reverse.
        test_clock:
          type: string
          description: （未实现）ID of the test clock this customer belongs to.
        next_invoice_sequence:
          type: integer
          description: （未实现）The suffix of the customer’s next invoice number, e.g., 0001.
        sources:
          type: array
          items:
            type: string
          description: （未实现）The customer’s payment sources, if any.
        subscriptions:
          type: string
          description: （未实现）The customer’s current subscriptions, if any.
        tax:
          type: object
          properties: {}
          description: （未实现）Tax details for the customer.
          x-apifox-orders: []
          x-apifox-ignore-properties: []
        tax_ids:
          type: array
          items:
            type: string
          description: （未实现）The customer’s tax IDs.
        cash_balance:
          type: object
          properties:
            object:
              type: string
              description: '"cash_balance"'
            available:
              type: object
              properties: {}
              x-apifox-orders: []
              description: >-
                A hash of all cash balances available to this customer. You
                cannot delete a customer with any cash balances, even if the
                balance is 0.
              x-apifox-ignore-properties: []
            customer:
              type: string
              description: >-
                The ID of the customer whose cash balance this object
                represents.
            livemode:
              type: string
              description: >-
                Has the value true if the object exists in live mode or the
                value false if the object exists in test mode.
            settings:
              type: object
              properties:
                reconciliation_mode:
                  type: string
                  description: >-
                    The configuration for how funds that land in the customer
                    cash balance are reconciled.
                  enum:
                    - manual
                    - auto
                  x-apifox-enum:
                    - value: manual
                      name: ''
                      description: ''
                    - value: auto
                      name: ''
                      description: ''
                using_merchant_default:
                  type: boolean
                  description: >-
                    A flag to indicate if reconciliation mode returned is the
                    user’s default or is specific to this customer cash balance
              description: A hash of settings for this cash balance.
              x-apifox-orders:
                - reconciliation_mode
                - using_merchant_default
              x-apifox-ignore-properties: []
          x-apifox-orders:
            - object
            - available
            - customer
            - livemode
            - settings
          description: >-
            （未实现）The current funds being held by Wooshpay on behalf of the
            customer. These funds can be applied towards payment intents with
            source “cash_balance”. The settings[reconciliation_mode] field
            describes whether these funds are applied to such payment intents
            manually or automatically. This field is not included by default. To
            include it in the response, expand the cash_balance field.
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - id
        - object
        - address
        - created
        - currency
        - description
        - email
        - livemode
        - metadata
        - name
        - phone
        - preferred_locales
        - shipping
        - balance
        - default_source
        - delinquent
        - discount
        - invoice_prefix
        - invoice_settings
        - tax_exempt
        - test_clock
        - next_invoice_sequence
        - sources
        - subscriptions
        - tax
        - tax_ids
        - cash_balance
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    basic:
      type: http
      scheme: basic
servers:
  - url: https://apitest.wooshpay.com
    description: 官网测试
security:
  - basic: []

```
