Skip to main content
POST
Requires the subscriptions:write scope. See Authentication.

Authorizations

Authorization
string
header
required

An API key. Its scopes decide what it may call: customers:read (List and look up customers.) customers:write (Create customers, and Xero contacts where the organisation allows it.) catalogue:read (List plans and charges.) subscriptions:read (List and look up subscriptions.) subscriptions:write (Create subscriptions, change units, end and restore them.) invoices:read (List and look up invoices.)

Headers

Idempotency-Key
string

1 to 255 printable characters. A retry with the same key and body returns the first response.

Required string length: 1 - 255
Example:

"signup_8f3a2c1d"

Path Parameters

id
string
required

The Saasybill id of the subscription.

Example:

"9d4e2b7a-13c5-4f8e-b6a0-2e1d7c9f5b33"

Body

application/json
units
integer
required

The new total number of units, not a change.

Required range: 0 <= x <= 999999999
prorate
boolean

Charge or credit for the rest of the period. Default false.

proration_behaviour
enum<string>
Available options:
charge_immediately,
charge_on_renewal
effective_date
string

Required to prorate.

Pattern: ^\d{4}-\d{2}-\d{2}$
document
enum<string>

Required exactly when the next period has already been invoiced (inside the invoice window): amend the renewal invoice, or bill the change on its own. Refused otherwise. The error names the choices.

Available options:
amend,
separate

Response

Success.

id
string
required
object
string
required
Allowed value: "subscription"
customer
string
required
customer_code
string | null
required
plan
string
required
status
enum<string>
required
Available options:
pending,
active,
complete,
ended
currency
string
required
interval
object
required
timezone
string
required
start_date
string
required

YYYY-MM-DD, in the subscription's own timezone.

renewal_date
string | null
required

YYYY-MM-DD, in the subscription's own timezone.

end_date
string | null
required

YYYY-MM-DD, in the subscription's own timezone.

units
integer
required
minimum_units
integer
required
discount_percent
string
required

A decimal string, e.g. "19.9900".

cancel_at_period_end
boolean
required
end_after_cycles
integer | null
required
label
string | null
required
invoice_reference
string | null
required
renewal_value
string
required

A decimal string, e.g. "19.9900".

created
string<date-time>
required

ISO 8601, UTC.

change
object
required