# Update an order Updates an order with a specified ID. Endpoint: PATCH /storefront/orders/{id} Version: latest Security: CustomerJWT ## Path parameters: - `id` (string, required) ID of the resource. ## Request fields (application/json): - `autopay` (boolean) Specifies if payment attempts are made automatically. If autopay is enabled, the payment is retrieved from the customer on the renewal date using the payment instrument that is set at , or the default payment instrument on the subscription. - `deliveryAddress` (object,null) Order delivery address. - `deliveryAddress.firstName` (string,null) Contact's first name. Example: "Benjamin" - `deliveryAddress.lastName` (string,null) Contact's last name. Example: "Franklin" - `deliveryAddress.organization` (string,null) Contact's organization. Example: "Rebilly" - `deliveryAddress.address` (string,null) First line of the contact's street address. Example: "36 Craven St" - `deliveryAddress.address2` (string,null) Second line of the contact's street address. - `deliveryAddress.city` (string,null) Contact's city of residence. Example: "Austin" - `deliveryAddress.region` (string,null) Contact's region of residence. Example: "Texas" - `deliveryAddress.country` (string,null) Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see [ISO.org](https://www.iso.org/obp/ui/#search/code/). Example: "GB" - `deliveryAddress.postalCode` (string,null) Contact's postal code. Example: "WC2N 5NF" - `deliveryAddress.phoneNumbers` (array) List of phone numbers associated with the contact. - `deliveryAddress.phoneNumbers.label` (string, required) Phone number label or name. Example: "main" - `deliveryAddress.phoneNumbers.value` (string, required) Phone number value. Example: "1-512-777-0269" - `deliveryAddress.phoneNumbers.primary` (boolean) Specifies if the phone number is the contact's primary phone number. Example: true - `deliveryAddress.emails` (array) List of email addresses associated with the contact. - `deliveryAddress.emails.label` (string, required) Email label or name. Example: "main" - `deliveryAddress.emails.value` (string, required) Email address value. Example: "rebilly@example.com" - `deliveryAddress.emails.primary` (boolean) Specifies if the email address is the contact's primary email address. Example: true - `deliveryAddress.dob` (string,null) Contact's date of birth in ISO-8601 format. Example: "1980-04-01" - `deliveryAddress.jobTitle` (string,null) Contact's job title. Example: "CEO" - `billingAddress` (object,null) Order billing address. - `usageLimits` (array) Details of items in the order and corresponding usage limits. - `usageLimits.itemId` (string, required) ID of the subscription item. Example: "sub_01HW2V1Y3A6QPM1NX4WCYHFSRS" - `usageLimits.limits` (object,null, required) Specifies the soft and hard usage limit thresholds for an item with a metered billing plan. This value is ignored when the plan is not metered. - `usageLimits.limits.softLimit` (object,null) Defines thresholds for notification purposes. For example, to notify the customer that their usage is near the hard limit of their metered billing plan. This notification informs the customer so that they can upgrade their plan before the hard limit is reached. When the reported usage reaches 75%, 90%, and 100% of the configured limit a specific event is fired. To notify the customer, a webhook and notification can be configured for this event. This field is useful for accounting and customer success purposes. The usage of metered billing plans can still be reported if the soft limit is reached. - `usageLimits.limits.softLimit.quantity` (integer) Usage limit quantity. - `usageLimits.limits.softLimit.amount` (number) Usage limit amount in the currency of the order. - `usageLimits.limits.hardLimit` (object,null) Defines a limit where the customer can no longer use the service. Hard limits are used in addition to soft limits. When a soft limit is reached, a customer may receive a notification but the service can still be provided up to the hard limit value so that the customer can upgrade their plan. When the reported usage reaches the configured limit, a specific event is triggered. To notify the customer in the merchant system, or block a service, a webhook and notification can be configured for this event. When the total usage reaches the hard limit quantity, or amount values, metered billing plan usages can no longer be reported. - `usageLimits.limits.trialLimit` (object,null) Defines a usage cap during the trial period of a subscription. This limit is enforced only while the subscription is in trial phase. When the reported usage reaches the configured trial limit, an event called 'trial-usage-limit-reached' is triggered. To notify the customer or restrict access to the service, a webhook and notification can be configured for this event. Once the trial limit is reached, additional usage cannot be reported until the trial ends. Example: 20.725 ## Response 200 fields (application/json): - `orderType` (string) Specifies the type of order. An order may be a subscription or a one-time purchase. Enum: "subscription-order", "one-time-order" ## Response 401 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 403 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 404 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. ## Response 422 fields (application/json): - `status` (integer) HTTP status code. - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. - `invalidFields` (array) Invalid field details. Example: [{"field":"field1","message":"field1 is invalid"},{"field":"subObject.field2","message":"field2 is invalid"},{"field":"subObject.field2","message":"another error in the field2"}] - `invalidFields.field` (string) Name of the field. Dot notation is used for nested object field names. - `invalidFields.message` (string) Message field. ## Response 429 fields (application/json): - `type` (string) Problem type in the form of a [URI](https://tools.ietf.org/html/rfc3986) reference. It should provide human-readable documentation for the problem type. When this member is not present, its value is assumed to be "about:blank". Example: "about:blank" - `title` (string) Short, human-readable summary of the problem type. Other than for the purposes of localization, this should not change from occurrence to occurrence of the problem. Example: "Rate Limit Exceeded" - `status` (integer) HTTP status code. - `detail` (string) Human-readable explanation that is specific to this occurrence of the problem. Example: "A request cannot be executed because the user has sent too many requests within a certain period of time" - `instance` (string) URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.