# Update the company

`PUT /v1/company`

This endpoint accepts a partial update. Send only the fields you change, and fields you leave out stay as they are.

A company can change its delivery address at any time, in any status. It needs a license in that state only to
order: without one, the order fails with `address_state_without_license` in its `problems`. The address still saves, and the response
has `warnings`. A warning comes only with the call that saved that address.

For an `unverified` or `declined` company, a change saves and shows directly in `GET /v1/company`.

When an `in_review`, `prequalified`, or `verified` company changes `legalName`, `ein`, `displayName`, or
`businessType`, the change goes to review. The status stays the same, and the new values show in `pendingChanges`
until the review ends.

A `prequalified` company's license counts as soon as it is uploaded. A `verified` company's license must be reviewed
before an order can go to that state, and uploading the license creates the review task.


```yaml
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        description: Send only the fields you change.
        properties:
          businessType:
            type: string
            description: >
              `salon` for a salon or spa, `professional` for an individual
              licensed professional, `store` for a beauty supply

              store. Beauty Router does not support stores yet, so verification
              for a `store` always fails.
            enum:
              - salon
              - professional
              - store
          displayName:
            type: string
            description: The name the company goes by.
          legalName:
            type: string
            description: The registered legal name. Not used for `professional`.
          ein:
            type: string
            pattern: ^[0-9]{9}$
            description: The Employer Identification Number, 9 digits. Not used for
              `professional`.
          deliveryAddress:
            type: object
            required:
              - line1
              - city
              - state
              - postalCode
              - country
            properties:
              line1:
                type: string
                description: Street address.
              line2:
                type: string
                description: Suite, unit, or floor.
              city:
                type: string
              state:
                type: string
                pattern: ^[A-Z]{2}$
                description: A two-letter US state code.
                examples:
                  - CO
              postalCode:
                type: string
                description: ZIP code.
              country:
                type: string
                const: US
              phone:
                type: string
                description: Phone number for the delivery. Required on the company. Optional on
                  an order, which then uses the company's phone.
      examples:
        Company details:
          value:
            businessType: salon
            displayName: Golden Hour Hair Studio
            legalName: Golden Hour Salon LLC
            ein: "847102938"
        Delivery address:
          value:
            deliveryAddress:
              line1: 1450 Larimer St
              line2: Suite 200
              city: Denver
              state: CO
              postalCode: "80202"
              country: US
              phone: "+13035550142"
responses:
  "200":
    description: The updated company.
    content:
      application/json:
        schema:
          allOf:
            - type: object
              required:
                - id
                - businessType
                - displayName
                - legalName
                - ein
                - deliveryAddress
                - verificationStatus
                - buyingSuspended
                - pendingChanges
              properties:
                id:
                  type: string
                  description: The company ID.
                  examples:
                    - loc-7Hk2pQx9Lm
                businessType:
                  description: The business type, or `null` until the company picks a type.
                  oneOf:
                    - type: string
                      description: >
                        `salon` for a salon or spa, `professional` for an
                        individual licensed professional, `store` for a beauty
                        supply

                        store. Beauty Router does not support stores yet, so
                        verification for a `store` always fails.
                      enum:
                        - salon
                        - professional
                        - store
                    - type: "null"
                displayName:
                  type:
                    - string
                    - "null"
                  description: The name the company goes by.
                legalName:
                  type:
                    - string
                    - "null"
                  description: The registered legal name. Not used for `professional`.
                ein:
                  type:
                    - string
                    - "null"
                  pattern: ^[0-9]{9}$
                  description: The Employer Identification Number, 9 digits. Not used for
                    `professional`.
                deliveryAddress:
                  description: The default delivery address, or `null` when not set.
                  oneOf:
                    - type: object
                      required:
                        - line1
                        - city
                        - state
                        - postalCode
                        - country
                      properties:
                        line1:
                          type: string
                          description: Street address.
                        line2:
                          type: string
                          description: Suite, unit, or floor.
                        city:
                          type: string
                        state:
                          type: string
                          pattern: ^[A-Z]{2}$
                          description: A two-letter US state code.
                          examples:
                            - CO
                        postalCode:
                          type: string
                          description: ZIP code.
                        country:
                          type: string
                          const: US
                        phone:
                          type: string
                          description: Phone number for the delivery. Required on the company. Optional on
                            an order, which then uses the company's phone.
                    - type: "null"
                verificationStatus:
                  type: string
                  description: >
                    `unverified`: not submitted yet. `in_review`: Beauty Router
                    is reviewing the company. `prequalified`: the initial

                    check passed, and the detailed verification is still
                    pending. The company can order, its orders wait until that

                    verification ends, and no charge happens until then.
                    `verified`: the company passed the review.

                    `declined`: the company did not pass the review.
                  enum:
                    - unverified
                    - in_review
                    - prequalified
                    - verified
                    - declined
                buyingSuspended:
                  type: boolean
                  description: >
                    `true` when Beauty Router suspended the company's buying.
                    The company can still read its data and manage its

                    orders, but it cannot place a new order.
                pendingChanges:
                  oneOf:
                    - type: object
                      description: >
                        New values of an `in_review`, `prequalified`, or
                        `verified` company that wait for review. `null` when no
                        change

                        waits for review.
                      properties:
                        businessType:
                          type: string
                          description: >
                            `salon` for a salon or spa, `professional` for an
                            individual licensed professional, `store` for a
                            beauty supply

                            store. Beauty Router does not support stores yet, so
                            verification for a `store` always fails.
                          enum:
                            - salon
                            - professional
                            - store
                        displayName:
                          type: string
                        legalName:
                          type: string
                        ein:
                          type: string
                          pattern: ^[0-9]{9}$
                    - type: "null"
            - type: object
              properties:
                warnings:
                  type: array
                  description: >
                    `address_state_without_license`: the address saved, but the
                    company has no license in that state, so an order

                    to it fails. Only on the call that saved that address.
                  items:
                    type: string
                    enum:
                      - address_state_without_license
        examples:
          Company:
            value:
              id: loc-7Hk2pQx9Lm
              businessType: salon
              displayName: Golden Hour Hair Studio
              legalName: Golden Hour Salon LLC
              ein: "847102938"
              deliveryAddress:
                line1: 1450 Larimer St
                line2: Suite 200
                city: Denver
                state: CO
                postalCode: "80202"
                country: US
                phone: "+13035550142"
              verificationStatus: verified
              buyingSuspended: false
              pendingChanges: null
          Address with no license:
            value:
              id: loc-7Hk2pQx9Lm
              businessType: salon
              displayName: Golden Hour Hair Studio
              legalName: Golden Hour Salon LLC
              ein: "847102938"
              deliveryAddress:
                line1: 1712 Pioneer Ave
                city: Cheyenne
                state: WY
                postalCode: "82001"
                country: US
                phone: "+13075550142"
              verificationStatus: verified
              buyingSuspended: false
              pendingChanges: null
              warnings:
                - address_state_without_license
  "400":
    description: "`validation_failed`: a field is missing or has a wrong value.
      `field` names it."
    content:
      application/json:
        schema:
          type: object
          description: The body of every error response.
          required:
            - error
          properties:
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: A stable error code.
                  enum:
                    - invalid_app_token
                    - invalid_user_token
                    - user_token_expired
                    - origin_not_allowed
                    - ip_not_allowed
                    - user_cannot_manage_company
                    - user_cannot_order
                    - company_blocked
                    - company_not_verified
                    - app_setup_incomplete
                    - not_found
                    - validation_failed
                    - email_invalid_format
                    - email_domain_not_found
                    - email_mailbox_not_found
                    - address_state_without_license
                    - hazmat_destination
                    - ship_to_restricted
                    - verification_data_missing
                    - document_locked
                    - document_already_uploaded
                    - file_too_large
                    - file_type_not_supported
                    - reply_not_expected
                    - order_action_not_allowed
                    - supplier_refused_cancel
                    - order_total_changed
                    - order_has_problems
                    - idempotency_key_reused
                    - idempotency_key_in_use
                    - rate_limit_exceeded
                    - internal_error
                message:
                  type: string
                  description: A sentence for developers. It can change, so do not match on it.
                field:
                  type: string
                  description: The request field that caused the error. Only some errors have it.
                missing:
                  type: array
                  items:
                    type: string
                  description: Only on `verification_data_missing` and `app_setup_incomplete`.
                    What still needs to be set.
                quote:
                  type: object
                  required:
                    - groups
                    - unresolvedLines
                    - companyProblems
                    - total
                    - currency
                  properties:
                    groups:
                      type: array
                      description: One group per supplier. Each group becomes one order.
                      items:
                        type: object
                        required:
                          - supplierId
                          - lines
                          - productsTotal
                          - orderDiscount
                          - shipping
                          - freeShippingRemaining
                          - salesTax
                          - taxExemption
                          - total
                          - chargeTiming
                          - problems
                        properties:
                          supplierId:
                            type: string
                            examples:
                              - sup-1Ry6tUi3Op
                          lines:
                            type: array
                            items:
                              type: object
                              required:
                                - productId
                                - quantity
                                - unitPrice
                                - discount
                                - total
                              properties:
                                productId:
                                  type: string
                                quantity:
                                  type: integer
                                unitPrice:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                discount:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                total:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                          productsTotal:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          orderDiscount:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          shipping:
                            type: object
                            required:
                              - amount
                              - kind
                            properties:
                              amount:
                                type:
                                  - number
                                  - "null"
                                description: The shipping charge in US dollars, or `null` when it cannot be
                                  worked out.
                              kind:
                                type: string
                                enum:
                                  - free
                                  - flat
                                  - carrier
                          freeShippingRemaining:
                            type:
                              - number
                              - "null"
                            description: How much more to order for free shipping, or `null` when it does
                              not apply.
                          salesTax:
                            type:
                              - number
                              - "null"
                            description: The sales tax in US dollars, or `null` when it cannot be worked
                              out.
                          taxExemption:
                            type: object
                            required:
                              - certificateId
                              - notAppliedReason
                            properties:
                              certificateId:
                                type:
                                  - string
                                  - "null"
                                description: The exemption certificate used, or `null`.
                              notAppliedReason:
                                type:
                                  - string
                                  - "null"
                                enum:
                                  - no_certificate
                                  - other_state
                                  - not_reviewed
                                  - null
                                description: Why no certificate applies, or `null` when one does.
                          total:
                            type:
                              - number
                              - "null"
                            description: >
                              The amount the salon pays for this group in US
                              dollars, or `null` when it cannot be worked out.
                              Send it back as

                              `expectedTotal`. A group with problems has no
                              `expectedTotal`.
                          chargeTiming:
                            type: string
                            enum:
                              - now
                              - after_verification
                            description: >
                              `now`: Beauty Router charges the card when the
                              order is created. `after_verification`: the
                              company is

                              `prequalified`, so the charge waits until its
                              verification ends.
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    unresolvedLines:
                      type: array
                      description: The lines no supplier can take.
                      items:
                        type: object
                        required:
                          - productId
                          - quantity
                          - problems
                        properties:
                          productId:
                            type: string
                          quantity:
                            type: integer
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    companyProblems:
                      type: array
                      description: What stops every group.
                      items:
                        type: object
                        required:
                          - code
                          - message
                        properties:
                          code:
                            type: string
                            description: What stops a group or the whole request. See
                              [Problems](/create-orders/#problems).
                            enum:
                              - buying_suspended
                              - supplier_unavailable
                              - address_state_without_license
                              - ship_to_restricted
                              - hazmat_destination
                              - address_not_deliverable
                              - connection_required
                              - connection_blocked
                              - insufficient_stock
                              - product_unavailable
                              - shipping_unavailable
                              - tax_unavailable
                              - delivery_address_required
                              - delivery_phone_required
                              - payment_card_required
                              - payment_card_unusable
                              - quantity_limit_exceeded
                              - order_limit_exceeded
                              - order_below_minimum
                          message:
                            type: string
                            description: A sentence you can show. It can change, so do not match on it.
                          productId:
                            type: string
                            description: The product. Only on problems with one product.
                          supplierId:
                            type: string
                            description: The supplier. Only on problems with one supplier.
                          available:
                            type: integer
                            description: How many units can be ordered. Only on `insufficient_stock`.
                    total:
                      type:
                        - number
                        - "null"
                      description: The sum of all the groups in US dollars, or `null` when a group's
                        total is.
                    currency:
                      type: string
                      const: usd
                      description: Always `usd`.
        examples:
          validation_failed:
            value:
              error:
                code: validation_failed
                message: ein must have 9 digits.
                field: ein
  "401":
    description: >
      `invalid_user_token`: the user token is missing or wrong.
      `user_token_expired`: the user token expired. Log the

      user in again with `POST /v1/login`.
    content:
      application/json:
        schema:
          type: object
          description: The body of every error response.
          required:
            - error
          properties:
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: A stable error code.
                  enum:
                    - invalid_app_token
                    - invalid_user_token
                    - user_token_expired
                    - origin_not_allowed
                    - ip_not_allowed
                    - user_cannot_manage_company
                    - user_cannot_order
                    - company_blocked
                    - company_not_verified
                    - app_setup_incomplete
                    - not_found
                    - validation_failed
                    - email_invalid_format
                    - email_domain_not_found
                    - email_mailbox_not_found
                    - address_state_without_license
                    - hazmat_destination
                    - ship_to_restricted
                    - verification_data_missing
                    - document_locked
                    - document_already_uploaded
                    - file_too_large
                    - file_type_not_supported
                    - reply_not_expected
                    - order_action_not_allowed
                    - supplier_refused_cancel
                    - order_total_changed
                    - order_has_problems
                    - idempotency_key_reused
                    - idempotency_key_in_use
                    - rate_limit_exceeded
                    - internal_error
                message:
                  type: string
                  description: A sentence for developers. It can change, so do not match on it.
                field:
                  type: string
                  description: The request field that caused the error. Only some errors have it.
                missing:
                  type: array
                  items:
                    type: string
                  description: Only on `verification_data_missing` and `app_setup_incomplete`.
                    What still needs to be set.
                quote:
                  type: object
                  required:
                    - groups
                    - unresolvedLines
                    - companyProblems
                    - total
                    - currency
                  properties:
                    groups:
                      type: array
                      description: One group per supplier. Each group becomes one order.
                      items:
                        type: object
                        required:
                          - supplierId
                          - lines
                          - productsTotal
                          - orderDiscount
                          - shipping
                          - freeShippingRemaining
                          - salesTax
                          - taxExemption
                          - total
                          - chargeTiming
                          - problems
                        properties:
                          supplierId:
                            type: string
                            examples:
                              - sup-1Ry6tUi3Op
                          lines:
                            type: array
                            items:
                              type: object
                              required:
                                - productId
                                - quantity
                                - unitPrice
                                - discount
                                - total
                              properties:
                                productId:
                                  type: string
                                quantity:
                                  type: integer
                                unitPrice:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                discount:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                total:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                          productsTotal:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          orderDiscount:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          shipping:
                            type: object
                            required:
                              - amount
                              - kind
                            properties:
                              amount:
                                type:
                                  - number
                                  - "null"
                                description: The shipping charge in US dollars, or `null` when it cannot be
                                  worked out.
                              kind:
                                type: string
                                enum:
                                  - free
                                  - flat
                                  - carrier
                          freeShippingRemaining:
                            type:
                              - number
                              - "null"
                            description: How much more to order for free shipping, or `null` when it does
                              not apply.
                          salesTax:
                            type:
                              - number
                              - "null"
                            description: The sales tax in US dollars, or `null` when it cannot be worked
                              out.
                          taxExemption:
                            type: object
                            required:
                              - certificateId
                              - notAppliedReason
                            properties:
                              certificateId:
                                type:
                                  - string
                                  - "null"
                                description: The exemption certificate used, or `null`.
                              notAppliedReason:
                                type:
                                  - string
                                  - "null"
                                enum:
                                  - no_certificate
                                  - other_state
                                  - not_reviewed
                                  - null
                                description: Why no certificate applies, or `null` when one does.
                          total:
                            type:
                              - number
                              - "null"
                            description: >
                              The amount the salon pays for this group in US
                              dollars, or `null` when it cannot be worked out.
                              Send it back as

                              `expectedTotal`. A group with problems has no
                              `expectedTotal`.
                          chargeTiming:
                            type: string
                            enum:
                              - now
                              - after_verification
                            description: >
                              `now`: Beauty Router charges the card when the
                              order is created. `after_verification`: the
                              company is

                              `prequalified`, so the charge waits until its
                              verification ends.
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    unresolvedLines:
                      type: array
                      description: The lines no supplier can take.
                      items:
                        type: object
                        required:
                          - productId
                          - quantity
                          - problems
                        properties:
                          productId:
                            type: string
                          quantity:
                            type: integer
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    companyProblems:
                      type: array
                      description: What stops every group.
                      items:
                        type: object
                        required:
                          - code
                          - message
                        properties:
                          code:
                            type: string
                            description: What stops a group or the whole request. See
                              [Problems](/create-orders/#problems).
                            enum:
                              - buying_suspended
                              - supplier_unavailable
                              - address_state_without_license
                              - ship_to_restricted
                              - hazmat_destination
                              - address_not_deliverable
                              - connection_required
                              - connection_blocked
                              - insufficient_stock
                              - product_unavailable
                              - shipping_unavailable
                              - tax_unavailable
                              - delivery_address_required
                              - delivery_phone_required
                              - payment_card_required
                              - payment_card_unusable
                              - quantity_limit_exceeded
                              - order_limit_exceeded
                              - order_below_minimum
                          message:
                            type: string
                            description: A sentence you can show. It can change, so do not match on it.
                          productId:
                            type: string
                            description: The product. Only on problems with one product.
                          supplierId:
                            type: string
                            description: The supplier. Only on problems with one supplier.
                          available:
                            type: integer
                            description: How many units can be ordered. Only on `insufficient_stock`.
                    total:
                      type:
                        - number
                        - "null"
                      description: The sum of all the groups in US dollars, or `null` when a group's
                        total is.
                    currency:
                      type: string
                      const: usd
                      description: Always `usd`.
        examples:
          invalid_user_token:
            value:
              error:
                code: invalid_user_token
                message: The user token is missing or not valid.
          user_token_expired:
            value:
              error:
                code: user_token_expired
                message: The user token expired. Log the user in again.
  "403":
    description: "`user_cannot_manage_company`: the user was logged in with
      `canManageCompany: false`."
    content:
      application/json:
        schema:
          type: object
          description: The body of every error response.
          required:
            - error
          properties:
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: A stable error code.
                  enum:
                    - invalid_app_token
                    - invalid_user_token
                    - user_token_expired
                    - origin_not_allowed
                    - ip_not_allowed
                    - user_cannot_manage_company
                    - user_cannot_order
                    - company_blocked
                    - company_not_verified
                    - app_setup_incomplete
                    - not_found
                    - validation_failed
                    - email_invalid_format
                    - email_domain_not_found
                    - email_mailbox_not_found
                    - address_state_without_license
                    - hazmat_destination
                    - ship_to_restricted
                    - verification_data_missing
                    - document_locked
                    - document_already_uploaded
                    - file_too_large
                    - file_type_not_supported
                    - reply_not_expected
                    - order_action_not_allowed
                    - supplier_refused_cancel
                    - order_total_changed
                    - order_has_problems
                    - idempotency_key_reused
                    - idempotency_key_in_use
                    - rate_limit_exceeded
                    - internal_error
                message:
                  type: string
                  description: A sentence for developers. It can change, so do not match on it.
                field:
                  type: string
                  description: The request field that caused the error. Only some errors have it.
                missing:
                  type: array
                  items:
                    type: string
                  description: Only on `verification_data_missing` and `app_setup_incomplete`.
                    What still needs to be set.
                quote:
                  type: object
                  required:
                    - groups
                    - unresolvedLines
                    - companyProblems
                    - total
                    - currency
                  properties:
                    groups:
                      type: array
                      description: One group per supplier. Each group becomes one order.
                      items:
                        type: object
                        required:
                          - supplierId
                          - lines
                          - productsTotal
                          - orderDiscount
                          - shipping
                          - freeShippingRemaining
                          - salesTax
                          - taxExemption
                          - total
                          - chargeTiming
                          - problems
                        properties:
                          supplierId:
                            type: string
                            examples:
                              - sup-1Ry6tUi3Op
                          lines:
                            type: array
                            items:
                              type: object
                              required:
                                - productId
                                - quantity
                                - unitPrice
                                - discount
                                - total
                              properties:
                                productId:
                                  type: string
                                quantity:
                                  type: integer
                                unitPrice:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                discount:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                total:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                          productsTotal:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          orderDiscount:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          shipping:
                            type: object
                            required:
                              - amount
                              - kind
                            properties:
                              amount:
                                type:
                                  - number
                                  - "null"
                                description: The shipping charge in US dollars, or `null` when it cannot be
                                  worked out.
                              kind:
                                type: string
                                enum:
                                  - free
                                  - flat
                                  - carrier
                          freeShippingRemaining:
                            type:
                              - number
                              - "null"
                            description: How much more to order for free shipping, or `null` when it does
                              not apply.
                          salesTax:
                            type:
                              - number
                              - "null"
                            description: The sales tax in US dollars, or `null` when it cannot be worked
                              out.
                          taxExemption:
                            type: object
                            required:
                              - certificateId
                              - notAppliedReason
                            properties:
                              certificateId:
                                type:
                                  - string
                                  - "null"
                                description: The exemption certificate used, or `null`.
                              notAppliedReason:
                                type:
                                  - string
                                  - "null"
                                enum:
                                  - no_certificate
                                  - other_state
                                  - not_reviewed
                                  - null
                                description: Why no certificate applies, or `null` when one does.
                          total:
                            type:
                              - number
                              - "null"
                            description: >
                              The amount the salon pays for this group in US
                              dollars, or `null` when it cannot be worked out.
                              Send it back as

                              `expectedTotal`. A group with problems has no
                              `expectedTotal`.
                          chargeTiming:
                            type: string
                            enum:
                              - now
                              - after_verification
                            description: >
                              `now`: Beauty Router charges the card when the
                              order is created. `after_verification`: the
                              company is

                              `prequalified`, so the charge waits until its
                              verification ends.
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    unresolvedLines:
                      type: array
                      description: The lines no supplier can take.
                      items:
                        type: object
                        required:
                          - productId
                          - quantity
                          - problems
                        properties:
                          productId:
                            type: string
                          quantity:
                            type: integer
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    companyProblems:
                      type: array
                      description: What stops every group.
                      items:
                        type: object
                        required:
                          - code
                          - message
                        properties:
                          code:
                            type: string
                            description: What stops a group or the whole request. See
                              [Problems](/create-orders/#problems).
                            enum:
                              - buying_suspended
                              - supplier_unavailable
                              - address_state_without_license
                              - ship_to_restricted
                              - hazmat_destination
                              - address_not_deliverable
                              - connection_required
                              - connection_blocked
                              - insufficient_stock
                              - product_unavailable
                              - shipping_unavailable
                              - tax_unavailable
                              - delivery_address_required
                              - delivery_phone_required
                              - payment_card_required
                              - payment_card_unusable
                              - quantity_limit_exceeded
                              - order_limit_exceeded
                              - order_below_minimum
                          message:
                            type: string
                            description: A sentence you can show. It can change, so do not match on it.
                          productId:
                            type: string
                            description: The product. Only on problems with one product.
                          supplierId:
                            type: string
                            description: The supplier. Only on problems with one supplier.
                          available:
                            type: integer
                            description: How many units can be ordered. Only on `insufficient_stock`.
                    total:
                      type:
                        - number
                        - "null"
                      description: The sum of all the groups in US dollars, or `null` when a group's
                        total is.
                    currency:
                      type: string
                      const: usd
                      description: Always `usd`.
        examples:
          user_cannot_manage_company:
            value:
              error:
                code: user_cannot_manage_company
                message: This user cannot change company settings.
  "500":
    description: "`internal_error`: something failed on Beauty Router's side. Try
      again later."
    content:
      application/json:
        schema:
          type: object
          description: The body of every error response.
          required:
            - error
          properties:
            error:
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                  description: A stable error code.
                  enum:
                    - invalid_app_token
                    - invalid_user_token
                    - user_token_expired
                    - origin_not_allowed
                    - ip_not_allowed
                    - user_cannot_manage_company
                    - user_cannot_order
                    - company_blocked
                    - company_not_verified
                    - app_setup_incomplete
                    - not_found
                    - validation_failed
                    - email_invalid_format
                    - email_domain_not_found
                    - email_mailbox_not_found
                    - address_state_without_license
                    - hazmat_destination
                    - ship_to_restricted
                    - verification_data_missing
                    - document_locked
                    - document_already_uploaded
                    - file_too_large
                    - file_type_not_supported
                    - reply_not_expected
                    - order_action_not_allowed
                    - supplier_refused_cancel
                    - order_total_changed
                    - order_has_problems
                    - idempotency_key_reused
                    - idempotency_key_in_use
                    - rate_limit_exceeded
                    - internal_error
                message:
                  type: string
                  description: A sentence for developers. It can change, so do not match on it.
                field:
                  type: string
                  description: The request field that caused the error. Only some errors have it.
                missing:
                  type: array
                  items:
                    type: string
                  description: Only on `verification_data_missing` and `app_setup_incomplete`.
                    What still needs to be set.
                quote:
                  type: object
                  required:
                    - groups
                    - unresolvedLines
                    - companyProblems
                    - total
                    - currency
                  properties:
                    groups:
                      type: array
                      description: One group per supplier. Each group becomes one order.
                      items:
                        type: object
                        required:
                          - supplierId
                          - lines
                          - productsTotal
                          - orderDiscount
                          - shipping
                          - freeShippingRemaining
                          - salesTax
                          - taxExemption
                          - total
                          - chargeTiming
                          - problems
                        properties:
                          supplierId:
                            type: string
                            examples:
                              - sup-1Ry6tUi3Op
                          lines:
                            type: array
                            items:
                              type: object
                              required:
                                - productId
                                - quantity
                                - unitPrice
                                - discount
                                - total
                              properties:
                                productId:
                                  type: string
                                quantity:
                                  type: integer
                                unitPrice:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                discount:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                                total:
                                  type: number
                                  description: An amount in dollars, with up to two decimal places.
                          productsTotal:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          orderDiscount:
                            type: number
                            description: An amount in dollars, with up to two decimal places.
                          shipping:
                            type: object
                            required:
                              - amount
                              - kind
                            properties:
                              amount:
                                type:
                                  - number
                                  - "null"
                                description: The shipping charge in US dollars, or `null` when it cannot be
                                  worked out.
                              kind:
                                type: string
                                enum:
                                  - free
                                  - flat
                                  - carrier
                          freeShippingRemaining:
                            type:
                              - number
                              - "null"
                            description: How much more to order for free shipping, or `null` when it does
                              not apply.
                          salesTax:
                            type:
                              - number
                              - "null"
                            description: The sales tax in US dollars, or `null` when it cannot be worked
                              out.
                          taxExemption:
                            type: object
                            required:
                              - certificateId
                              - notAppliedReason
                            properties:
                              certificateId:
                                type:
                                  - string
                                  - "null"
                                description: The exemption certificate used, or `null`.
                              notAppliedReason:
                                type:
                                  - string
                                  - "null"
                                enum:
                                  - no_certificate
                                  - other_state
                                  - not_reviewed
                                  - null
                                description: Why no certificate applies, or `null` when one does.
                          total:
                            type:
                              - number
                              - "null"
                            description: >
                              The amount the salon pays for this group in US
                              dollars, or `null` when it cannot be worked out.
                              Send it back as

                              `expectedTotal`. A group with problems has no
                              `expectedTotal`.
                          chargeTiming:
                            type: string
                            enum:
                              - now
                              - after_verification
                            description: >
                              `now`: Beauty Router charges the card when the
                              order is created. `after_verification`: the
                              company is

                              `prequalified`, so the charge waits until its
                              verification ends.
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    unresolvedLines:
                      type: array
                      description: The lines no supplier can take.
                      items:
                        type: object
                        required:
                          - productId
                          - quantity
                          - problems
                        properties:
                          productId:
                            type: string
                          quantity:
                            type: integer
                          problems:
                            type: array
                            items:
                              type: object
                              required:
                                - code
                                - message
                              properties:
                                code:
                                  type: string
                                  description: What stops a group or the whole request. See
                                    [Problems](/create-orders/#problems).
                                  enum:
                                    - buying_suspended
                                    - supplier_unavailable
                                    - address_state_without_license
                                    - ship_to_restricted
                                    - hazmat_destination
                                    - address_not_deliverable
                                    - connection_required
                                    - connection_blocked
                                    - insufficient_stock
                                    - product_unavailable
                                    - shipping_unavailable
                                    - tax_unavailable
                                    - delivery_address_required
                                    - delivery_phone_required
                                    - payment_card_required
                                    - payment_card_unusable
                                    - quantity_limit_exceeded
                                    - order_limit_exceeded
                                    - order_below_minimum
                                message:
                                  type: string
                                  description: A sentence you can show. It can change, so do not match on it.
                                productId:
                                  type: string
                                  description: The product. Only on problems with one product.
                                supplierId:
                                  type: string
                                  description: The supplier. Only on problems with one supplier.
                                available:
                                  type: integer
                                  description: How many units can be ordered. Only on `insufficient_stock`.
                    companyProblems:
                      type: array
                      description: What stops every group.
                      items:
                        type: object
                        required:
                          - code
                          - message
                        properties:
                          code:
                            type: string
                            description: What stops a group or the whole request. See
                              [Problems](/create-orders/#problems).
                            enum:
                              - buying_suspended
                              - supplier_unavailable
                              - address_state_without_license
                              - ship_to_restricted
                              - hazmat_destination
                              - address_not_deliverable
                              - connection_required
                              - connection_blocked
                              - insufficient_stock
                              - product_unavailable
                              - shipping_unavailable
                              - tax_unavailable
                              - delivery_address_required
                              - delivery_phone_required
                              - payment_card_required
                              - payment_card_unusable
                              - quantity_limit_exceeded
                              - order_limit_exceeded
                              - order_below_minimum
                          message:
                            type: string
                            description: A sentence you can show. It can change, so do not match on it.
                          productId:
                            type: string
                            description: The product. Only on problems with one product.
                          supplierId:
                            type: string
                            description: The supplier. Only on problems with one supplier.
                          available:
                            type: integer
                            description: How many units can be ordered. Only on `insufficient_stock`.
                    total:
                      type:
                        - number
                        - "null"
                      description: The sum of all the groups in US dollars, or `null` when a group's
                        total is.
                    currency:
                      type: string
                      const: usd
                      description: Always `usd`.
        examples:
          internal_error:
            value:
              error:
                code: internal_error
                message: Something went wrong. Try again later.
parameters: []
```
