Update an order

Request

Updates an order with a specified ID.

Security
CustomerJWT
Path
idstring, <= 50 characters^[@~\-\.\w]+$required

ID of the resource.

Bodyapplication/jsonrequired

Order resource.

autopayboolean

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 paymentInstrumentId, or the default payment instrument on the subscription.

deliveryAddressContactObject (object) or null
One of:

Contact's information.

billingAddressContactObject (object) or null
One of:

Contact's information.

usageLimitsArray of objects, non-empty

Details of items in the order and corresponding usage limits.

curl -i -X PATCH \
  'https://www.rebilly.com/_mock/catalog/all/storefront/orders/{id}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "autopay": true,
    "deliveryAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "string",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "1-512-777-0269",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "billingAddress": {
      "firstName": "Benjamin",
      "lastName": "Franklin",
      "organization": "Rebilly",
      "address": "36 Craven St",
      "address2": "string",
      "city": "Austin",
      "region": "Texas",
      "country": "GB",
      "postalCode": "WC2N 5NF",
      "phoneNumbers": [
        {
          "label": "main",
          "value": "1-512-777-0269",
          "primary": true
        }
      ],
      "emails": [
        {
          "label": "main",
          "value": "rebilly@example.com",
          "primary": true
        }
      ],
      "dob": "1980-04-01",
      "jobTitle": "CEO"
    },
    "usageLimits": [
      {
        "itemId": "sub_01HW2V1Y3A6QPM1NX4WCYHFSRS",
        "limits": {
          "softLimit": {
            "quantity": 0
          },
          "hardLimit": {
            "quantity": 0
          },
          "trialLimit": 20.725
        }
      }
    ]
  }'

Responses

Order updated.

Headers
X-RateLimit-Limitinteger

Total number of rate limit tokens for this request within a rate limit period. For more information, see Rate limits.

Example:3600
X-RateLimit-Remaininginteger

Remaining number of rate limit tokens for this request within the rate limit period. For example, in the sandbox environment, rate limits for non-GET endpoints are set at 3000 requests per 10 minutes.

Example:3600
Bodyapplication/json
idstring, <= 50 charactersread-only

ID of the order.

Example:"sub_01HRF27SATGE4Z6PBJE6PD8328"
orderTypestring

Specifies the type of order. An order may be a subscription or a one-time purchase.

Default:"subscription-order"
Enum:"subscription-order""one-time-order"
Discriminator
billingStatusstringread-only

Billing status of the most recent invoice. This value may help you to determine if you should change the service status of the service, such as suspending the service.

Enum:"draft""unpaid""past-due""abandoned""paid""voided""refunded""disputed""partially-refunded""partially-paid"
websiteIdstring, <= 50 characters(WebsiteId)

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

Example:"web_0YV7DE4Z26DQSA1AC92FBJ7SEG"
orderIdstring or null, <= 50 charactersread-only

ID of the order.

Example:"ord_01HVKA5975PJBSQ1SX72G3MSZC"
currencystring, = 3 characters(CurrencyCode)read-only

Currency of the order.

Example:"USD"
initialInvoiceIdstring, <= 50 charactersread-only

ID of the initial invoice.

Example:"in_0YVF9605RKC62BP14NE2R7V2XT"
recentInvoiceIdstring, <= 50 charactersread-only

ID of the most recently issued invoice. The invoice might not be paid yet.

Example:"in_0YVF9605RKC62BP14NE2R7V2XT"
itemsArray of objects, non-empty(StorefrontSubscriptionOrOneTimeSaleItem)

Details of items in the order.

deliveryAddressContactObject (object) or null
One of:

Contact's information.

billingAddressContactObject (object) or null
One of:

Contact's information.

activationTimestring, (date-time)(ServerTimestamp)read-only

Date and time when the order is activated.

voidTimestring, (date-time)(ServerTimestamp)read-only

Date and time when the order is voided.

abandonTimestring or null, (date-time)

Date and time when the pending order is automatically abandoned. If this value is not passed during order creation, a pending order TTL setting is used to calculate the value.

poNumberstring or null

Purchase order number displayed on the issued invoices.

Example:"PO123456"
shippingobject(Shipping)
notesstring

Notes for the customer displayed on the order invoice.

statusstringread-only

Status of the subscription service. A subscription starts in the pending status, and becomes active when the service period begins.

Enum:"pending""active""abandoned""canceled""churned""paused""voided""completed""trial-ended"
inTrialbooleanread-only

Specifies if the subscription is currently in a trial period.

trialobject

Details of the trial. To use plan defaults, omit the trial key or set this value to null.

isTrialOnlyboolean

Specifies if a subscription ends after a trial period. If this value is true, recurring settings are ignored.

Default:false
invoiceTimeShiftobject or null(InvoiceTimeShift)

Shifts issue time and due time of invoices for this subscription.

This setting overrides plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same billing period, this property enables the customer to subscribe to different plans.

autopayboolean

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 paymentInstrumentId, or the default payment instrument on the subscription.

Default:true
startTimestring or null, (date-time)

Date and time when the subscription starts. If this value is null, the current time is used. This value cannot be more than one service period in the past.

Default:null
Example:null
churnTimestring, (date-time)read-only

Date and time when the subscription is deactivated.

renewalTimestring or null, (date-time)

Date and time when the subscription renews.

paymentInstrumentIdstring or null, <= 50 characters

ID of the payment instrument to use for autopay. If this value is not provided, or if the payment instrument is inactive, the customer's default payment instrument is used.

Example:"inst_0YVB8KPKNXCBR9EDX7JHSED75N"
canceledTimestring, (date-time)read-only

Date and time when the subscription order is canceled.

canceledBystringread-only

Specifies who initiated the cancellation.

Enum:"merchant""customer""rebilly"
cancelCategorystringread-only

Category of the cancellation.

Enum:"billing-failure""delinquency""did-not-use""did-not-want""missing-features""bugs-or-problems""do-not-remember""risk-warning""contract-expired""too-expensive"
cancelDescriptionstring, <= 255 charactersread-only

Description of the cancellation reason in free form.

billingPortalIdstring

ID of the billing portal.

Default:null
Example:"bill_prt_0YV7K5TYV5D1P9ZNKDT39KZC3C"
customFieldsobject(ResourceCustomFields)

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

Default:{}
Example:
{ "foo": "bar" }
createdTimestring, (date-time)(CreatedTime)read-only

Date and time when the resource is created. This value is set automatically when the resource is created.

updatedTimestring, (date-time)(UpdatedTime)read-only

Date and time when the resource is updated. This value is set automatically when the resource is updated.

_embeddedobjectread-only

Embedded objects that are requested by the expand query parameter.

recurringIntervalobject or nulldeprecated

Recurring interval to override plan settings. To use plan settings, set this value to null.

To use multiple plans in one subscription, all plans must have the same same recurring period length, this property enables the customer to subscribe to different plans.

Example:null
rebillNumberintegerread-onlydeprecated

Current billing period number.

lineItemsArray of objectsread-onlydeprecated

Subscription line items which queue until the next renewal (or interim) invoice is issued for the subscription.

lineItemSubtotalobjectread-onlydeprecated

Subtotal of line items in this subscription (signed value). If credits exceed debits, this value is a negative number.

Response
{ "id": "sub_01HRF27SATGE4Z6PBJE6PD8328", "orderType": "subscription-order", "billingStatus": "draft", "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG", "orderId": "ord_01HVKA5975PJBSQ1SX72G3MSZC", "currency": "USD", "initialInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "recentInvoiceId": "in_0YVF9605RKC62BP14NE2R7V2XT", "items": [ {} ], "deliveryAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "billingAddress": { "firstName": "Benjamin", "lastName": "Franklin", "organization": "Rebilly", "address": "36 Craven St", "address2": "string", "city": "Austin", "region": "Texas", "country": "GB", "postalCode": "WC2N 5NF", "phoneNumbers": [], "emails": [], "dob": "1980-04-01", "jobTitle": "CEO", "hash": "056ae6d97c788b9e98b049ebafd7b229bf852221" }, "activationTime": "2019-08-24T14:15:22Z", "voidTime": "2019-08-24T14:15:22Z", "abandonTime": "2019-08-24T14:15:22Z", "poNumber": "PO123456", "shipping": { "amount": 0.1, "calculator": "manual" }, "notes": "string", "status": "pending", "inTrial": true, "trial": { "enabled": true, "endTime": "2019-08-24T14:15:22Z" }, "isTrialOnly": false, "invoiceTimeShift": { "issueTimeShift": {}, "dueTimeShift": {} }, "recurringInterval": null, "autopay": true, "startTime": null, "churnTime": "2019-08-24T14:15:22Z", "renewalTime": "2019-08-24T14:15:22Z", "rebillNumber": 0, "lineItems": [ {} ], "lineItemSubtotal": { "currency": "USD", "amount": 49.95 }, "paymentInstrumentId": "inst_0YVB8KPKNXCBR9EDX7JHSED75N", "canceledTime": "2019-08-24T14:15:22Z", "canceledBy": "merchant", "cancelCategory": "billing-failure", "cancelDescription": "string", "billingPortalId": "bill_prt_0YV7K5TYV5D1P9ZNKDT39KZC3C", "customFields": { "foo": "bar" }, "createdTime": "2019-08-24T14:15:22Z", "updatedTime": "2019-08-24T14:15:22Z", "_links": [ {} ], "_embedded": { "changeItemsQuote": {}, "changeItemsInvoice": {} } }