Update customer

PATCH/customers/update/{customerId}

Headers

  • x-api-keystringrequired

    Api key provided on integrations tab in Easyflow platform.

  • x-api-secretstringrequired

    Api Secret provided on integrations tab in Easyflow platform.

Path parameters

  • customerIdstringrequired

Request body

Content typeapplication/jsonobject

  • namestring
  • addressobject
    Show child attributesHide child attributes
    • zipCodestring
    • streetstring
    • complementstring
    • neighborhoodstring
    • citystring
    • statestring

      The state must send an abbreviation (Example: sp)

    • numberstring
  • deliveryAddressobject
    Show child attributesHide child attributes
    • zipCodestring
    • streetstring
    • complementstring
    • neighborhoodstring
    • citystring
    • statestring

      The state must send an abbreviation (Example: sp)

    • numberstring
  • documentobject
    Show child attributesHide child attributes
    • typestring

      Possible values:CPFCNPJ

    • numberstring
  • phoneobject
    Show child attributesHide child attributes
    • areaCodestring
    • dddstring
    • numberstring
    • isMobileboolean
  • cascadeUpdateboolean

    When true, the updated customer data is also copied to the customer's subscriptions with status active or inactive and to the customer's charges with status draft, opened, active, inactive or delayed. Any other value is treated as false.

    Default:false

Responses

200Returns whether the customer was updated and, when cascadeUpdate is true, how many subscriptions and charges received the new data.

Returns whether the customer was updated and, when cascadeUpdate is true, how many subscriptions and charges received the new data.

Content typeapplication/jsonobject

  • statusCodeinteger

    Example:200

  • dataobject
    Show child attributesHide child attributes
    • updatedboolean
    • cascadeobject

      Present only when cascadeUpdate is true and the customer was updated.

      Show child attributesHide child attributes
      • subscriptionsinteger

        Number of subscriptions that received the new customer data.

      • billingsinteger

        Number of charges that received the new customer data.

400If the provided parameter is invalid, the API will return the following error response:

If the provided parameter is invalid, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid param: []

    Example:Invalid param: []

  • errorstring

    Bad Request

    Example:Bad Request

  • statusCodeinteger

    400

    Example:400

  • errorCodestring

    Code that identifies the error. Present only on some errors.

401If the request is unauthorized, the API will return the following error response:

If the request is unauthorized, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Invalid field

    Example:Unauthorized

  • errorstring

    Unauthorized

    Example:Unauthorized

  • statusCodeinteger

    401

    Example:401

403If the request is forbidden, the API will return the following error response:

If the request is forbidden, the API will return the following error response:

Content typeapplication/jsonobject

  • messagestring

    Forbidden resource

    Example:Forbidden resource

  • errorstring

    Forbidden

    Example:Forbidden

  • statusCodeinteger

    403

    Example:403

404The customer does not exist or does not belong to your business.

The customer does not exist or does not belong to your business.

Content typeapplication/jsonobject

  • statusCodeintegerrequired

    HTTP status code.

  • messagestringrequired

    Explanation of the error.

  • errorstring

    Name of the HTTP status, such as Bad Request or Conflict.

  • errorCodestring

    Code that identifies the error. Present only on some errors.

500If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

If an unexpected condition occurs and the server cannot process the request, the API will return the following error response. This response has no error field.

Content typeapplication/jsonobject

  • statusCodeinteger

    HTTP status code.

    Example:500

  • messagestring

    Explanation of the error.

    Example:Internal Server Error