Cancel an order

Cancel an order.

SecurityCustomerJWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

Resource identifier string.

Request Body schema: application/json

Order resource.

reason
required
string

Order cancellation reason.

Enum: "did-not-use" "did-not-want" "missing-features" "bugs-or-problems" "do-not-remember" "too-expensive" "other"
description
string <= 255 characters

Cancel reason description in free form.

Responses
201

Order was canceled.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
id
string <= 50 characters

The order identifier string.

orderType
string
Default: "subscription-order"

Specifies the type of order, a subscription or a one-time purchase.

billingStatus
string

The billing status of the most recent invoice. It may help you determine if you should change the service status such as suspending the service.

Enum: "draft" "unpaid" "past-due" "abandoned" "paid" "voided" "refunded" "disputed" "partially-refunded" "partially-paid"
websiteId
string <= 50 characters

The website identifier string.

currency
string = 3 characters

The order's currency.

initialInvoiceId
string <= 50 characters

The initial invoice identifier string.

recentInvoiceId
string <= 50 characters

Most recently issued invoice identifier string. It might not be paid yet.

Array of objects (OrderItem) non-empty
Array (non-empty)
required
OriginalPlan (object) or (FlexiblePlan (OneTimeSalePlan (object) or SubscriptionOrderPlan (object) or TrialOnlyPlan (object)))
planId
string <= 50 characters
Deprecated

The plan identifier string.

quantity
integer

Number of units of the product on the given plan.

revision
integer

Increments with each override change to this specific item.

isModified
boolean

Indicates if the plan information was modified for this subscription.

isGrandfathered
boolean

Indicates if the plan's current revision is greater than this item's plan revision.

Array of ProductEmbed (object) non-empty

Embedded objects that are requested by the expand query parameter.

object or null

Order delivery address.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

The contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies whether the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies whether the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

The contact's job title.

hash
string <= 40 characters

Use this value to compare contacts for identical attribute values.

object or null

Order billing address.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

The contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies whether the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies whether the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

The contact's job title.

hash
string <= 40 characters

Use this value to compare contacts for identical attribute values.

activationTime
string <date-time>

Order activation time.

voidTime
string <date-time>

Order void time.

poNumber
string or null

Purchase order number, will be displayed on the issued invoices.

object (Shipping)

Shipping settings.

calculator
required
string

Shipping calculator.

amount
required
integer

Shipping amount.

notes
string

Notes for the customer which will be displayed on the order invoice.

status
string

The status of the subscription service. A subscription starts in the pending status, and will become active when the service period begins.

Enum: "pending" "active" "canceled" "churned" "paused" "voided" "completed" "trial-ended"
inTrial
boolean

True if the subscription is currently in a trial period.

object

To use plan defaults do not send the trial key, or send a null. value with it.

enabled
boolean

Enable or disable the trial for this subscription. If enabled for plans without trial prices, the trial will be free.

endTime
string <date-time>

Time and date at which the trial ends. If a trial is enabled on this subscription, a value must be provided.

isTrialOnly
boolean
Default: false

Whether a subscription ends after a trial period. Recurring settings are ignored if it's true.

object or null

You can shift issue time and due time of invoices for this subscription. This setting overrides plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same billing period, this property allows to subscribe to different plans.

object (IssueTimeShiftInstruction)

The calculation instruction of billing time. This is used in conjunction with the service period anchor to calculate the time the invoice is issued.

chronology
required
string

The chronology of the billing time relatively to the service period start.

Value: "before"
duration
required
integer >= 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
object (DueTimeShiftInstruction)
Default: {"duration":1,"unit":"hour"}

The calculation instruction of due time. This is used in conjunction with the billing anchor to calculate due time of invoice. The chronology of due time shift is always after.

duration
required
integer >= 1
Default: 1

The number of the units.

required
TimeUnit (string) or TimePluralUnit (string)
Default: "hour"
object or null

The recurring interval to override plan settings. To use plan settings, set null. To use multiple plans in one subscription they all must have the same recurring period length, this property allows to subscribe to different plans.

object (ServicePeriodAnchorInstruction)
Default: {"method":"immediately"}

Instruction for calculating the service period anchor. This is used in conjunction with the subscription start to calculate the time the service period starts and ends.

method
required
string
Default: "immediately"
day
required
integer [ 1 .. 31 ]

The day of the month when event will be scheduled. Be aware if the month has less days, the last day of the month will be selected.

time
string (TimeIso8601Extended) ^(([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0...

Extended ISO-8601 format of time.

autopay
boolean
Default: true

Autopay determines if a payment attempt will be automatic.

startTime
string or null <date-time>

Subscription start time. When the value is sent as null, it will use the current time. This value can't be in past more than one service period.

endTime
string <date-time>

Subscription end time.

renewalTime
string <date-time>

Subscription renewal time.

rebillNumber
integer

The current period number.

Array of objects

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

Array
type
required
string

Type of line item.

Enum: "debit" "credit"
unitPriceAmount
required
number <double>

Unit price of the line item.

unitPriceCurrency
required
string = 3 characters

Currency code in ISO 4217 format.

quantity
required
integer

Quantity of line item.

description
string

Description of line item.

periodStartTime
string <date-time>

Date-time when the period begins for this item.

periodEndTime
string <date-time>

Date-time when the period ends for this item.

createdTime
string <date-time>

Date-time when the item was added to the subscription.

object

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

currency
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

amount
number <double>
paymentInstrumentId
string or null <= 50 characters

ID of the payment instrument to use for autopay. If not provided or inactive, the customer's default payment instrument will be used.

canceledTime
string <date-time>

Subscription order canceled time.

canceledBy
string

Canceled by.

Enum: "merchant" "customer" "rebilly"
cancelCategory
string

Cancel category.

Enum: "billing-failure" "did-not-use" "did-not-want" "missing-features" "bugs-or-problems" "do-not-remember" "risk-warning" "contract-expired" "too-expensive" "never-started" … 2 more
cancelDescription
string <= 255 characters

Cancel reason description in free form.

customFields
object (ResourceCustomFields)
Default: {}

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.

createdTime
string <date-time>

Order created time.

updatedTime
string <date-time> (UpdatedTime)

Read-only timestamp. This value updates when the resource is updated.

Array of Self (object) non-empty

Related resource links.

Array (non-empty)
Any of:
href
required
string

Link URL.

rel
required
string

Type of link.

Value: "self"
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

409

Conflict.

422

Invalid data was sent.

post/orders/{id}/cancellation
Request samples
application/json
{
  • "reason": "did-not-use",
  • "description": "string"
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "orderType": "subscription-order",
  • "billingStatus": "draft",
  • "websiteId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "currency": "USD",
  • "initialInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "recentInvoiceId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "items": [
    ],
  • "deliveryAddress": {
    },
  • "billingAddress": {
    },
  • "activationTime": "2019-08-24T14:15:22Z",
  • "voidTime": "2019-08-24T14:15:22Z",
  • "poNumber": "PO123456",
  • "shipping": {
    },
  • "notes": "string",
  • "status": "pending",
  • "inTrial": true,
  • "trial": {
    },
  • "isTrialOnly": false,
  • "invoiceTimeShift": null,
  • "recurringInterval": null,
  • "autopay": true,
  • "startTime": null,
  • "endTime": "2019-08-24T14:15:22Z",
  • "renewalTime": "2019-08-24T14:15:22Z",
  • "rebillNumber": 0,
  • "lineItems": [
    ],
  • "lineItemSubtotal": {
    },
  • "paymentInstrumentId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "canceledTime": "2019-08-24T14:15:22Z",
  • "canceledBy": "merchant",
  • "cancelCategory": "billing-failure",
  • "cancelDescription": "string",
  • "customFields": {
    },
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "_links": [
    ]
}