Change how several subscriptions collect
curl --request POST \ --url https://example.com/api/v1/subscriptions/collection-method \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "collectionMethod": "CHARGE_AUTOMATICALLY", "orderIds": [ "example" ] }'Sets collectionMethod on the subscriptions of orderIds in one transaction, each change audited and announced as subscription.updated, exactly as PATCH /orders/{id}/subscription does for one. A canceled subscription is skipped as canceled, and an order outside the workspace or the caller’s order scope, or without a billed subscription, as not_found. Invoices already issued are left as they are. Requires the orders.cancel_subscription permission.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Changes how several orders’ subscriptions collect, in one transaction. Canceled subscriptions and orders without a billed subscription in the caller’s reach are skipped.
object
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.
The orders whose subscriptions change, at most 100.
Responses
Section titled “Responses”The order ids changed, already collecting that way, and skipped.
object
object
Order ids whose subscription changed.
Order ids left alone, each with why.
object
canceled: the subscription is canceled. not_found: no billed subscription on an order in the caller’s reach.
Order ids whose subscription already collected that way.
Example
{ "data": { "skipped": [ { "reason": "canceled" } ] }}Validation error. Parse failures include field paths and expectations.
Validation error with safe field paths and expected values; submitted values are never returned.
object
object
Stable machine-readable error code.
object
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Unauthorized.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Forbidden.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Rate limit exceeded. Wait for Retry-After before retrying.
Standard error envelope.
object
object
Stable machine-readable error code.
Human-readable error message.
HTTP status code, mirrored in the body.
Example
{ "error": { "code": "UNAUTHORIZED" }}Headers
Section titled “Headers”Maximum requests in the current quota window.
Quota policy in requests and window seconds, for example 60;w=60.
Requests left in this quota window (zero when blocked).
Seconds until the current quota window resets, when available from the rate-limit store.
Seconds until another request may be attempted.
Chelsea is operated by Arepa Labs LLC