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

# Update customer

> Update a customer and add, change, or delete its locations. Identify the customer by `resourceId`, as returned by Create customer or List customers.

Usage notes:
- Customer fields you leave out keep their values. Send an empty string to clear `scac` or `ediId`.
- `locations` lists only the locations to add, change, or delete; locations you leave out are not changed. A location with a `resourceId` is changed, or deleted with `requestAction: "delete"`. A location without a `resourceId` is added; set its `customerId` to the customer's `resourceId`.
- When you change a location, send all of it, including `isDefault` and its `address` (with the address `resourceId` to change that address in place). Location fields you leave out are reset or cleared; see the `locations` schema. A changed location without an `address` is rejected with a 500 error.
- List customers returns only part of a customer: not `ediId`, `isTaxExempt`, or a location's `isDefault`, `usedForBilling`, `externalLocationId`, contact details or address. Keep the full record that Create customer and Update customer return, including address `resourceId`s, and treat your system as the source of truth for those fields. An address sent without a `resourceId` replaces the location's address.
- At most one location is the default. To move the default, list the current default with `isDefault: false` before the new default.
- Renaming the customer or a location also updates clear references to the old name in revenue agreements, invoice settings, and workflows: the same updates the ARMS customer form makes without asking. Ambiguous references are left unchanged.
- Renaming the customer also renames its `<name> Admin` and `<name> Operator` user groups, acting as the user in `x-arms-assume-user`. If that user cannot update user groups, the rename can fail; rename the customer in ARMS instead.
- There is no upsert: updating a customer ID that does not exist returns 404.
- A missing permission returns 401.



## OpenAPI

````yaml /user-docs/api-reference/external-openapi.json post /ims/customers/update
openapi: 3.1.0
info:
  title: ARMS External API
  version: 1.0.0
  description: >-
    OpenAPI specification generated from external API schemas. Endpoints require
    query parameter carrierId and headers x-arms-api-key and x-arms-assume-user.
  license:
    name: Proprietary
    url: https://cedarai.com
servers:
  - url: https://api-lg.arms.cedarai.com
    description: Production (US)
  - url: https://api-lg.arms.cedarai.se
    description: Production (EU)
security:
  - ApiKeyAuth: []
    AssumeUser: []
paths:
  /ims/customers/update:
    post:
      summary: Update customer
      description: >-
        Update a customer and add, change, or delete its locations. Identify the
        customer by `resourceId`, as returned by Create customer or List
        customers.


        Usage notes:

        - Customer fields you leave out keep their values. Send an empty string
        to clear `scac` or `ediId`.

        - `locations` lists only the locations to add, change, or delete;
        locations you leave out are not changed. A location with a `resourceId`
        is changed, or deleted with `requestAction: "delete"`. A location
        without a `resourceId` is added; set its `customerId` to the customer's
        `resourceId`.

        - When you change a location, send all of it, including `isDefault` and
        its `address` (with the address `resourceId` to change that address in
        place). Location fields you leave out are reset or cleared; see the
        `locations` schema. A changed location without an `address` is rejected
        with a 500 error.

        - List customers returns only part of a customer: not `ediId`,
        `isTaxExempt`, or a location's `isDefault`, `usedForBilling`,
        `externalLocationId`, contact details or address. Keep the full record
        that Create customer and Update customer return, including address
        `resourceId`s, and treat your system as the source of truth for those
        fields. An address sent without a `resourceId` replaces the location's
        address.

        - At most one location is the default. To move the default, list the
        current default with `isDefault: false` before the new default.

        - Renaming the customer or a location also updates clear references to
        the old name in revenue agreements, invoice settings, and workflows: the
        same updates the ARMS customer form makes without asking. Ambiguous
        references are left unchanged.

        - Renaming the customer also renames its `<name> Admin` and `<name>
        Operator` user groups, acting as the user in `x-arms-assume-user`. If
        that user cannot update user groups, the rename can fail; rename the
        customer in ARMS instead.

        - There is no upsert: updating a customer ID that does not exist returns
        404.

        - A missing permission returns 401.
      operationId: updateCustomer
      parameters:
        - $ref: '#/components/parameters/CarrierId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCustomerInput'
            examples:
              changeLocation:
                summary: Change a location and its address
                value:
                  carrier:
                    resourceId: 1234
                  resourceId: 5678
                  printedName: Acme Chemical Co.
                  locations:
                    - resourceId: 9012
                      name: Acme Chemical - Odessa
                      isDefault: true
                      usedForBilling: true
                      currencyCode: USD
                      email: billing@acme-chemical.example
                      externalLocationId: NS-CUST-1001
                      address:
                        resourceId: 3456
                        streetLine1: 1650 Rail Spur Rd
                        city: Odessa
                        state: TX
                        zipCode: '79761'
                        country: US
              addAndDeleteLocations:
                summary: Add one location and delete another
                value:
                  carrier:
                    resourceId: 1234
                  resourceId: 5678
                  locations:
                    - customerId: 5678
                      name: Acme Chemical - Midland
                      isDefault: false
                      usedForBilling: false
                      address:
                        streetLine1: 200 Industrial Ave
                        city: Midland
                        state: TX
                        zipCode: '79701'
                    - resourceId: 9013
                      name: Acme Chemical - Old Yard
                      requestAction: delete
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateCustomerOutput'
        '400':
          description: >-
            Bad Request (for example a duplicate name, `scac` or `ediId`, a new
            location without `customerId`, or more than one default location)
        '401':
          description: Unauthorized (bad key, carrier not permitted, or missing permission)
        '404':
          description: Customer, location, address, or `scac` not found
        '412':
          description: A customer or location name contains `/`
        '500':
          description: Internal Server Error
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    CarrierId:
      name: carrierId
      in: query
      required: true
      schema:
        type: integer
      description: Carrier identifier; required for all endpoints
  schemas:
    UpdateCustomerInput:
      type: object
      required:
        - carrier
        - resourceId
      description: >-
        Customer fields you leave out (or send as `null`) keep their current
        values.
      properties:
        carrier:
          $ref: '#/components/schemas/CarrierReference'
        resourceId:
          type: integer
          description: >-
            ID of the customer to update, as returned by Create customer or List
            customers.
        name:
          type: string
          description: >-
            New customer name. Cannot contain `/`. Renaming also renames the
            customer's `<name> Admin` and `<name> Operator` user groups.
        printedName:
          type: string
        scac:
          type: string
          description: >-
            Must be a SCAC Cedar already knows. Send an empty string to clear
            it.
        ediId:
          type: string
          description: >-
            Must be unique across every customer in Cedar. Send an empty string
            to clear it.
        isTaxExempt:
          type: boolean
        locations:
          type: array
          description: >-
            Only the locations to add, change or delete. Locations you leave out
            are not changed.
          items:
            $ref: '#/components/schemas/CustomerLocationInput'
    UpdateCustomerOutput:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/CustomerDetail'
        contract:
          type: object
          properties:
            effect:
              type: string
              enum:
                - overwriteItem
            resourceType:
              type: string
              enum:
                - Customer
    Error:
      type: object
      properties:
        message:
          type: string
    CarrierReference:
      type: object
      required:
        - resourceId
      properties:
        resourceId:
          type: integer
          description: 'Your carrier ID: the same value as the `carrierId` query parameter.'
    CustomerLocationInput:
      type: object
      required:
        - name
      description: >-
        A customer location: a site you serve or bill. On Update customer, a
        location with a `resourceId` changes that location, a location without
        one is added (set its `customerId`), and locations you leave out of the
        request are not changed. When you change a location, send all of it,
        including `isDefault` and its `address`: fields you leave out are reset
        (`usedForBilling` and `isReportingLocation` to false, `currencyCode` to
        `USD`) or cleared (`abbreviatedName`, `externalLocationId`,
        `generalLedgerNumber`). `email`, `phoneNumber` and
        `customerIdentificationNumbers` keep their values when left out.
      properties:
        resourceId:
          type: integer
          description: >-
            Update only. ID of an existing location of this customer. Leave it
            out to add a new location.
        customerId:
          type: integer
          description: >-
            Update only, and required when adding a location: the customer's
            `resourceId`.
        requestAction:
          type: string
          enum:
            - update
            - delete
          default: update
          description: >-
            Update only. `delete` removes the location identified by
            `resourceId`; `name` is still required.
        name:
          type: string
          description: Location name. Cannot contain `/`.
        abbreviatedName:
          type: string
          description: Short name (Abbreviated in ARMS).
        address:
          $ref: '#/components/schemas/CustomerAddressInput'
        isDefault:
          type: boolean
          description: >-
            Marks the customer's default location; a customer has at most one.
            If no location in the request has `isDefault: true`, the first
            location in the request is made the default unless it sends
            `isDefault: false`, and that returns 400 when another location
            already is the default. To move the default, list the current
            default with `isDefault: false` before the new one.
        usedForBilling:
          type: boolean
          default: false
          description: >-
            Marks the location as billable (Billable in ARMS): a bill-to
            location you can invoice.
        currencyCode:
          type: string
          default: USD
          description: ISO 4217 currency code used when invoicing this location.
        isReportingLocation:
          type: boolean
          default: false
          description: Reporting location in ARMS.
        email:
          type: string
        phoneNumber:
          type: string
          maxLength: 11
          description: Up to 11 characters, for example `4325550100`.
        externalLocationId:
          type: string
          description: >-
            Your own system's ID for this location (External location ID in
            ARMS), for example a NetSuite customer or address ID. Values that
            start with `up:` are reserved for Union Pacific location IDs and are
            checked against Union Pacific.
        generalLedgerNumber:
          type: string
          description: Account ID in ARMS.
        customerIdentificationNumbers:
          type: array
          items:
            type: string
          description: CIF number prefixes in ARMS.
    CustomerDetail:
      type: object
      description: The full customer record. Fields without a value are left out.
      properties:
        resourceId:
          type: integer
          description: Customer ID. Use it to update this customer.
        uuid:
          type: string
        name:
          type: string
        printedName:
          type: string
        scac:
          type: string
        ediId:
          type: string
        isTaxExempt:
          type: boolean
        carrier:
          $ref: '#/components/schemas/CarrierResource'
        locations:
          type: array
          items:
            $ref: '#/components/schemas/CustomerLocationDetail'
    CustomerAddressInput:
      type: object
      description: >-
        A location's address. `streetLine1`, `city`, `state` and `zipCode` are
        required unless `addressType` is `AT_PARTIAL` or `requestAction` is
        `delete`. When you change an existing address, send all of it: `name`
        and `streetLine2` to `streetLine4` are cleared when left out.
      properties:
        resourceId:
          type: integer
          description: >-
            Update only. ID of the location's current address, to change it in
            place. Leave it out to give the location a new address.
        requestAction:
          type: string
          enum:
            - update
            - delete
          default: update
          description: >-
            Update only. `delete` removes this address (identified by
            `resourceId`) from the location.
        name:
          type: string
        streetLine1:
          type: string
        streetLine2:
          type: string
        streetLine3:
          type: string
        streetLine4:
          type: string
        city:
          type: string
        state:
          type: string
          description: State or province code, for example `TX`.
        zipCode:
          type: string
        country:
          type: string
          description: Country code, for example `US`.
        addressType:
          type: string
          enum:
            - AT_CUSTOMER
            - AT_PARTIAL
            - AT_CARRIER
            - AT_PORT
            - AT_CONTRACTUAL_PORT
            - AT_STATION
          description: >-
            Optional. Use `AT_PARTIAL` to store an address without all of
            `streetLine1`, `city`, `state` and `zipCode`.
    CarrierResource:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Carrier
        resourceId:
          type: integer
        uuid:
          type: string
          description: UUID that complements the legacy numeric resourceId.
        carrierCode:
          type: string
        name:
          type: string
    CustomerLocationDetail:
      type: object
      properties:
        resourceId:
          type: integer
        uuid:
          type: string
        name:
          type: string
        abbreviatedName:
          type: string
        customer:
          $ref: '#/components/schemas/CustomerResource'
        address:
          $ref: '#/components/schemas/CustomerAddress'
        isDefault:
          type: boolean
        usedForBilling:
          type: boolean
        currencyCode:
          type: string
        email:
          type: string
        phoneNumber:
          type: string
        externalLocationId:
          type: string
        generalLedgerNumber:
          type: string
        customerIdentificationNumbers:
          type: array
          items:
            type: string
    CustomerResource:
      type: object
      properties:
        resourceType:
          type: string
          enum:
            - Customer
        resourceId:
          type: integer
        uuid:
          type: string
          description: UUID that complements the legacy numeric resourceId.
        name:
          type: string
    CustomerAddress:
      type: object
      properties:
        resourceId:
          type: integer
        name:
          type: string
        streetLine1:
          type: string
        streetLine2:
          type: string
        streetLine3:
          type: string
        streetLine4:
          type: string
        city:
          type: string
        state:
          type: string
        zipCode:
          type: string
        country:
          type: string
        addressType:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-arms-api-key
      description: Your ARMS API key
    AssumeUser:
      type: apiKey
      in: header
      name: x-arms-assume-user
      description: Email of a user assigned to the appropriate user group

````

## Related topics

- [Create customer](/api-reference/create-customer.md)
- [API Introduction](/user-docs/api-reference/introduction.md)
- [Update a note](/api-reference/lindaservice/update-a-note.md)
- [Update a Work Order](/api-reference/workorderservice/update-a-work-order.md)
- [Update Quote Preferences](/api-reference/quotesservice/update-quote-preferences.md)
