Skip to content

Convert an order to a Subscription, or attach recurring billing to it

POST
/orders/{id}/create-subscription
Code sample: Shell / cURL
curl --request POST \
--url https://example.com/api/v1/orders/example/create-subscription \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "collectionMethod": "CHARGE_AUTOMATICALLY", "contactId": "example", "currency": "example", "hoursPerPeriod": 1, "interval": "WEEKLY", "intervalCount": 1, "invoiceNote": "example", "lineItems": [ { "description": "example", "discountPercent": 1, "note": "example", "quantity": 1, "rate": 1, "serviceId": "example" } ], "nextChargeDate": "example", "orderTypeId": "example", "periodStart": "example", "renewalPrice": 1, "serviceId": "example" }'

Attaches a billed ClientSubscription to an order with none yet, or whose subscription was canceled (the canceled one stays canceled, as the order’s history): converts an HOUR_BLOCK or TIME_AND_MATERIALS order into a Subscription type, or on an existing SUBSCRIPTION order changes nothing else. Hours logged, balance entries and invoices already issued stay as they are. Nothing is invoiced, charged or emailed now: the first charge runs on nextChargeDate through the renewal job. A conversion is refused when the currency differs from the order’s issued invoices (or its company’s), and when the order is pending, closed (reopen it first with POST /orders/{id}/reopen) or archived. Preview it first with POST /orders/{id}/create-subscription/preview. contactId, invoiceNote and lineItems set who and what its cycle invoices bill; with lineItems, renewalPrice must be their sum. Requires the orders.create_subscription permission, orders.change_type too when it converts an order that is not a Subscription yet, and invoices.create or invoices.manage when it sends contactId, invoiceNote or lineItems (403 otherwise).

id
required

Resource identifier (CUID2).

string
>= 1 characters

Resource identifier (CUID2).

Media typeapplication/json

Attaches manual recurring billing to an existing order with none yet. Converts an HOUR_BLOCK or TIME_AND_MATERIALS order to a Subscription type; on an existing SUBSCRIPTION order it changes nothing else. Nothing is invoiced, charged or emailed now.

object
collectionMethod

How each cycle is collected. CHARGE_AUTOMATICALLY sends the cycle invoice and charges the card on file; SEND_INVOICE only sends the invoice with its payment link, due by the company’s payment terms, and is never charged or retried.

string
Allowed values: CHARGE_AUTOMATICALLY SEND_INVOICE
contactId

A user of the company its cycle invoices are addressed to; left out or null addresses the company’s Billing contact.

Any of:
string
>= 1 characters
currency
required

ISO 4217 currency code, e.g. USD.

string
>= 3 characters <= 3 characters
hoursPerPeriod

Hours the converted order gets every billing period; its current budget hours when left out. Not used when the order already is a Subscription.

number
interval
required
string
Allowed values: WEEKLY MONTHLY QUARTERLY YEARLY
intervalCount

Number of interval units between charges, e.g. 1 for monthly, 3 for a quarterly cadence billed by month.

integer
default: 1 > 0 <= 9007199254740991
invoiceNote

Printed on every cycle invoice; left out, null or empty prints none.

Any of:
string
<= 5000 characters
lineItems

The lines every cycle invoice bills; renewalPrice must be their sum. Left out or empty, each cycle bills renewalPrice as one line named after the order.

Array<object>
<= 100 items
object
description

Required unless serviceId is given, which then lends its name.

string
<= 500 characters
discountPercent

Percentage taken off the line, above 0 and below 100; null for none.

number | null
note
Any of:
string
<= 2000 characters
quantity
required
number
> 0
rate
required
number
serviceId
Any of:
string
>= 1 characters
nextChargeDate
required

First automatic charge date (YYYY-MM-DD), resolved at workspace-local midnight. Must be after today. No invoice or charge is issued by this call — the renewal job bills it automatically once the date arrives.

string
/^\d{4}-\d{2}-\d{2}$/
orderTypeId

The Subscription order type (see GET /order-types) an Hour block or Time & Materials order moves to; the workspace’s system Subscription type when left out. Not used when the order already is a Subscription.

string
>= 1 characters
periodStart

First day of the period the next charge renews, YYYY-MM-DD in the workspace timezone; hours logged from it count against that period. An existing order defaults to one billing interval before nextChargeDate, never before the order’s start; a new order to today.

string
/^\d{4}-\d{2}-\d{2}$/
renewalPrice
required

The price charged every renewal cycle, in currency.

number
serviceId

Service to attribute the subscription to; omit or null for none.

string | null

The order (converted or attached) and its subscription.

Media typeapplication/json
object
data
required
object
hasUsablePaymentMethod
required

Whether the client already has a usable saved payment method. False means the first automatic charge will fall back to a payment link.

boolean
order
required

A client order, opened on one of the workspace’s order types.

object
activityTypes
required

Activity types a time entry against this order may name. A time entry must carry one of these ids; ids are order-scoped, so one from another order is refused.

Array<object>
object
id
required
string
isBillable
required
boolean
name
required
string
archivedAt
required

Set when the order is archived.

Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
billingRateType
required

Billing rate source: NONE, ORDER, MEMBER or ACTIVITY_TYPE.

string
budgetAlertEnabled
required
boolean
budgetFees

The fee budget. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

number | null
budgetType
required

Budget mode, e.g. TOTAL_ORDER_FEES or FEES_PER_ACTIVITY_TYPE.

string | null
clientId
required
string
clientMessageRecipients

The company’s people emailed when the team posts a client-visible message on the order: of the invited, active contacts who can open it in the portal, every Hours holder, else the primary contact, else the oldest one, less those whose own notification preference turns that email off. Internal notes reach nobody. Returned by get only.

Array<object>
object
contactId
required
string
email
required
string
memberId
required
string
name
required
string
reason
required

Why this person receives the order’s chat: they hold the company’s Hours role, or nobody who can open the order does and they are the company’s primary contact, else its oldest invited contact.

string
Allowed values: hours_role primary_contact oldest_contact
code
required
string | null
createdAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
endsAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
expiryDate
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
hourlyRate

The order’s rate per hour. A prepaid order keeps the rate it opened with; a Time & Materials order without an override holds none, since each entry bills at the company rate of its day. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

number | null
id
required
string
isGeneral

True when the order has no primary project, so it sits in its company’s General section, as the company’s Orders tab marks it. Returned by the list only; absent on an older server.

boolean
isInternal
required

True for an order of the organization’s own work rather than a client’s. Time entries on it are left out of compliance auditing and the violation scan.

boolean
isRecurring
required
boolean
linkedAdjustmentsWarning

Sent when an update of the hours leaves linked adjustments out of step. Absent otherwise and on an older server.

object
furtherOrders
required

Orders linked further along the chain.

Array<object>
object
label
required
string
orderId
required
string | null
message
required
string
orders
required
Array<object>
object
adjustmentHours
required

The adjustment as it stands; null when the order is out of reach.

number | null
label
required
string
orderId
required

Null when the order is outside the caller’s reach.

string | null
reason
required

Why a person has to decide; null when suggestedHours is set.

string | null
suggestedHours
required

What it would become if a person confirms; null when left for a person.

number | null
name
required
string
notes
required
string | null
notificationRecipients
required

Read-only notification recipients derived from the union of active client responsibles and responsibles of every linked project, deduplicated by member. Access grants do not define recipients.

Array<object>
object
memberId
required
string
name
required
string
source
required

Whether this notification recipient is responsible for a linked project or the client. Orders cannot assign responsibles.

string
Allowed values: project client
orderType
required

The workspace order type behind type; null only for an order no type was set on yet.

Any of:

The type an order was opened on.

object
behavior
required
string
Allowed values: SUBSCRIPTION HOUR_BLOCK SPRINT TIME_AND_MATERIALS TOKENS NON_BILLABLE
code
required
string
id
required
string
name
required
string
reportRange
required
string
Allowed values: ORDER_START CURRENT_PERIOD CURRENT_MONTH
overagePolicy
required

What an order does with the hours it runs over: CARRY_OVER deducts a recurring order’s overrun from the next period; RESET starts every period at the full budget; ABSORB (fixed scope, non-recurring orders only) takes the overrun as a loss, never billed and never carried.

string
Allowed values: CARRY_OVER RESET ABSORB
primaryProjectId
required

The order’s PRIMARY project — the one that counts for hour/amount totals. Null when the order has no primary membership (“Unassigned”).

string | null
primaryProjectName

The name of the primary project, when the caller reaches that project; null otherwise. Returned by the list only; absent on an older server.

string | null
projectIds
required

Every project this order is linked to (Order <-> Project is N:M via OrderProject).

Array<string>
rateSource
required

Where the rate came from: COMPANY (the company’s rate on the start date), WORKSPACE_DEFAULT (the workspace default, when the company had none) or OVERRIDE (a price agreed for this order). Null on a non-billable order and on one priced before rates came from the company.

Any of:
string
Allowed values: COMPANY WORKSPACE_DEFAULT OVERRIDE
recurringInterval
required
Any of:
string
Allowed values: WEEKLY MONTHLY QUARTERLY YEARLY
recurringIntervalCount
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
startsAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
status
required

Order status: ACTIVE, DEPLETED, CLOSED, ARCHIVED, or PENDING (a portal purchase awaiting Stripe payment confirmation — not settable directly through this API).

string
subscription
required

The order’s subscription, when the order was opened from a recurring service.

Any of:

The subscription that owns a recurring order’s state and billing period.

object
billingAnchor
required

The immutable instant billing periods anchor to, set once when the order is activated by payment and never rewritten. Unset until then.

Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
cancelAtPeriodEnd
required
boolean
cancelReason
required
string | null
canceledAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
collectionMethod
required

How each cycle is collected. CHARGE_AUTOMATICALLY sends the cycle invoice and charges the card on file; SEND_INVOICE only sends the invoice with its payment link, due by the company’s payment terms, and is never charged or retried.

string
Allowed values: CHARGE_AUTOMATICALLY SEND_INVOICE
contactId
required

The company user its cycle invoices are addressed to; null addresses the company’s Billing contact, else its primary user.

string | null
coupon

The coupon still discounting this subscription’s renewals, or null once a REPEATING coupon has used up its cycles. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

Any of:
object
code
required
string
currency
required
string
cyclesRemaining
required

Null unless duration is REPEATING — only that duration counts down.

Any of:
integer
>= -9007199254740991 <= 9007199254740991
discountType
required
string
Allowed values: PERCENTAGE FIXED_AMOUNT
duration
required
string
Allowed values: ONCE REPEATING FOREVER
value
required
number
currency
required
string
currentPeriodEnd
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
currentPeriodStart
required

The current cycle’s start, derived from billingAnchor. Unset until activated.

Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
hasUsableSavedCard
required

Whether the client has a usable saved payment method, from a live Stripe check. Always null on GET /orders (list) — only the single-order GET /orders/{id} affords it.

boolean | null
id
required
string
interval
required
string
Allowed values: WEEKLY MONTHLY QUARTERLY YEARLY
intervalCount
required
integer
>= -9007199254740991 <= 9007199254740991
invoiceNote
required

Printed in the notes of every cycle invoice it generates.

string | null
lineItems

What every cycle invoice bills; renewalPrice is their sum. Empty bills renewalPrice as one line named after the order. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

Array<object>
object
amount
required
number
description
required

What the line prints on every cycle invoice.

string
discountPercent
required

Percentage taken off the line, above 0 and below 100; null for none.

number | null
note
required
string | null
quantity
required
number
rate
required
number
serviceId
required
string | null
nextChargeAmount

The next charge’s total after any active coupon discount and tax. Null on GET /orders (list), which never makes this per-row Stripe check; populated on GET /orders/{id}. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

number | null
nextChargeAt
required

When the next automatic charge is scheduled. Null once nothing further will be billed: canceled, or ending at period close.

Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
renewalPrice

What each cycle bills. Absent when the caller lacks invoices.view, which alone shows what the agency charges.

number
renewalTiming
required

Which day of its cycle invoice the subscription renews on. BILLING_DAY renews the day the invoice is issued; DUE_DATE, only with SEND_INVOICE, renews on its due date, the company’s net days (else the workspace’s) after it is issued. Changing it keeps the next invoice’s issue day and moves the next renewal by the net days.

string
Allowed values: BILLING_DAY DUE_DATE
status
required
string
Allowed values: ACTIVE PAST_DUE SUSPENDED CANCELED PAUSED
suspendedAt
required
Any of:
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/
tokens

A Tokens order’s balance: the tokens it sells and those the root tasks of its linked projects use, archived ones included. Returned by get and list; null for every other behavior.

Any of:
object
total
required
integer
>= -9007199254740991 <= 9007199254740991
used
required
integer
>= -9007199254740991 <= 9007199254740991
totalHours
required
number
totalTokens
required

Tokens a Tokens order sells; null for every other behavior.

Any of:
integer
>= -9007199254740991 <= 9007199254740991
type
required

The order’s behavior, which its type sets. SUBSCRIPTION (Subscription): Renews each period on its renewal day. HOUR_BLOCK (Hour block): Prepaid hours used up over time. Extra blocks and overage can move to a new order. SPRINT (Sprint): Fixed scope with prepaid hours. Overage is absorbed and never billed. TIME_AND_MATERIALS (Time & Materials): No budget. Billed afterwards from the time logged. TOKENS (Tokens): Prepaid tokens. Each root task linked to the order uses one. NON_BILLABLE (Non billable): Time that is not charged, against a monthly budget.

string
updatedAt
required
string format: date-time
/^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$/

Example

{
"data": {
"order": {
"clientMessageRecipients": [
{
"reason": "hours_role"
}
],
"notificationRecipients": [
{
"source": "project"
}
],
"orderType": {
"behavior": "SUBSCRIPTION",
"reportRange": "ORDER_START"
},
"overagePolicy": "CARRY_OVER",
"rateSource": "COMPANY",
"recurringInterval": "WEEKLY",
"subscription": {
"collectionMethod": "CHARGE_AUTOMATICALLY",
"coupon": {
"discountType": "PERCENTAGE",
"duration": "ONCE"
},
"interval": "WEEKLY",
"renewalTiming": "BILLING_DAY",
"status": "ACTIVE"
}
}
}
}

Validation error. Parse failures include field paths and expectations.

Media typeapplication/json

Validation error with safe field paths and expected values; submitted values are never returned.

object
error
required
object
code
required

Stable machine-readable error code.

string
issues
Array<object>
object
expected
required
string
message
required
string
path
required
Array<string | number>
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Unauthorized.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Forbidden.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Not found.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

The order already has a subscription.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Invalid input.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}

Rate limit exceeded. Wait for Retry-After before retrying.

Media typeapplication/json

Standard error envelope.

object
error
required
object
code
required

Stable machine-readable error code.

string
message
required

Human-readable error message.

string
status
required

HTTP status code, mirrored in the body.

integer
>= -9007199254740991 <= 9007199254740991

Example

{
"error": {
"code": "UNAUTHORIZED"
}
}
RateLimit-Limit
string
/^\d+$/

Maximum requests in the current quota window.

RateLimit-Policy
string

Quota policy in requests and window seconds, for example 60;w=60.

RateLimit-Remaining
string
/^\d+$/

Requests left in this quota window (zero when blocked).

RateLimit-Reset
string
/^\d+$/

Seconds until the current quota window resets, when available from the rate-limit store.

Retry-After
string
/^\d+$/

Seconds until another request may be attempted.