Usual Docs
View as Markdown

Commands

Every change you can make. Run one through its endpoint, preview it with POST /plans or ?preview=true, or from an agent with plan_change. GET /commands lists the ones your key may run, with their JSON schemas. See How changes work for risk levels and approvals.

Subscriptions

Re-check subscriptions against Shopify

subscriptions.reconcile

Re-check every subscription against Shopify and fix anything out of date. Runs in the background; check progress with get_sync_status. Safe to run any time: it only reads from Shopify and updates our copy.

Risk: low · Undo: no · Permission: subscriptions:sync · Who: staff, API keys, agents, built-in agents

Endpoint: POST /api/v1/subscriptions/reconcile

No input.

Skip the next delivery

subscriptions.skip_next

Skip the next delivery. The next charge moves on by one delivery interval (e.g. a month). Good for customers with too much product who'd otherwise cancel.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/skip

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID

Move the next delivery

subscriptions.reschedule

Move the next delivery to a specific date (tomorrow to a year out). Later deliveries follow on from the new date at the usual interval.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/reschedule

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
datestring (date)YesNew next delivery date, YYYY-MM-DD in the store's timezone

Pause a subscription

subscriptions.pause

Pause a subscription: no charges or deliveries until it's resumed.

Risk: medium · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/pause

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID

Resume a subscription

subscriptions.resume

Resume a paused subscription. If its next delivery date has passed, the next delivery is tomorrow at the usual time.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/resume

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID

Cancel a subscription

subscriptions.cancel

Cancel a subscription. No more charges or deliveries. Record why: it drives which save offers are worth making. Customers can always cancel in one step.

Risk: high · Undo: no · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/cancel

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
reasontoo_much · too_expensive · taking_break · not_needed · didnt_like · otherYes
commentstring

Keep a customer with an offer

subscriptions.accept_save_offer

Take the offer shown to a customer who was about to cancel (skip, deliver later, less often, pause, swap, or a discount) instead of cancelling. Get the offer first with get_save_offer for the customer's reason; only that offer can be accepted. Recorded as a save in the retention report.

Risk: medium · Undo: no · Permission: subscriptions:write · Who: customers, customers' agents, staff, agents, API keys

Endpoint: POST /api/v1/subscriptions/:subscriptionId/save

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
reasontoo_much · too_expensive · taking_break · not_needed · didnt_like · otherYes
offerskip · later · less_often · pause · swap · discountYesThe offer's kind, from get_save_offer
variantIdstring (starts_with)For swap: the variant chosen

subscriptions.send_payment_update

Email the customer a secure Shopify link to update the card on this subscription. Use it after a declined or expired card, or when a customer asks. At most once an hour per subscription.

Risk: low · Undo: no · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/payment-update

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID

Change a quantity

subscriptions.change_quantity

Change how many of an item come in each delivery. The price per item stays the same; the charge changes with the quantity.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/quantity

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
lineIdstringWhich line (our line id or the Shopify line GID). Optional when there's only one.
quantityinteger (1–99)YesHow many of this item in each delivery

Change how often it delivers

subscriptions.change_frequency

Change how often deliveries come, to another frequency on the same offer (e.g. every 4 weeks instead of every 2). The next charge date stays; later ones follow the new frequency.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/frequency

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
everyinteger (1–52)YesDeliver every N intervals
intervalDAY · WEEK · MONTH · YEARYes

Swap to another variant

subscriptions.swap_variant

Switch an item to another variant of the same product (size, flavour, grind). The subscription discount carries over to the new variant's price.

Risk: low · Undo: yes · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/variant

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
lineIdstringWhich line (our line id or the Shopify line GID). Optional when there's only one.
variantIdstring (starts_with)YesAnother variant of the same product

Change the shipping address

subscriptions.change_address

Ship future deliveries to a new address. The shipping price and method stay as they are, and Shopify refuses an address the store doesn't ship to. The address isn't kept in the activity log.

Risk: low · Undo: no · Permission: subscriptions:write · Who: staff, API keys, agents, built-in agents, customers

Endpoint: POST /api/v1/subscriptions/:subscriptionId/address

FieldTypeRequiredDescription
subscriptionIdstringYesOur subscription id, or the Shopify contract GID
addressobjectYesWhere future deliveries should go
address.firstNamestring
address.lastNamestring
address.companystring
address.address1stringYes
address.address2string
address.citystringYes
address.provinceCodestringProvince or state code, e.g. ON or CA
address.countryCodestringYesTwo-letter country code, e.g. CA
address.zipstring
address.phonestring

Offers

Create an offer

offers.create

Offer subscriptions on products: a name, one or more delivery frequencies, and an optional discount. Shoppers see it on the product page and choose a frequency at checkout.

Risk: medium · Undo: yes · Permission: offers:write · Who: staff, API keys, agents, built-in agents

Endpoint: POST /api/v1/offers

FieldTypeRequiredDescription
namestringYesShown to shoppers, e.g. "Subscribe & save"
descriptionstring
frequenciesobject[]YesDelivery options shoppers can choose from
discountanyYesApplied to every subscription order; null for no discount
productIdsstring (starts_with)[]Yes

Change an offer

offers.update

Change an offer's name, description, delivery frequencies, discount or products. Existing subscriptions keep the terms they started with; changes apply to new subscriptions.

Risk: medium · Undo: yes · Permission: offers:write · Who: staff, API keys, agents, built-in agents

Endpoint: PATCH /api/v1/offers/:id

FieldTypeRequiredDescription
idstringYes
namestring
descriptionstring
frequenciesobject[]
discountany
productIdsstring (starts_with)[]The full set of products; replaces the current set

Stop offering a subscription

offers.delete

Stop offering a subscription option. It disappears from product pages. Existing subscriptions keep running on the terms they started with.

Risk: high · Undo: no · Permission: offers:write · Who: staff, API keys, agents, built-in agents

Endpoint: DELETE /api/v1/offers/:id

FieldTypeRequiredDescription
idstringYes

Billing

Retry a failed payment now

billing.retry_now

Retry a failed charge now instead of waiting for the next scheduled retry, e.g. after the customer says they've updated their card. Charges the customer's payment method.

Risk: financial · Undo: no · Permission: billing:write · Who: staff, API keys, agents, built-in agents

Endpoint: POST /api/v1/billing/cycles/:cycleId/retry

FieldTypeRequiredDescription
cycleIdstringYes

Imports

Upload subscriptions to import

imports.create

Upload a subscriptions export from another app (Recharge, Skio, Appstle, Loop, Seal, Shopify Subscriptions or a spreadsheet). Nothing is created yet: each subscription is checked against the store (customer, saved card, products, date) in the background. Read the import to see what's ready and what needs fixing, then run imports.start.

Risk: low · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: POST /api/v1/imports

FieldTypeRequiredDescription
csvstringYesThe export from the other app, as CSV text, header row first
filenamestring
sourcerecharge · skio · appstle · loop · seal · shopify · otherWhich app it came from. Guessed from the columns when left out.

Create the imported subscriptions

imports.start

Create the import's ready subscriptions in Shopify, keeping each one's next charge date, price and schedule. They're created in the background, one at a time. They don't bill until imports.release_billing, so the old app has time to be switched off. Subscriptions with problems are left out.

Risk: medium · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: POST /api/v1/imports/:importId/start

FieldTypeRequiredDescription
importIdstringYesThe import's id, from imports.create
limitinteger (1–100000)Import only this many (e.g. 10) to check them in Shopify first. The rest stay ready.

Start billing imported subscriptions

imports.release_billing

Start billing an import's subscriptions here. Run it only once the old app has stopped charging them (turned off or uninstalled), or customers will be charged twice. Any whose charge date passed while waiting move to their next date, since the old app charged them.

Risk: high · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: POST /api/v1/imports/:importId/release-billing

FieldTypeRequiredDescription
importIdstringYesThe import's id, from imports.create

Throw away an import

imports.discard

Throw away an import that hasn't created anything yet, e.g. to upload a corrected file. Imports that have created subscriptions can't be discarded.

Risk: low · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: DELETE /api/v1/imports/:importId

FieldTypeRequiredDescription
importIdstringYesThe import's id, from imports.create

Connect Recharge

imports.connect

Connect the app the store is moving from with an API token from it, so subscriptions (and cards held at Stripe, Braintree or Authorize.net) can be fetched directly, and cancelled there when billing switches over. For Recharge the token needs: read_subscriptions, read_customers, read_payment_methods, write_subscriptions. The token is stored encrypted and never shown again.

Risk: medium · Undo: no · Permission: imports:write · Who: staff, API keys

Endpoint: POST /api/v1/imports/connections

Contains a secret (token), so it's hidden in the activity log and can't wait as a plan.

FieldTypeRequiredDescription
sourcerechargeYesThe app to connect. Recharge for now.
tokenstringYesAn API token created in that app

Disconnect Recharge

imports.disconnect

Remove the stored API token for the app the store moved from. Delete the token in that app too.

Risk: low · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: DELETE /api/v1/imports/connections/:source

FieldTypeRequiredDescription
sourcerechargeYes

Fetch subscriptions from Recharge

imports.fetch

Fetch every active subscription from the connected app (Recharge) and check them against the store, like an upload but always current. Nothing is created yet. Read the import, then run imports.start.

Risk: low · Undo: no · Permission: imports:write · Who: staff, API keys, agents

Endpoint: POST /api/v1/imports/connections/:source/fetch

FieldTypeRequiredDescription
sourcerechargeYes

Integrations

Connect Klaviyo

integrations.connect_klaviyo

Send subscription events (started, cancelled, upcoming charge, order placed, payment failed...) to the store's Klaviyo account, for its own flows. The private API key needs: Accounts: Read, Events: Full, Profiles: Full.

Risk: medium · Undo: no · Permission: integrations:write · Who: staff, API keys

Endpoint: POST /api/v1/integrations/klaviyo

Contains a secret (apiKey), so it's hidden in the activity log and can't wait as a plan.

FieldTypeRequiredDescription
apiKeystringYesA Klaviyo private API key (pk_...)

Disconnect Klaviyo

integrations.disconnect_klaviyo

Stop sending subscription events to Klaviyo and remove the stored key.

Risk: low · Undo: no · Permission: integrations:write · Who: staff, API keys, agents

Endpoint: DELETE /api/v1/integrations/klaviyo

No input.

Store

Change store settings

shop.update_settings

Change store-wide subscription settings: sender name, support email, the failed-payment retry schedule, what happens after the final retry, and which customer emails are sent. Only the fields you pass change.

Risk: medium · Undo: yes · Permission: settings:write · Who: staff, API keys, agents, built-in agents

Endpoint: PATCH /api/v1/settings

FieldTypeRequiredDescription
senderNamestringName shown on subscriber emails and texts.
supportEmailstring (email)Where subscriber replies go. null to use the store's contact email.
accountPageUrlstring (uri)The store's Subscriptions page in customer accounts, copied from the checkout and accounts editor. Customer emails and links go there. null to use the customer account home.
dunningRetryDaysinteger[]Days after a failed charge to retry it, in order.
afterFinalRetrypause · cancelWhat happens to a subscription when every retry has failed.
billingPausedbooleanStop all new charges for this store. Charges already sent still finish.
noticesobjectWhich customer emails Usual sends. Turn off any you'd rather send yourself.
notices.confirmationbooleanYesEmail subscribers their terms and how to cancel when they sign up.
notices.upcomingChargebooleanYesRemind subscribers before each renewal charge.
notices.upcomingChargeDaysinteger (1–14)YesHow many days before a charge to remind them.
notices.paymentFailedbooleanYesTell subscribers when a renewal payment fails.
notices.cancelledbooleanYesConfirm cancellations by email.
retentionobjectWhat customers are offered when they go to cancel.
retention.offersobjectYesWhich offers customers can see when they cancel. One fits their reason; cancelling stays one click.
retention.offers.skipbooleanYesSkip the next delivery instead.
retention.offers.laterbooleanYesGet the next delivery two weeks later.
retention.offers.lessOftenbooleanYesSwitch to a less frequent schedule from the subscription's offer.
retention.offers.pausebooleanYesPause until they resume.
retention.offers.swapbooleanYesSwap to another option of the same product.
retention.offers.discountbooleanYesA discount on the next few deliveries.
retention.discountPercentinteger (5–50)YesThe discount, in percent.
retention.discountDeliveriesinteger (1–6)YesHow many deliveries the discount lasts.

Keys

Create a key

api_client.create

Create an API key or agent credential. The token is returned once and never shown again.

Risk: high · Undo: no · Permission: * · Who: staff

FieldTypeRequiredDescription
namestringYes
kindapi_key · agentYesagent: an AI agent. Its writes always need a preview first, and riskier ones need approval.
scopessettings:read · settings:write · audit:read · subscriptions:read · subscriptions:write · subscriptions:sync · offers:read · offers:write · billing:read · billing:write · imports:read · imports:write · integrations:write[]Yes

Revoke a key

api_client.revoke

Revoke an API key or agent credential. It stops working immediately.

Risk: high · Undo: no · Permission: * · Who: staff

FieldTypeRequiredDescription
idstringYes