# Create a Contact > This file is very large and may be truncated. For an index of this content, please refer to https://docs.stora.co/llms.txt instead. Source: https://docs.stora.co/2025-09/api-reference/contacts/create-a-contact /2025-09/openapi.json post /2025-09/contacts Create a contact, such as a lead captured outside Stora. `email` is required and must be unique for the operator. The contact starts with the `lead` status and a `contact.created` webhook fires. Send an `Idempotency-Key` header so a retried request doesn't create a duplicate. To record a lead's interest in storage as well, use **Create an Opportunity** instead. It can create the contact in the same request. Required authorization scope: `public.contact:write` # Delete a Contact Source: https://docs.stora.co/2025-09/api-reference/contacts/delete-a-contact /2025-09/openapi.json delete /2025-09/contacts/{contact_id} Delete a contact that has no subscriptions and no invoices. Any other contact returns `409 Conflict`. Deleting the contact also deletes its deals, opportunities, orders, contracts and tasks. Required authorization scope: `public.contact:write` # List all Contacts Source: https://docs.stora.co/2025-09/api-reference/contacts/list-all-contacts /2025-09/openapi.json get /2025-09/contacts List the operator's contacts, newest first by default. Filter by `status`, `email` or `search` (name, email or phone), and use `fields` to keep responses small when syncing large lists. To find a contact's rentals, use **List all Tenancies** or **List all Subscriptions** filtered by `contact_id` instead. Required authorization scope: `public.contact:read` # Show a Contact Source: https://docs.stora.co/2025-09/api-reference/contacts/show-a-contact /2025-09/openapi.json get /2025-09/contacts/{contact_id} Retrieve one contact by its ID. To look up a contact by email, use **List all Contacts** with the `email` filter instead. Required authorization scope: `public.contact:read` # Update a Contact Source: https://docs.stora.co/2025-09/api-reference/contacts/update-a-contact /2025-09/openapi.json patch /2025-09/contacts/{contact_id} Update a contact's details. Fields you leave out are unchanged, and a `contact.updated` webhook fires. Required authorization scope: `public.contact:write` # List all Contract Templates Source: https://docs.stora.co/2025-09/api-reference/contract-templates/list-all-contract-templates /2025-09/openapi.json get /2025-09/contract_templates List the operator's contract templates, excluding archived ones. Use a template's ID as `contract_template.id` on **Create an Order** or **Update an Order** to choose the contract generated when the order completes. The order ignores the template unless the operator uses integrated contracts. Required authorization scope: `public.contract_template:read` # Show a Contract Template Source: https://docs.stora.co/2025-09/api-reference/contract-templates/show-a-contract-template /2025-09/openapi.json get /2025-09/contract_templates/{contract_template_id} Retrieve a contract template by its ID. Archived contract templates are not returned. Required authorization scope: `public.contract_template:read` # List all Contracts Source: https://docs.stora.co/2025-09/api-reference/contracts/list-all-contracts /2025-09/openapi.json get /2025-09/contracts List contracts. A contract is a rental agreement for a tenancy, generated from a contract template for the contact to sign. If the operator uses integrated contracts, Stora generates a contract when an order completes, from the order's contract template or the unit type's. For an order that starts immediately (`starts_at: now`), Stora generates it once the first invoice is created. Filter by `status`, such as `pending` or `signed`, or by `contact_id`, `tenancy_id`, `site_id` or `contract_template_id`. Required authorization scope: `public.contract:read` # Show a Contract Source: https://docs.stora.co/2025-09/api-reference/contracts/show-a-contract /2025-09/openapi.json get /2025-09/contracts/{contract_id} Retrieve a contract with its `status` and when it was sent and signed. Expand `tenancy` or `contract_template` to include them. Supports PDF download. Set `application/pdf` in the `Accept` request header. Only signed contracts return a PDF. Required authorization scope: `public.contract:read` # List all Coupons Source: https://docs.stora.co/2025-09/api-reference/coupons/list-all-coupons /2025-09/openapi.json get /2025-09/coupons List the operator's redeemable coupons. A coupon takes a `percent` or a fixed `amount` off, applied `once`, `forever` or for a number of `months` (`repeating`). The list leaves out deleted coupons and coupons past their redemption deadline. Coupons are read-only. To match a code that a contact enters, page through the list and compare `code`. Public coupons have no `code`. To apply a coupon, set `coupon.id` in **Create an Order** or **Update an Order**. Use **Create a Price Adjustment** instead to change an existing subscription's prices. Required authorization scope: `public.coupon:read` # Show a Coupon Source: https://docs.stora.co/2025-09/api-reference/coupons/show-a-coupon /2025-09/openapi.json get /2025-09/coupons/{coupon_id} Retrieve a coupon with its discount (`percent` or `amount`), `duration`, `code` and the line items it applies to automatically (`auto_apply_to`). A deleted coupon or a coupon past its redemption deadline returns `404`. To use the coupon, set `coupon.id` in **Create an Order** or **Update an Order**. The coupon must still be redeemable on the order's start date. Required authorization scope: `public.coupon:read` # List all Credit Notes Source: https://docs.stora.co/2025-09/api-reference/credit-notes/list-all-credit-notes /2025-09/openapi.json get /2025-09/credit_notes List credit notes. A credit note reduces or refunds an invoice. A `pre_payment` credit note lowers the amount due before payment, a `post_payment` credit note credits or refunds after payment, and a `deposit_refund` credit note refunds a security deposit. Credit notes are read-only in the API. Filter by `invoice_id`, `contact_id`, `site_id` or `status` (`issued` or `void`). Expand `contact`, `invoice` or `site`. Required authorization scope: `public.credit_note:read` # Show a Credit Note Source: https://docs.stora.co/2025-09/api-reference/credit-notes/show-a-credit-note /2025-09/openapi.json get /2025-09/credit_notes/{credit_note_id} Retrieve a credit note with its line items, amounts and `reason`. Expand `contact`, `invoice` or `site`. Send `Accept: application/pdf` to download the credit note PDF instead of JSON. Required authorization scope: `public.credit_note:read` # List all Stages Source: https://docs.stora.co/2025-09/api-reference/deals-stages/list-all-stages /2025-09/openapi.json get /2025-09/deals/stages List the stages of the operator's deal pipeline. Stages that are archived, or being archived, aren't returned. Sort by `position` ascending to get them in board order. Use a stage ID to create a deal, to move one with **Update a Deal**, or to reopen one. Required authorization scope: `public.deal_stage:read` # Show a Deal Stage Source: https://docs.stora.co/2025-09/api-reference/deals-stages/show-a-deal-stage /2025-09/openapi.json get /2025-09/deals/stages/{stage_id} Retrieve one deal pipeline stage by its ID. A stage that is archived, or being archived, returns `404 Not Found`. Required authorization scope: `public.deal_stage:read` # Create a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/create-a-deal /2025-09/openapi.json post /2025-09/deals Create an open deal for a contact and place it on the pipeline board at the given stage. `name`, `contact` and a `stage` from **List all Stages** are required. A `deal.created` webhook fires, and an assigned staff member is notified by email. A `protection` line item must use a protection level from the deal's site. Global levels aren't accepted. Send an `Idempotency-Key` header so a retried request doesn't create a duplicate. See [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). Use **Create a Deal from an Opportunity** instead when the lead was captured as an opportunity. It copies the opportunity's contact, site and line items, and associates the two. Required authorization scope: `public.deal:write` # Delete a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/delete-a-deal /2025-09/openapi.json delete /2025-09/deals/{deal_id} Permanently delete a deal. Opportunities associated with it are released and return to `open`, or to `archived` if they were archived while associated. To keep the deal's history, use **Lose a Deal** instead. Required authorization scope: `public.deal:write` # List all Deals Source: https://docs.stora.co/2025-09/api-reference/deals/list-all-deals /2025-09/openapi.json get /2025-09/deals List the operator's deals, newest first by default. Filter by `status` (`open`, `won` or `lost`), `stage_id`, `contact_id` or `assignee_id`, and expand `contact`, `stage`, `site` or `assignee` to fetch them in the same request. To find the opportunities associated with a deal, use **List all Opportunities** filtered by `deal_id` instead. Required authorization scope: `public.deal:read` # Lose a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/lose-a-deal /2025-09/openapi.json post /2025-09/deals/{deal_id}/lose Close an open deal as lost, with the reason the contact didn't book. Use **Win a Deal** instead when the contact books. Only deals that aren't already won or lost can be closed. The deal leaves the pipeline board and a `deal.lost` webhook fires. Use **Reopen a Deal** to undo. Required authorization scope: `public.deal:write` # Reopen a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/reopen-a-deal /2025-09/openapi.json post /2025-09/deals/{deal_id}/reopen Reopen a won or lost deal and put it back on the pipeline board. The deal returns to the given `stage`, or to its last stage when none is sent, and its lost reason is cleared. A `deal.reopened` webhook fires. An open deal can't be reopened. If the deal's last stage has been archived, send a `stage` from **List all Stages**. Required authorization scope: `public.deal:write` # Show a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/show-a-deal /2025-09/openapi.json get /2025-09/deals/{deal_id} Retrieve one deal by its ID. Expand `contact`, `stage`, `site` or `assignee` to fetch them in the same request. Required authorization scope: `public.deal:read` # Update a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/update-a-deal /2025-09/openapi.json patch /2025-09/deals/{deal_id} Update a deal's details or move it to another stage. Fields you leave out are unchanged. A `deal.updated` webhook fires, plus `deal.stage_changed` when the stage changes, and a newly assigned staff member is notified by email. A `protection` line item must use a protection level from the deal's site. Global levels aren't accepted. See [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). The stage of a won or lost deal can't be changed. Use **Reopen a Deal** first. To close a deal, use **Win a Deal** or **Lose a Deal** instead. Required authorization scope: `public.deal:write` # Win a Deal Source: https://docs.stora.co/2025-09/api-reference/deals/win-a-deal /2025-09/openapi.json post /2025-09/deals/{deal_id}/win Close an open deal as won when the contact books. Use **Lose a Deal** instead when they don't, and **Reopen a Deal** to undo. The deal leaves the pipeline board and a `deal.won` webhook fires. Winning doesn't create an order, and orders aren't linked to deals. Use **Create an Order** to book the storage. Required authorization scope: `public.deal:write` # List all Identity Verifications Source: https://docs.stora.co/2025-09/api-reference/identity-verifications/list-all-identity-verifications /2025-09/openapi.json get /2025-09/identity_verifications List ID document checks that contacts complete online, newest first by default. Filter by `contact_id` or `status`, and expand `contact` to fetch it in the same request. Identity verifications are read-only in the API. To follow status changes as they happen, subscribe to the `identity_verification.*` webhooks instead of polling. Required authorization scope: `public.identity_verification:read` # Show an Identity Verification Source: https://docs.stora.co/2025-09/api-reference/identity-verifications/show-an-identity-verification /2025-09/openapi.json get /2025-09/identity_verifications/{identity_verification_id} Retrieve one identity verification by its ID. When `status` is `failed`, `error_code` gives the reason. Required authorization scope: `public.identity_verification:read` # Get an image Source: https://docs.stora.co/2025-09/api-reference/images/get-an-image /2025-09/openapi.json get /2025-09/images/{token}/{filename} Redirects (`302`) to a download link for a site, unit type or product image. Take this URL from the resource's `images` field instead of building it. The URL stays valid, but the link it redirects to expires after about 5 minutes. No access token is needed. # List all Invoices Source: https://docs.stora.co/2025-09/api-reference/invoices/list-all-invoices /2025-09/openapi.json get /2025-09/invoices List invoices. A `subscription` invoice bills one billing period, an `ad_hoc` invoice bills one-off charges, and a `deposit` invoice bills a security deposit. Invoices are read-only in the API. Use **List all Credit Notes** for amounts credited against them. Filter by `contact_id`, `site_id`, `subscription_id`, `tenancy_id`, `type`, `status` or `collection_status` (for example `overdue`). Expand `contact`, `site`, `subscription` or `tenancy`. See [Core concepts](https://docs.stora.co/2025-09/guides/core-concepts). Required authorization scope: `public.invoice:read` # Show an Invoice Source: https://docs.stora.co/2025-09/api-reference/invoices/show-an-invoice /2025-09/openapi.json get /2025-09/invoices/{invoice_id} Retrieve an invoice with its line items and amounts. A `draft` invoice becomes `open` when finalized, and then `paid`, `uncollectible` or `void`. A deleted draft has the status `deleted`. `collection_status` shows whether an open invoice is overdue. `payment_url` links an open invoice to its hosted payment page. Expand `contact`, `site`, `subscription` or `tenancy`. Send `Accept: application/pdf` to download the invoice PDF instead of JSON. Required authorization scope: `public.invoice:read` # Create a Note Source: https://docs.stora.co/2025-09/api-reference/notes/create-a-note /2025-09/openapi.json post /2025-09/notes Add a free-text note to a contact, unit, subscription or task (`resource`). A note on a contact, unit or subscription also appears on its timeline in Stora. A `note.created` webhook fires. Send an `Idempotency-Key` header so a retried request doesn't create a duplicate. To record structured activity from an external system, use **Create an Event** instead. It shows a templated message from your integration on the timelines of the resources it references. Required authorization scope: `public.note:write` # Delete a Note Source: https://docs.stora.co/2025-09/api-reference/notes/delete-a-note /2025-09/openapi.json delete /2025-09/notes/{note_id} Permanently delete any note, including ones staff or other integrations wrote, along with its entry on the resource's timeline. No webhook fires. Required authorization scope: `public.note:write` # List all Notes Source: https://docs.stora.co/2025-09/api-reference/notes/list-all-notes /2025-09/openapi.json get /2025-09/notes List the notes on the operator's contacts, units, subscriptions and tasks, newest first by default. Filter by `resource_type` or `resource_id`, and expand `resource` or `creator` to fetch them in the same request. Required authorization scope: `public.note:read` # Show a Note Source: https://docs.stora.co/2025-09/api-reference/notes/show-a-note /2025-09/openapi.json get /2025-09/notes/{note_id} Retrieve one note by its ID. Expand `resource` or `creator` to fetch them in the same request. Required authorization scope: `public.note:read` # Update a Note Source: https://docs.stora.co/2025-09/api-reference/notes/update-a-note /2025-09/openapi.json patch /2025-09/notes/{note_id} Change a note's `content` or `metadata`, or move it to another contact, unit, subscription or task with `resource`, including notes written by staff or other integrations. Fields you leave out are unchanged. The note's timeline entry stays on the original resource. A `note.updated` webhook fires when the content or resource changes. Required authorization scope: `public.note:write` # Introspect an Access Token Source: https://docs.stora.co/2025-09/api-reference/oauth-2/introspect-an-access-token /2025-09/openapi.json post /oauth2/introspect Check whether another Access Token is active, with its scopes, client, and expiry. Authenticate with your client credentials, or with a different Access Token from the same application in the `Authorization` header. A token can't introspect itself. To inspect the token you're calling with, use **Retrieve info for the Access Token** instead. # Retrieve an Access Token Source: https://docs.stora.co/2025-09/api-reference/oauth-2/retrieve-an-access-token /2025-09/openapi.json post /oauth2/token Retrieve an Access Token. Set `grant_type` to `client_credentials` for backend access to an account you manage, `authorization_code` after an operator authorizes your partner app, or `refresh_token` to renew an Authorization Code token. Tokens expire after 2 hours (`expires_in`). Cache and reuse a token instead of requesting one per call. Client Credentials returns no `refresh_token`. While a Client Credentials token has over a quarter of its lifetime left, a request with the same scopes returns that same token, so revoking it revokes it for every caller. See [Authentication](https://docs.stora.co/2025-09/guides/authentication). # Retrieve info for the Access Token Source: https://docs.stora.co/2025-09/api-reference/oauth-2/retrieve-info-for-the-access-token /2025-09/openapi.json get /oauth2/token/info Retrieve the scopes, remaining lifetime, application, and operator of the Access Token in the `Authorization` header, for example to check which operator a token acts for. No scope is needed. To check a different token, use **Introspect an Access Token** instead. # Revoke an Access Token Source: https://docs.stora.co/2025-09/api-reference/oauth-2/revoke-an-access-token /2025-09/openapi.json post /oauth2/revoke Revoke an Access Token, for example when an operator disconnects Stora from your app. Authenticate with your `client_id` and `client_secret`. Pass either the access token or its refresh token as `token`. Both stop working. Revoking an unknown or already revoked token still succeeds. Webhook endpoints you created keep receiving events after you revoke, so delete them first. # Archive an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/archive-an-opportunity /2025-09/openapi.json post /2025-09/opportunities/{opportunity_id}/archive Archive an open opportunity for a lead you no longer work. It keeps its data, and **Unarchive an Opportunity** returns it to `open`. Use **Delete an Opportunity** instead to remove it. Only an `open` opportunity can be archived. An archived opportunity, or one associated with a deal, returns `409 Conflict`. An `opportunity.archived` webhook fires. Required authorization scope: `public.opportunity:write` # Associate an Opportunity with a Deal Source: https://docs.stora.co/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal /2025-09/openapi.json post /2025-09/opportunities/{opportunity_id}/associate_deal Associate an opportunity with an existing deal of the same contact. Use **Create a Deal from an Opportunity** instead to make a new deal. A deal can have several opportunities, but an opportunity can have only one deal. The deal and its line items aren't changed. An archived opportunity is unarchived, and an `opportunity.associated` webhook fires. See [Capture and qualify leads](https://docs.stora.co/2025-09/guides/opportunities-and-deals). Required authorization scopes: `public.opportunity:write`, `public.deal:write` # Create a Deal from an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity /2025-09/openapi.json post /2025-09/opportunities/{opportunity_id}/deal Create a deal from a qualified opportunity and associate the two. Use **Associate an Opportunity with a Deal** instead when the deal already exists, or **Create a Deal** for a deal without an opportunity. The deal copies the opportunity's contact, site and line items, and starts at the given `stage`. Its name is " Deal" unless you send `name`. An archived opportunity is unarchived. `deal.created` and `opportunity.associated` webhooks fire, and an assignee is notified by email. Send an `Idempotency-Key` header so a retry doesn't create a second deal. See [Capture and qualify leads](https://docs.stora.co/2025-09/guides/opportunities-and-deals). Required authorization scopes: `public.opportunity:write`, `public.deal:write` # Create an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/create-an-opportunity /2025-09/openapi.json post /2025-09/opportunities Capture a lead's interest in storage before it becomes a deal. Send `contact.id` for an existing contact (other contact fields update it) or `contact.email` for a new one. Use **List all Contacts** with the `email` filter to check first, because an email that's already in use is rejected. Line items require a site, and each item must belong to that site. A global protection level ID is replaced by that level's copy at the opportunity's site, when the site has one. The opportunity starts `open` with the `public_api` source and fires `opportunity.created`. It doesn't reserve a unit or create an order. Send an `Idempotency-Key` header so a retry doesn't create a duplicate. See [Capture and qualify leads](https://docs.stora.co/2025-09/guides/opportunities-and-deals). Required authorization scope: `public.opportunity:write` # Delete an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/delete-an-opportunity /2025-09/openapi.json delete /2025-09/opportunities/{opportunity_id} Permanently delete an opportunity, such as one captured by mistake, and fire an `opportunity.deleted` webhook. An opportunity associated with a deal can't be deleted. Use **Disassociate an Opportunity from its Deal** first. To set aside a lead you no longer work, use **Archive an Opportunity** instead. Required authorization scope: `public.opportunity:write` # Disassociate an Opportunity from its Deal Source: https://docs.stora.co/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal /2025-09/openapi.json delete /2025-09/opportunities/{opportunity_id}/associate_deal Remove the association between an opportunity and its deal, so you can associate it with another deal or create a new deal from it. The opportunity returns to `open`, or to `archived` if it was archived while associated. The deal isn't changed. See [Capture and qualify leads](https://docs.stora.co/2025-09/guides/opportunities-and-deals). Required authorization scopes: `public.opportunity:write`, `public.deal:write` # List all Opportunities Source: https://docs.stora.co/2025-09/api-reference/opportunities/list-all-opportunities /2025-09/openapi.json get /2025-09/opportunities List the operator's opportunities, newest first by default. Filter by `status` (`open`, `archived` or `associated`), `contact_id` or `deal_id`, and expand `contact`, `deal` or `site` to fetch them in the same request. Required authorization scope: `public.opportunity:read` # Show an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/show-an-opportunity /2025-09/openapi.json get /2025-09/opportunities/{opportunity_id} Retrieve one opportunity by its ID. Expand `contact`, `deal` or `site` to fetch them in the same request. Required authorization scope: `public.opportunity:read` # Unarchive an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/unarchive-an-opportunity /2025-09/openapi.json post /2025-09/opportunities/{opportunity_id}/unarchive Return an archived opportunity to `open` when the lead's interest resumes. Only an `archived` opportunity can be unarchived. An open opportunity, or one associated with a deal, returns `409 Conflict`. An `opportunity.unarchived` webhook fires. Required authorization scope: `public.opportunity:write` # Update an Opportunity Source: https://docs.stora.co/2025-09/api-reference/opportunities/update-an-opportunity /2025-09/openapi.json patch /2025-09/opportunities/{opportunity_id} Update an opportunity's site, line items or metadata while you qualify the lead. The contact can't be changed, and once the opportunity is associated with a deal only its metadata can be updated. An `opportunity.updated` webhook fires. Omitting `line_items` leaves them unchanged, and an empty array removes them. A line item requires a site, so moving or clearing the site while keeping line items from the old site is rejected. A global protection level ID is replaced by that level's copy at the opportunity's site, when the site has one. Required authorization scope: `public.opportunity:write` # Create a Line Item Source: https://docs.stora.co/2025-09/api-reference/orders-line-items/create-a-line-item /2025-09/openapi.json post /2025-09/orders/{order_id}/line_items Add a line item to a `draft` order. `item.id` must be a unit type for `unit_type` and `security_deposit`, a protection level for `protection`, or a product for `product`, at the order's site. Global protection levels aren't accepted. Recurring items use the order's `billing_period`, so set it first. One-time products and security deposits are charged once. Send an `Idempotency-Key` header so a retry doesn't add a duplicate. See [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.order:write` # Delete a Line Item Source: https://docs.stora.co/2025-09/api-reference/orders-line-items/delete-a-line-item /2025-09/openapi.json delete /2025-09/orders/{order_id}/line_items/{line_item_id} Permanently remove a line item from a `draft` order. An order needs at least one `unit_type` line item to be finalized. Required authorization scope: `public.order:write` # List all Line Items Source: https://docs.stora.co/2025-09/api-reference/orders-line-items/list-all-line-items /2025-09/openapi.json get /2025-09/orders/{order_id}/line_items List the line items of an order. Filter by `type` (`unit_type`, `protection`, `product` or `security_deposit`), and expand `item` for the unit type, protection level or product. **Show an Order** with `expand=line_items` returns them too. Required authorization scope: `public.order:read` # Update a Line Item Source: https://docs.stora.co/2025-09/api-reference/orders-line-items/update-a-line-item /2025-09/openapi.json patch /2025-09/orders/{order_id}/line_items/{line_item_id} Change the `quantity` or `price.amount` of a line item on a `draft` order. To change its type or item, use **Delete a Line Item** and **Create a Line Item**. Required authorization scope: `public.order:write` # Abandon an Order Source: https://docs.stora.co/2025-09/api-reference/orders/abandon-an-order /2025-09/openapi.json post /2025-09/orders/{order_id}/abandon Mark a `draft` or `finalized` order as `abandoned` when the contact hasn't come back to complete it. Don't use it for operator-driven cancellations. An abandoned order can't be updated or finalized, and its `payment_url` stops working. A checkout the contact already opened can still complete the order. An `order.abandoned` webhook fires. Use **Delete an Order** instead to remove the order. Required authorization scope: `public.order:write` # Create an Order Source: https://docs.stora.co/2025-09/api-reference/orders/create-an-order /2025-09/openapi.json post /2025-09/orders Create an order to book storage at a site. Only `site` is required, so you can build a `draft` order step by step and check it with **Validate an Order**. Give `contact.id` for an existing contact, or contact fields including `email` for a new one. An `order.created` webhook fires. Add `finalize` to finalize the order in the same request. The response then has a `payment_url`. If finalizing fails, nothing is saved. Send an `Idempotency-Key` header so a retry doesn't create a duplicate. Protection levels must belong to the order's site. Global levels aren't accepted. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow) and [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). Required authorization scope: `public.order:write` # Delete an Order Source: https://docs.stora.co/2025-09/api-reference/orders/delete-an-order /2025-09/openapi.json delete /2025-09/orders/{order_id} Delete an order in any status, with any opportunity the storefront created for it. A subscription and tenancy created from the order are kept. Use **Abandon an Order** instead to keep a record of an order the contact didn't complete. Required authorization scope: `public.order:write` # Finalize an Order Source: https://docs.stora.co/2025-09/api-reference/orders/finalize-an-order /2025-09/openapi.json post /2025-09/orders/{order_id}/finalize Finalize a `draft` order and create its hosted checkout. The order becomes `finalized`, the response has a `payment_url` for the contact, and an `order.finalized` webhook fires. A finalized order can't be updated. For Stora to email the link, set `email_notifications.payment_details` on the order before you finalize it. The checkout saves a payment method but doesn't take payment. When the contact completes it, the order becomes `completed`, `order.completed` fires, and Stora creates the order's subscription and tenancy. Use **Create an Order** with `finalize` to create and finalize an order in one request. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.order:write` # List all Orders Source: https://docs.stora.co/2025-09/api-reference/orders/list-all-orders /2025-09/openapi.json get /2025-09/orders List orders, newest first. An order goes from `draft` to `finalized` (waiting for the contact to check out) to `completed`, or is `abandoned`. Filter by `status`, `contact_id`, `site_id` or `source`, and expand `line_items` or `contact` to include them. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.order:read` # Show an Order Source: https://docs.stora.co/2025-09/api-reference/orders/show-an-order /2025-09/openapi.json get /2025-09/orders/{order_id} Retrieve an order with its status, line items and totals, and its `payment_url` while it's `finalized`. Expand `line_items`, `contact`, `subscription` or `tenancy` to include them. An order has a subscription and a tenancy only once it's `completed`. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.order:read` # Update an Order Source: https://docs.stora.co/2025-09/api-reference/orders/update-an-order /2025-09/openapi.json patch /2025-09/orders/{order_id} Change a `draft` order. Orders in other statuses can't be updated. Fields you leave out are unchanged. Sending `line_items` replaces the whole list: items with an `id` are updated, items without one are added, and the rest are removed. Use **Create a Line Item**, **Update a Line Item** or **Delete a Line Item** to change one item at a time. Protection levels must belong to the order's site. Global levels aren't accepted. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow) and [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). Required authorization scope: `public.order:write` # Validate an Order Source: https://docs.stora.co/2025-09/api-reference/orders/validate-an-order /2025-09/openapi.json get /2025-09/orders/{order_id}/validate Check whether an order is ready for **Finalize an Order** without changing it. It checks for a contact with name, email and phone, `starts_at`, `billing_period`, a `unit_type` line item, and a coupon valid on the start date. It doesn't check the order's status. Only `draft` orders can be finalized. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.order:read` # Create a Price Adjustment Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/create-a-price-adjustment /2025-09/openapi.json post /2025-09/price_adjustments Create a price adjustment that changes a subscription's recurring prices by a percentage for each type in `percentages`. `effective_from` resolves to the first renewal date on or after it, returned as `adjust_on`. The subscription must be active, billed through Stripe, and not archived or scheduled to end. The adjustment is created as a `draft`, or as `pending` with `schedule: true`. To schedule a draft later, use **Schedule a Price Adjustment**. A subscription can have only one scheduled adjustment at a time, but any number of drafts. A `notification.notice_period` of `null` needs the `public.price_adjustment:skip_notifications` scope. Omitting `notification` needs that scope too when the operator's default is no notice. Send an `Idempotency-Key` header so a retry doesn't create a duplicate. See [Schedule a subscription price adjustment](https://docs.stora.co/2025-09/guides/price-adjustments). Required authorization scope: `public.price_adjustment:write` # Delete a Price Adjustment Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/delete-a-price-adjustment /2025-09/openapi.json delete /2025-09/price_adjustments/{price_adjustment_id} Permanently delete a `draft`, `pending` or `cancelled` price adjustment. There's no separate cancel operation. To cancel a `pending` adjustment, delete it. Once an adjustment is `processing` or later, you can't delete it. No webhook fires and Stora doesn't tell the contact. If Stora already sent the price notice, tell the contact yourself. Required authorization scope: `public.price_adjustment:write` # List all Price Adjustments Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/list-all-price-adjustments /2025-09/openapi.json get /2025-09/price_adjustments List price adjustments. A price adjustment changes a subscription's recurring prices by a percentage on a future renewal date. Filter by `subscription_id`, by `status` (for example `pending` for scheduled adjustments), or by `adjust_after` and `adjust_before`. Expand `subscription` or `invoice`. Use **List all Coupons** instead for discounts applied to orders. See [Schedule a subscription price adjustment](https://docs.stora.co/2025-09/guides/price-adjustments). Required authorization scope: `public.price_adjustment:read` # Schedule a Price Adjustment Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment /2025-09/openapi.json post /2025-09/price_adjustments/{price_adjustment_id}/schedule Schedule a `draft` price adjustment. It becomes `pending`, Stora recalculates `estimation` from current prices, and a `price_adjustment.scheduled` webhook fires. Stora emails the price notice to the contact on the notice date, or at once for `send_immediately` or a notice date that has passed. Stora sends no email when the operator has turned off all emails. A draft with no notice needs the `public.price_adjustment:skip_notifications` scope. A `409` means the adjustment can't be scheduled. For example, it isn't a `draft`, its `adjust_on` is today or in the past, the subscription already has a scheduled adjustment, or the subscription is no longer eligible. Use **Delete a Price Adjustment** to call off a scheduled adjustment before it's applied. See [Schedule a subscription price adjustment](https://docs.stora.co/2025-09/guides/price-adjustments). Required authorization scope: `public.price_adjustment:write` # Show a Price Adjustment Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/show-a-price-adjustment /2025-09/openapi.json get /2025-09/price_adjustments/{price_adjustment_id} Retrieve a price adjustment. A `draft` becomes `pending` when scheduled. The day before `adjust_on`, in the operator's timezone, Stora updates the subscription's prices. The adjustment moves to `processing`, then `adjusted`, and becomes `invoiced` once the renewal invoice is finalized. It becomes `cancelled` if the subscription ends first, or `failed` if applying it fails. If the renewal date has moved, it returns to `pending` with a new `adjust_on`. `estimation` holds the estimated amounts, and `adjustment` holds the billed amounts once the adjustment is applied. Expand `subscription` or `invoice` to include them. Required authorization scope: `public.price_adjustment:read` # Update a Price Adjustment Source: https://docs.stora.co/2025-09/api-reference/price-adjustments/update-a-price-adjustment /2025-09/openapi.json patch /2025-09/price_adjustments/{price_adjustment_id} Change a `draft` price adjustment's `percentages`, `effective_from` or `notification`. Fields you leave out are unchanged. `effective_from` re-resolves `adjust_on`. Stora recalculates the estimates and fires a `price_adjustment.updated` webhook. A scheduled adjustment can't be changed. Delete it and create a new one instead. A `notification.notice_period` of `null` needs the `public.price_adjustment:skip_notifications` scope. Updating a draft that already has no notice needs that scope too, unless you send a new `notice_period`. Required authorization scope: `public.price_adjustment:write` # List all Product Categories Source: https://docs.stora.co/2025-09/api-reference/product-categories/list-all-product-categories /2025-09/openapi.json get /2025-09/product_categories List product categories, such as Locks, Boxes or Services. They're a fixed list shared by all operators, so their IDs don't change. Use a category's ID as `category_id` in **List all Products**. Required authorization scope: `public.product_category:read` # Show a Product Category Source: https://docs.stora.co/2025-09/api-reference/product-categories/show-a-product-category /2025-09/openapi.json get /2025-09/product_categories/{product_category_id} Get one product category by its ID, such as a product's `category` ID. Use **List all Product Categories** to see them all. Required authorization scope: `public.product_category:read` # Create Base Price for the Product Source: https://docs.stora.co/2025-09/api-reference/products/create-base-price-for-the-product /2025-09/openapi.json post /2025-09/products/{product_id}/base_price Set the product's base price. A `one_time` product takes a `one_time` price. A `recurring` product takes a price for one or more billing periods, such as `monthly` or `weekly`. The new prices apply right away to new orders. Billing periods you leave out keep their prices, and existing subscriptions don't change. Required authorization scope: `public.product:write` # List all Products Source: https://docs.stora.co/2025-09/api-reference/products/list-all-products /2025-09/openapi.json get /2025-09/products List the products an operator sells alongside storage, such as padlocks, boxes or admin fees. Each belongs to one site, and `charge_type` says whether it's charged once (`one_time`) or every billing period (`recurring`). Filter by `site_id`, `charge_type` or `category_id`, and expand `site` or `category`. To sell one, add it as a `product` line item to an order at the same site. Use **List all Protection Levels** instead for cover on stored goods. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.product:read` # Allocations and access Source: https://docs.stora.co/2025-09/guides/allocations-and-access Understand how units are allocated to tenancies, how access is granted and restricted, and how Stora keeps third-party access control systems in sync. When a booking completes, Stora creates a [tenancy and subscription](/2025-09/guides/core-concepts#the-rental-lifecycle-orders-tenancies-and-subscriptions). But how does the customer actually get access to a physical unit? That's what **unit allocations** handle. A unit allocation links a specific unit to a tenancy. It tracks when the unit was reserved, when access was granted, and by whom. Every allocation-related action — reserving, granting access, overlocking, deallocating — changes the unit's status and, if the operator uses a smart entry provider, automatically syncs that change to their access control hardware. ## How the pieces connect A unit allocation sits between a tenancy and a unit. It's the record that says "this specific unit has been assigned to this tenancy." ```mermaid actions={false} theme={null} %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4', 'edgeLabelBackground': '#FF7237'}}}%% graph LR Site --> Tenancy Tenancy --> Contact Tenancy --> UA["Unit Allocation"] UA --> Unit Unit --> UT["Unit Type"] ``` * A **site** has **tenancies** — each one a storage agreement with a **contact**. * Each tenancy can have one or more **unit allocations** — one per physical unit assigned. * Each unit allocation points to a **unit**, which belongs to a **unit type** at the same site. The unit allocation also records: * **When** the unit was reserved (`reserved_at`) * **When** access was granted (`granted_access_at`) ## Unit status lifecycle Every unit has a status that reflects where it is in the allocation lifecycle. The status changes as the unit moves through reservation, occupancy, and eventual deallocation. | Status | Meaning | | - | - | | `available` | Ready to be allocated | | `reserved` | Allocated to a tenancy that hasn't started yet | | `occupied` | Tenant has access | | `overlock` | Access restricted — typically due to non-payment | Units can also be `unavailable` (taken offline for maintenance) or `repossessed` (contents marked for repossession). These are operator-managed states and aren't covered in detail here. ```mermaid actions={false} theme={null} %%{init: {'theme': 'base', 'flowchart': {'defaultRenderer': 'elk'}, 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4', 'edgeLabelBackground': '#FF7237'}}}%% graph TD available -->|"  reserve  "| reserved available -->|"  grant access  "| occupied reserved -->|"  grant access  "| occupied reserved -->|"  deallocate  "| available occupied -->|"  overlock  "| overlock occupied -->|"  deallocate  "| available overlock -->|"  remove overlock  "| occupied overlock -->|"  deallocate  "| available ``` The happy path is straightforward: `available` → `reserved` → `occupied` → `available`. Overlocking and removing overlocks handle the non-payment exception path. ## How units get allocated There are two ways a unit gets allocated to a tenancy: automatically by Stora when an order completes, or manually via the API. ### Auto-reservation If the operator has auto-reservation enabled, Stora attempts to reserve the requested units when a storefront or Public API order completes. It selects available units of the requested type and creates the allocations. After the attempt, Stora emits one event that reports the outcome for the tenancy: | Event | Outcome | | - | - | | `tenancy.auto_reservation.succeeded` | All requested units were reserved | | `tenancy.auto_reservation.partially_succeeded` | Some, but not all, requested units were reserved | | `tenancy.auto_reservation.failed` | No requested units were reserved | Each successful unit reservation also emits `unit.reserved`. Use the tenancy event to determine the outcome of the complete auto-reservation attempt. For a partial or failed attempt, assign the unreserved units manually. If auto-reservation is disabled, assign all units manually. ### Reserving a unit via the API To allocate a unit to a tenancy that hasn't started yet, use the reserve endpoint: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/units/unit_1e36123098e22cf8/reserve \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenancy_id": "ten_acaf3269a573af74" }' ``` ```json theme={null} { "unit": { "id": "unit_1e36123098e22cf8", "status": "reserved", "unit_allocation": { "id": "alloc_5f7475758314968d" } } } ``` The unit transitions from `available` to `reserved` and a unit allocation is created. **Constraints:** * The unit must be `available`. * The tenancy's start date must be in the future. If the tenancy has already started, use [grant access](#granting-access-via-the-api) instead. ## Granting access A reserved unit isn't accessible yet — the tenant can't physically enter the storage space. The unit needs to transition to `occupied` for access to be granted. ### Automatic on move-in day Stora automatically transitions reserved units to `occupied` on the tenancy's start date. This runs at approximately 6:00 AM in the operator's local timezone. Once the transition happens, the `unit.occupied` webhook fires and, if the operator uses a smart entry provider, the access control system is synced to grant the tenant physical access. ### Granting access via the API You don't have to wait for move-in day. The grant access endpoint lets you transition a unit to `occupied` immediately: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/units/unit_1e36123098e22cf8/grant_access \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tenancy_id": "ten_acaf3269a573af74" }' ``` ```json theme={null} { "unit": { "id": "unit_1e36123098e22cf8", "status": "occupied", "unit_allocation": { "id": "alloc_5f7475758314968d" } } } ``` Grant access handles two scenarios: | Starting status | What happens | | - | - | | `reserved` | The existing reservation transitions to `occupied`. The unit must be reserved for the same tenancy you provide in the request. | | `available` | The unit is allocated *and* access is granted in a single step — no separate reserve call needed. | This is useful when you want to give a tenant early access before their tenancy officially starts, or when you're managing allocations entirely through the API and don't need the intermediate `reserved` state. ## Restricting and restoring access ### Overlocking Overlocking restricts a tenant's access to their units — typically because of failed payments. The overlock endpoint operates on all occupied units for a given contact: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/units/overlock \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "contact_id": "con_0ac0514ed0711462" }' ``` ```json theme={null} { "success": { "message": "2 units were successfully overlocked." }, "meta": { "unit_ids": [ "unit_1e36123098e22cf8", "unit_2e36123098e22cf8" ] } } ``` All of the contact's occupied units transition to `overlock`. A `unit.overlocked` webhook fires for each unit. > [!NOTE] > > Operators can also configure Stora to auto-overlock units when a payment fails. If this is enabled, Stora handles the transition automatically — you don't need to call the overlock endpoint yourself. The `unit.overlocked` webhook still fires so your integration can react. ### Removing an overlock To restore access, use the remove overlock endpoint with the same contact ID: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/units/remove_overlock \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "contact_id": "con_0ac0514ed0711462" }' ``` ```json theme={null} { "success": { "message": "Overlock was successfully removed from 2 units." }, "meta": { "unit_ids": [ "unit_1e36123098e22cf8", "unit_2e36123098e22cf8" ] } } ``` All of the contact's units in `overlock` transition back to `occupied`. A `unit.occupied` webhook fires for each unit. ## Deallocating a unit Deallocation removes the unit allocation entirely and returns the unit to `available`: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/units/unit_1e36123098e22cf8/deallocate \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ```json theme={null} { "unit": { "id": "unit_1e36123098e22cf8", "status": "available", "unit_allocation": null } } ``` A unit can be deallocated from any allocated status: `reserved`, `occupied`, `overlock`, or `repossessed`. ### Auto-deallocation on move-out If the operator has auto-deallocation enabled, Stora automatically deallocates units when a tenancy ends. The `unit.deallocated` and `unit.available` webhooks fire, and the access control system is synced to revoke access. ## Access control sync If the operator has configured a smart entry provider in Stora (such as Noke, PTI, Paxton, or any of the other supported providers), **every status change described in this guide automatically syncs to the third-party access control system**. You don't need to do anything extra. When you call an allocation endpoint — reserve, grant access, overlock, remove overlock, or deallocate — Stora: 1. Updates the unit's status 2. Publishes the change to the configured access control provider 3. Notifies the provider to grant or restrict physical access accordingly For example, when a unit transitions to `occupied`, Stora tells the access control provider to allow the tenant entry. When it transitions to `overlock`, the provider restricts access. When it's deallocated, the provider revokes access entirely. > [!TIP] > > This means the API is your single point of control for both the logical state of a unit and the physical access to it. You don't need to integrate with individual access control providers — Stora handles that layer. ## Webhook events Subscribe to these events to react to allocation changes in real time: | Event | When it fires | | - | - | | `unit.reserved` | A unit has been reserved for a tenancy | | `unit.occupied` | A unit is now occupied — the tenant has access | | `unit.overlocked` | Access has been restricted | | `unit.deallocated` | The unit allocation has been removed | | `unit.available` | The unit is available again | Webhook payloads include the full unit resource, so you can update your local state directly without an additional API call. See [Webhooks](/2025-09/guides/webhooks) for setup and payload structure. # API versioning Source: https://docs.stora.co/2025-09/guides/api-versioning Understand Stora API versions, compatibility guarantees, deprecation timelines, and how to migrate. Stora uses dated API versions to let you plan upgrades without unexpected changes to your integration. A version defines the contract for versioned REST API resource requests, responses, and webhook payloads. > [!NOTE] > > The current API version is `2025-09`. Review its [OpenAPI specification](/2025-09/openapi.json) or the [changelog](/2025-09/guides/changelog). ## How API versions work Versioned resource endpoints use the `YYYY-MM` format in the request path: ```text theme={null} https://public-api.stora.co/2025-09/sites ``` For resource endpoints, the path determines the version used for API requests and responses. OAuth 2 token endpoints under `/oauth2/` are not date-versioned. Webhook endpoints also store an API version, which determines the structure of their payloads. See [Webhooks](/2025-09/guides/webhooks) for setup details. ## Compatibility within a version Stora's compatibility policy requires a new dated version for breaking changes. We may make backward-compatible changes within a version, including: * Adding an endpoint * Adding an optional request field * Adding a response field * Deprecating a field while keeping it available * Fixing behavior so it matches the documented contract Your integration should ignore response fields it does not recognize so that compatible additions do not disrupt it. Changes that require a new version include: * Removing or renaming an endpoint or field * Changing a field's type * Making an optional request field required * Changing documented behavior in a way that requires client changes > [!NOTE] > > As an exception, the site-scoped protection change was applied within `2025-09` without a new API version. This rollout is complete. See the [protection guide](/2025-09/guides/site-scoped-protection-levels) for current behavior and historical-reference support. ## Version lifecycle Each API version passes through four lifecycle milestones: | Milestone | Access and support | | - | - | | **Current** | The newest version. It receives backward-compatible features, defect fixes, and security updates. | | **Deprecated** | Begins when a successor is released. Standard and Enterprise customers retain access and receive security fixes and fixes for material defects. New features target the current version. | | **Standard retirement** | Standard customers retain access through the last calendar day of the sixth month after deprecation. Access ends at 00:00 UTC the following day. | | **Enterprise retirement** | Enterprise customers retain access through the last calendar day of the twelfth month after deprecation. Access ends at 00:00 UTC the following day. | Enterprise customers continue to receive maintenance support during months seven through twelve. If Stora releases multiple versions within twelve months, their support windows may overlap. For example, if a version is deprecated on May 15, 2026, the last supported day is November 30, 2026 for Standard customers and May 31, 2027 for Enterprise customers. ## Supported versions | Version | Beta release | Public release | Status | Standard last supported day | Enterprise last supported day | Migration guide | | - | - | - | - | - | - | - | | `2025-09` | September 30, 2025 | December 16, 2025 | Current | — | — | — | The current version has no scheduled retirement date. When we release a successor, we add separate Standard and Enterprise last supported days and link its dedicated migration guide. ## Deprecation notifications When Stora releases a new API version, we publish the previous version's deprecation date, Standard last supported day, Enterprise last supported day, and migration guide: * On this page * In the [changelog](/2025-09/guides/changelog) * By email to developers registered in the Developer Portal > [!WARNING] > > Stora may use a shorter timeline only when necessary to address a serious security, privacy, legal, or regulatory risk. We will communicate the reason and revised timeline as early as possible through the same notification channels. ## Migrate to a new version We publish a dedicated migration guide with every new API version. The guide explains each breaking change and the work required to move from the previous version. We link it from the supported-versions table, [changelog](/2025-09/guides/changelog), and deprecation email. **1. Follow the migration guide** Work through the release-specific migration guide for your current and target versions. **2. Review the supporting references** Check the [changelog](/2025-09/guides/changelog) and new OpenAPI specification for complete request, response, and webhook schemas. **3. Update API requests** Replace the version in your API request paths and update your integration for the new contract. **4. Update webhook endpoints** Change each webhook endpoint to the new API version so its payloads use the new structure. See [Webhooks](/2025-09/guides/webhooks) for endpoint configuration. **5. Test and deploy** Test affected API calls and webhook handlers, then deploy before your applicable Standard or Enterprise last supported day. # Authentication overview Source: https://docs.stora.co/2025-09/guides/authentication Choose an authentication path for API exploration, managed-account integrations, or partner apps. ## Prerequisites You'll need a [Developer Portal](/2025-09/guides/developer-portal) account. Use the Developer Portal to create a test operator, manage API access for a connected operator account, or create a partner app. You do not need to connect a real operator account just to explore the API. > [!TIP] > > Create a test operator first if you're exploring the API. Test operators let you try credentials, requests, and webhook setup before working with real operator data. ## Choose your connection method Choose **Operator integration** for your own operator account or when you manage API access on an operator's behalf. Choose **Partner app** for a product that operators authorise independently. All paths use the same `Authorization: Bearer ` header for API requests. They differ in how you obtain and renew the token. > [tab] Operator integration > > Start with [Connect an account](/2025-09/guides/connect-account), then create credentials for that operator through the Developer Portal. > > * For short-lived tasks, use an [Access Token](#option-a-access-token). > * For ongoing backend access, use [Client Credentials](#option-b-oauth-2-0-%E2%80%94-client-credentials). > [tab] Partner app > > [Create a partner app](/2025-09/guides/partner-integrations), then use the [Authorization Code flow](#option-c-oauth-2-0-%E2%80%94-authorization-code). Each operator authorises your app independently. Use refresh tokens to maintain that connection. ## Option A: Access token Use an expiring Access Token for one-time scripts, API exploration, or short-lived AI-agent tasks. Choose a short expiry and only the scopes your task needs. Follow [Use an Access Token](/2025-09/guides/managed-account-authentication#use-an-access-token) to create an expiring token for your test operator or connected account. Use it directly in the bearer header of your [first API request](/2025-09/guides/first-request). ## Option B: OAuth 2.0 — Client Credentials Use this when your backend needs ongoing access to an account you manage, without user interaction. Follow [Use an OAuth Client](/2025-09/guides/managed-account-authentication#use-an-oauth-client) for client creation, token exchange, authenticated requests, and renewal. OAuth access tokens expire after 2 hours. Client Credentials does not issue a refresh token. Your backend obtains a replacement access token by repeating the `client_credentials` exchange. ## Option C: OAuth 2.0 — Authorization Code An operator's staff member authorises your partner app to access their data through the flow below. ### Step 1: Redirect the user to authorise Generate an unpredictable, single-use `state` value with a cryptographically secure random generator. Store the value in the initiating browser session on your server, with a short expiry. The `state` value binds the callback to the session that started the connection and protects against cross-site request forgery (CSRF). Direct the user's browser to the following URL. Replace `STATE` with the value you stored: ```text theme={null} https://app.stora.co/oauth2/authorize? client_id=YOUR_CLIENT_ID& redirect_uri=https://yourapp.com/callback& response_type=code& scope=public.contact:read public.order:read& state=STATE ``` The user logs in to Stora and approves the requested scopes. Stora redirects back to your `redirect_uri` with an authorisation code and the same `state` value: ```text theme={null} https://yourapp.com/callback?code=AUTHORIZATION_CODE&state=STATE ``` ### Step 2: Validate the callback Before exchanging the code, validate the callback on your server: 1. Read the stored state from the browser session that initiated the connection. 2. Check that the callback includes `state` and that it exactly matches the stored value. 3. Check that the stored state has not expired or already been used. 4. Consume the stored state so another callback cannot reuse it. Make validation and consumption atomic so concurrent callbacks cannot both succeed. If the state is missing, mismatched, expired, or already used, reject the callback. Do not exchange the code. Require the user to start a new connection attempt. ### Step 3: Exchange the code for tokens ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/json" \ -d '{ "grant_type": "authorization_code", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "code": "AUTHORIZATION_CODE", "redirect_uri": "https://yourapp.com/callback" }' ``` Response: ```json theme={null} { "access_token": "ACCESS_TOKEN", "token_type": "Bearer", "expires_in": 7200, "scope": "public.contact:read public.order:read", "created_at": 1710000000, "refresh_token": "REFRESH_TOKEN" } ``` ### Refreshing tokens Access tokens expire after 2 hours. A request with an expired token returns `401 Unauthorized` with the code [`invalid_token`](/2025-09/guides/errors#invalid_token). Use the refresh token to get a new one without requiring the user to re-authorise: ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/json" \ -d '{ "grant_type": "refresh_token", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "refresh_token": "REFRESH_TOKEN" }' ``` The response includes a new `access_token` and a new `refresh_token`. The previous refresh token is revoked. ### PKCE (optional) [PKCE](https://oauth.net/2/pkce/) (Proof Key for Code Exchange) protects the Authorization Code flow against code interception. Use it when your OAuth client is a single-user application running on a user-owned device — a mobile app, a desktop app, or a CLI tool. > [!WARNING] > > If you're distributing your integration as code that runs outside infrastructure you control (WordPress plugin, browser extension, client-side app extension, packaged on-premise tool, etc.), PKCE alone is not sufficient. Follow [Distributing a public plugin](/2025-09/guides/distributing-public-plugins) instead — the broker pattern it describes is the safe way to keep OAuth credentials and tokens out of distributed code. Generate a `code_verifier` and `code_challenge` before redirecting: ```bash theme={null} CODE_VERIFIER=$(openssl rand -base64 64 | tr -d '=/+\n' | head -c 128) CODE_CHALLENGE=$(echo -n "$CODE_VERIFIER" | openssl dgst -sha256 -binary | base64 | tr -d '=' | tr '/+' '_-') ``` Add the challenge to the authorisation URL. Include the session-bound `state` from [Step 1](#step-1-redirect-the-user-to-authorise) and [validate the callback](#step-2-validate-the-callback) before exchanging the code: ```text theme={null} https://app.stora.co/oauth2/authorize? client_id=YOUR_CLIENT_ID& redirect_uri=https://yourapp.com/callback& response_type=code& scope=public.contact:read public.order:read& state=STATE& code_challenge=CODE_CHALLENGE& code_challenge_method=S256 ``` Include the `code_verifier` when exchanging the code: ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/json" \ -d '{ "grant_type": "authorization_code", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "code": "AUTHORIZATION_CODE", "redirect_uri": "https://yourapp.com/callback", "code_verifier": "CODE_VERIFIER" }' ``` # Authorization Source: https://docs.stora.co/2025-09/guides/authorization Authorization scopes for the Stora Public API. Each endpoint, except those related to OAuth 2, requires at least one scope for authorization. Below is the full scope catalogue. Request only the scopes needed by your integration. A request with a token that lacks a required scope returns `403 Forbidden` with the code [`forbidden`](/2025-09/guides/errors#forbidden). > [!WARNING] > > Partner apps must not request Timeline template-related scopes, including `public.timeline_template:read`. Use the global source ID and hardcoded template IDs agreed with Stora. Operator integrations can use source and template read scopes to resolve IDs during setup; neither is required to create events once the IDs are known. Follow [Timeline setup](/2025-09/guides/timeline-events#choose-your-integration%E2%80%99s-setup) for your integration type. | Scope | Name | Description | | - | - | - | | `public.access_token:read` | Access Token (Read) | Allow to read all access tokens | | `public.application:read` | Application (Read) | Allow to read all applications | | `public.contact:read` | Contact (Read) | Allow to read all contacts | | `public.contact:write` | Contact (Write) | Allow to manage contacts | | `public.contract:read` | Contract (Read) | Allow to read all contracts | | `public.contract_template:read` | Contract Template (Read) | Allow to read all contract templates | | `public.coupon:read` | Coupon (Read) | Allow to read all coupons | | `public.credit_note:read` | Credit Note (Read) | Allow to read all credit notes | | `public.deal:read` | Deal (Read) | Allow to read all deals | | `public.deal:write` | Deal (Write) | Allow to manage deals | | `public.deal_stage:read` | Deal Stage (Read) | Allow to read all deal stages | | `public.identity_verification:read` | Identity Verification (Read) | Allow to read all identity verifications | | `public.invoice:read` | Invoice (Read) | Allow to read all invoices | | `public.note:read` | Note (Read) | Allow to read all notes | | `public.note:write` | Note (Write) | Allow to manage notes | | `public.opportunity:read` | Opportunity (Read) | Allow to read all opportunities | | `public.opportunity:write` | Opportunity (Write) | Allow to manage opportunities | | `public.order:read` | Order (Read) | Allow to read all orders | | `public.order:write` | Order (Write) | Allow to manage orders | | `public.price_adjustment:read` | Price Adjustment (Read) | Allow to read all price adjustments | | `public.price_adjustment:skip_notifications` | Price Adjustment (Skip notifications) | Price Adjustment (Skip notifications) | | `public.price_adjustment:write` | Price Adjustment (Write) | Allow to manage price adjustments | | `public.product:read` | Product (Read) | Allow to read all products | | `public.product:write` | Product (Write) | Allow to manage products | | `public.product_category:read` | Product Category (Read) | Allow to read all product categories | | `public.protection_level:read` | Protection Level (Read) | Allow to read all protection levels | | `public.protection_level:write` | Protection Level (Write) | Allow to manage protection levels | | `public.site:read` | Site (Read) | Allow to read all sites | | `public.staff:read` | Staff (Read) | Allow to read all staff | | `public.subscription:read` | Subscription (Read) | Allow to read all subscriptions | | `public.task:read` | Task (Read) | Allow to read all tasks | | `public.task:write` | Task (Write) | Allow to manage tasks | | `public.tenancy:read` | Tenancy (Read) | Allow to read all tenancies | | `public.timeline_event:read` | Timeline Event (Read) | Allow to read all timeline events | | `public.timeline_event:write` | Timeline Event (Write) | Allow to manage timeline events | | `public.timeline_source:read` | Timeline Source (Read) | Allow to read all timeline sources | | `public.timeline_template:read` | Timeline Template (Read) | Allow to read all timeline templates | | `public.unit:read` | Unit (Read) | Allow to read all units | | `public.unit:write` | Unit (Write) | Allow to manage units | | `public.unit_allocation:read` | Unit Allocation (Read) | Allow to read all unit allocations | | `public.unit_type:read` | Unit Type (Read) | Allow to read all unit types | | `public.unit_type:write` | Unit Type (Write) | Allow to manage unit types | | `public.webhook_endpoint:read` | Webhook Endpoint (Read) | Allow to read all webhook endpoints | | `public.webhook_endpoint:write` | Webhook Endpoint (Write) | Allow to manage webhook endpoints | # Building a booking flow Source: https://docs.stora.co/2025-09/guides/booking-flow Create a custom booking experience using the Stora API — from browsing availability to completing an order. The Stora API lets you build a custom browsing and checkout experience for a self-storage operator. Your application handles everything from displaying available units to assembling an order. When the customer is ready to complete the booking, you redirect them to a hosted checkout page that collects their payment method. After checkout, Stora handles customer onboarding and creates the tenancy, subscription, and invoices automatically. Checkout completion does not confirm successful payment collection. Your application is notified via [webhooks](/2025-09/guides/webhooks). ## Before you start This guide assumes you have: * An access token or OAuth 2.0 credentials — see [Authentication](/2025-09/guides/authentication) * Familiarity with Stora's domain model — see [Core concepts](/2025-09/guides/core-concepts) * A webhook endpoint configured to receive events — see [Webhooks](/2025-09/guides/webhooks) Your token needs the following [scopes](/2025-09/guides/authorization): | Scope | Used for | | - | - | | `public.site:read` | Browsing sites | | `public.unit_type:read` | Browsing unit types and pricing | | `public.unit:read` | Checking unit availability | | `public.unit:write` | Reserving units or granting access during manual allocation recovery (if applicable) | | `public.contact:write` | Creating customers | | `public.contact:read` | Finding and reusing existing customers (if applicable) | | `public.order:write` | Creating and finalizing orders | | `public.order:read` | Reading order status | | `public.coupon:read` | Looking up coupons (if applicable) | | `public.protection_level:read` | Listing protection options (if applicable) | | `public.product:read` | Listing add-on products (if applicable) | ## How it works Your application controls the experience until you redirect the customer to hosted checkout. Stora then collects their payment method and completes the booking. Choose the order creation flow that matches your checkout. > [tab] Multi-step order > > ```mermaid actions={false} theme={null} > %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4'}}}%% > sequenceDiagram > participant App as Your application > participant API as Stora API > participant Pay as Hosted checkout > participant Portal as Customer portal > > App->>API: Browse sites and unit types > API-->>App: Available storage and pricing > > App->>API: Create contact > API-->>App: Contact > > App->>API: Create order (draft) > API-->>App: Draft order > > App->>API: Validate order > API-->>App: Validation result > > App->>API: Finalize order > API-->>App: Finalized order with payment URL > > App->>Pay: Redirect customer > Pay->>Portal: After checkout, customer sets up account > > API-->>App: Webhooks (order.completed, tenancy.created) > > ``` > [tab] Single-request order > > ```mermaid actions={false} theme={null} > %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4'}}}%% > sequenceDiagram > participant App as Your application > participant API as Stora API > participant Pay as Hosted checkout > participant Portal as Customer portal > > App->>API: Browse sites and unit types > API-->>App: Available storage and pricing > > App->>API: Create order with contact and finalize > API-->>App: Finalized order with payment URL > > App->>Pay: Redirect customer > Pay->>Portal: After checkout, customer sets up account > > API-->>App: Webhooks (order.completed, tenancy.created) > ``` After completing hosted checkout, the customer is directed to set up their account and access the operator's customer portal. Stora manages this white-label experience on the operator's behalf. From the portal, customers can manage payment methods, view allocated units and subscriptions, sign contracts (if required), and complete identity verification (if enabled). This requires no integration work on your part. There are two ways to create an order: build it up incrementally as a draft (useful for multi-step checkouts), or [create and finalize in a single request](#create-and-finalize-in-one-step) (simpler for single-page checkouts). This guide covers the multi-step approach first. ## Step 1: Display available storage Start by fetching the operator's sites, then the unit types and pricing at each site. If you're serving this data to many customers, consider [caching these resources locally](/2025-09/guides/data-synchronisation) rather than fetching them on every page load. ### Fetch sites ```bash theme={null} curl -X GET https://public-api.stora.co/2025-09/sites \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ```json theme={null} { "sites": [ { "id": "site_14b419f1096013f1", "name": "Manchester City Centre", "description": "24/7 access, CCTV monitored.", "phone": "0161 123 4567", "address": { "line_1": "42 Deansgate", "city": "Manchester", "postal_code": "M3 2EG" }, "access_hours": { "monday": { "status": "set_hours", "open": "06:00", "close": "22:00" }, "tuesday": { "status": "set_hours", "open": "06:00", "close": "22:00" } } } ] } ``` If the operator has multiple sites, use `address`, `access_hours`, and `description` to build a site selection UI. ### Fetch unit types at a site Unit types represent the categories of storage available — for example "50 sq ft indoor" or "20 ft container." ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/unit_types?site_id=site_14b419f1096013f1" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` ```json theme={null} { "unit_types": [ { "id": "utype_3b3aed5cca33b11d", "name": "Medium unit", "status": "bookable", "size_description": "10x12 ft", "dimensions": { "width": 10.0, "length": 12.0, "height": 11.0, "measurement_unit": "ft" }, "selling_points": ["Drive-up access", "Ground floor"], "live_prices": [ { "billing_period": "monthly", "price": { "amount": 9000, "currency": "GBP", "formatted": "£90.00" } } ], "prices": [ { "billing_period": "monthly", "price": { "amount": 9500, "currency": "GBP", "formatted": "£95.00" } } ], "require_insurance_coverage": true, "require_security_deposit": true, "security_deposit": { "amount": 5000, "currency": "GBP", "formatted": "£50.00" }, "site": { "id": "site_14b419f1096013f1" } } ] } ``` Key fields: * **`live_prices`** — the current Unit Type prices to show customers and use for `unit_type` order line items. Each entry is scoped to a `billing_period`. Use the matching entry for the customer's selected billing period. * **`prices`** — the base configured prices for the Unit Type. These are useful for reference, but your booking flow should use `live_prices` when displaying or submitting Unit Type pricing. * **`status`** — should be `bookable` for unit types you display. * **`require_insurance_coverage`** / **`require_security_deposit`** — indicate what the operator expects. The API doesn't enforce these, but your checkout should prompt for them when `true`. See [operator expectations](#operator-expectations). * **`selling_points`** — operator-defined features you can display in your UI. > [!WARNING] > > Do not calculate or guess Unit Type prices yourself. Use the matching `live_prices` entry for the selected billing period. If no matching `live_prices` entry exists, refresh the Unit Type and ask the customer to choose an available billing period before creating the order. ### Check availability Check whether a unit type has available stock by querying its units filtered by status: ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/units?unit_type_id=utype_3b3aed5cca33b11d&status=available&limit=1" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` If the response contains units, that unit type is available. You don't need to select a specific unit — Stora handles unit allocation when the order completes. Customers book Unit Types, not individual units. Use Unit Types for customer-facing browsing, pricing, and order creation. Every order must include at least one `unit_type` line item. Specific units are allocated or reserved later through Stora's completion and allocation flow. ### Fetch protection levels and products If your checkout lets customers add protection or products, fetch the available options: ```bash theme={null} # Protection levels for the selected site curl -X GET "https://public-api.stora.co/2025-09/protection_levels?site_id=site_14b419f1096013f1" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" # Products (add-on items and services, filtered by site) curl -X GET "https://public-api.stora.co/2025-09/products?site_id=site_14b419f1096013f1" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Replace the example `site_id` with the site selected for the booking. Offer only protection levels belonging to that site. Use the selected level's price for the order's billing period. Protection levels return a `cover_level` (the coverage amount) and `prices` per billing period. Products return a `charge_type` (`one_time` or `recurring`) and `prices`. Both are referenced by ID when adding line items to an order. See [Migrating to site-scoped protection levels](/2025-09/guides/site-scoped-protection-levels) for historical global references. ## Step 2: Capture customer details Every order needs a contact — the person renting the storage. | Approach | Best for | | - | - | | **Create upfront** — `POST /contacts` before creating the order | Multi-step checkouts where you want to capture the lead early | | **Create inline** — embed contact fields in the order request | Single-page checkouts where everything is submitted at once | ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/contacts \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "email": "jane.smith@example.com", "full_name": "Jane Smith", "phone_number": "+447700900123", "type": "domestic", "source": "booking", "use_case": "moving_home", "address": { "line_1": "15 Park Road", "city": "Manchester", "postal_code": "M14 5RQ", "country_alpha2": "GB" } }' ``` Only `email` is required. All other fields are optional but recommended — the operator will see this information in their back office. > [!WARNING] > > Email addresses must be unique per operator. If a contact with the same email already exists, the request will fail with a validation error. Use `GET /contacts?email=` to check for an existing contact first, and reference it by `id` on the order if found. ## Step 3: Create the order Create an order in `draft` status with at least one `unit_type` line item: > [tab] With existing contact > > ```bash theme={null} > curl -X POST https://public-api.stora.co/2025-09/orders \ > -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ > -H "Content-Type: application/json" \ > -H "Idempotency-Key: booking-jane-smith-2026-03-30" \ > -d '{ > "site": { "id": "site_14b419f1096013f1" }, > "contact": { "id": "con_0ac0514ed0711462" }, > "billing_period": "monthly", > "payment_method": "card", > "starts_at": "2026-04-15T00:00:00Z", > "email_notifications": { > "payment_details": true > }, > "line_items": [ > { > "type": "unit_type", > "quantity": 1, > "price": { "amount": 9000 }, > "item": { "id": "utype_3b3aed5cca33b11d" } > } > ] > }' > ``` > [tab] With inline contact > > ```bash theme={null} > curl -X POST https://public-api.stora.co/2025-09/orders \ > -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ > -H "Content-Type: application/json" \ > -H "Idempotency-Key: booking-jane-smith-2026-03-30" \ > -d '{ > "site": { "id": "site_14b419f1096013f1" }, > "contact": { > "email": "jane.smith@example.com", > "full_name": "Jane Smith", > "phone_number": "+447700900123" > }, > "billing_period": "monthly", > "payment_method": "card", > "starts_at": "2026-04-15T00:00:00Z", > "email_notifications": { > "payment_details": true > }, > "line_items": [ > { > "type": "unit_type", > "quantity": 1, > "price": { "amount": 9000 }, > "item": { "id": "utype_3b3aed5cca33b11d" } > } > ] > }' > ``` The response includes the order with `status: "draft"` and calculated totals you can use to build an [order summary](#order-summary-fields) for the customer. Key request fields: * **`site.id`** (required) — the site the customer is booking at. * **`contact`** — either an `id` referencing an existing contact, or inline contact fields. * **`billing_period`** — `weekly`, `monthly`, `every_four_weeks`, `every_three_months`, `every_six_months`, or `yearly`. * **`payment_method`** — `card`, `bacs_debit`, or `sepa_debit`. * **`starts_at`** — when the tenancy begins. ISO 8601 date-time or `"now"` for immediate move-in. * **`coupon.id`** — optional coupon to apply to the order. Omit it from the basic flow unless you have selected a coupon for the current operator. For automation or AI-created orders, use the selected `unit_type.promotion` when present. * **`email_notifications.payment_details`** — set to `true` to email the customer a payment link when the order is finalized. * **`line_items`** — at least one `unit_type` [line item](#line-items) is required. > [!TIP] > > Use `?expand=line_items` to include full line item objects in the response instead of just IDs. You can also expand `contact` and `site`. ### Add more line items While the order is in `draft` status, you can add protection, products, and security deposits: ```bash theme={null} # Add protection curl -X POST https://public-api.stora.co/2025-09/orders/order_9ef07151f2470754/line_items \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "protection", "quantity": 1, "price": { "amount": 999 }, "item": { "id": "plvl_e8f3ad0a07e47566" } }' ``` ```bash theme={null} # Add a security deposit curl -X POST https://public-api.stora.co/2025-09/orders/order_9ef07151f2470754/line_items \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "security_deposit", "quantity": 1, "price": { "amount": 5000 }, "item": { "id": "utype_3b3aed5cca33b11d" } }' ``` You can also apply a [coupon](#coupons), configure [email notifications](#email-notifications), and attach [metadata](#metadata). ## Step 4: Finalize the order Finalizing locks the order and generates a hosted checkout page. Optionally validate first to catch any issues: ```bash theme={null} curl -X GET https://public-api.stora.co/2025-09/orders/order_9ef07151f2470754/validate \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ``` Then finalize: ```bash theme={null} curl -X POST https://public-api.stora.co/2025-09/orders/order_9ef07151f2470754/finalize \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "finalize": { "cancel_redirect_url": "https://your-app.com/booking/cancelled" } }' ``` The `finalize.cancel_redirect_url` request field is required and controls where the customer lands if they abandon checkout. Use `"cancel_redirect_url": "default"` if you do not have your own URL to redirect to. The finalized order response includes a `payment_url`. See [Handling payment](#handling-payment) for when to redirect the customer or send the link by email. > [!WARNING] > > Once finalized, the order is locked. If the customer needs to make changes, create a new order. ### Handling payment Finalizing an order generates a hosted `payment_url`. In an interactive booking flow, redirect the customer to this URL so they can enter their payment details. If the order is created by automation, AI, or another flow where you cannot redirect the customer immediately, set `email_notifications.payment_details` to `true`. Stora emails the customer a payment link when the order is finalized. Use one payment path per order: redirect the customer to `payment_url`, send the payment details email, or do both only when that is intentional for your customer experience. ### Create and finalize in one step For single-page checkouts, include the `finalize` field in the create request. You can reference an existing contact or create the contact inline in the same request. > [tab] With existing contact > > ```bash theme={null} > curl -X POST https://public-api.stora.co/2025-09/orders \ > -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ > -H "Content-Type: application/json" \ > -H "Idempotency-Key: booking-jane-smith-2026-03-30" \ > -d '{ > "site": { "id": "site_14b419f1096013f1" }, > "contact": { "id": "con_0ac0514ed0711462" }, > "billing_period": "monthly", > "payment_method": "card", > "starts_at": "2026-04-15T00:00:00Z", > "email_notifications": { > "payment_details": true > }, > "line_items": [ > { > "type": "unit_type", > "quantity": 1, > "price": { "amount": 9000 }, > "item": { "id": "utype_3b3aed5cca33b11d" } > }, > { > "type": "protection", > "quantity": 1, > "price": { "amount": 999 }, > "item": { "id": "plvl_e8f3ad0a07e47566" } > } > ], > "finalize": { > "cancel_redirect_url": "https://your-app.com/booking/cancelled" > } > }' > ``` > [tab] With inline contact > > ```bash theme={null} > curl -X POST https://public-api.stora.co/2025-09/orders \ > -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ > -H "Content-Type: application/json" \ > -H "Idempotency-Key: booking-jane-smith-2026-03-30" \ > -d '{ > "site": { "id": "site_14b419f1096013f1" }, > "contact": { > "email": "jane.smith@example.com", > "full_name": "Jane Smith", > "phone_number": "+447700900123", > "type": "domestic", > "source": "booking", > "use_case": "moving_home", > "address": { > "line_1": "15 Park Road", > "city": "Manchester", > "postal_code": "M14 5RQ", > "country_alpha2": "GB" > } > }, > "billing_period": "monthly", > "payment_method": "card", > "starts_at": "2026-04-15T00:00:00Z", > "email_notifications": { > "payment_details": true > }, > "line_items": [ > { > "type": "unit_type", > "quantity": 1, > "price": { "amount": 9000 }, > "item": { "id": "utype_3b3aed5cca33b11d" } > }, > { > "type": "protection", > "quantity": 1, > "price": { "amount": 999 }, > "item": { "id": "plvl_e8f3ad0a07e47566" } > } > ], > "finalize": { > "cancel_redirect_url": "https://your-app.com/booking/cancelled" > } > }' > ``` Using an inline contact here creates the contact as part of order creation. The response is a finalized order with a `payment_url`. If finalization fails, the order is not stored. ## Step 5: Handle completion After the customer completes hosted checkout, Stora completes the booking and emits `order.completed`. Stora creates the tenancy and subscription and attempts auto-reservation when the operator has enabled it. Use webhooks to track these outcomes separately. `order.completed` does not confirm that an invoice has been paid. ### What Stora creates **1. Tenancy** The storage agreement — linking the contact, site, and unit type with start and end dates. **2. Subscription** The billing agreement — recurring charges, billing period, and payment method. See [invoicing](#invoicing) for when each charge type is billed. **3. Unit allocation** For storefront and Public API orders, Stora attempts to reserve the requested units automatically when the operator has enabled auto-reservation. Use the dedicated `tenancy.auto_reservation.*` events to determine the outcome. For partial or failed attempts, reserve available units if the tenancy starts in the future. If the tenancy has already started, use grant access instead. Both actions require `public.unit:write`. Follow [Reserving a unit via the API](/2025-09/guides/allocations-and-access#reserving-a-unit-via-the-api) or [Granting access via the API](/2025-09/guides/allocations-and-access#granting-access-via-the-api). **4. Contract (if configured)** If the operator uses Stora's integrated contracts, Stora generates a contract for the contact to sign. Stora uses the order's `contract_template`. If the order has none, Stora uses the contract template set on the unit type. If neither has a template, Stora doesn't generate a contract. For an order that starts immediately (`"starts_at": "now"`), Stora generates the contract when it raises the first invoice. If the operator doesn't use integrated contracts, Stora sets the order's `contract_template` to `null` when you create or update the order. ### Webhook events | Event | When it fires | | - | - | | `order.created` | The order is created | | `order.finalized` | The order is finalized and the payment link is generated | | `order.completed` | The booking is complete, not confirmation of payment collection | | `tenancy.created` | A tenancy is created for the completed order | | `tenancy.auto_reservation.succeeded` | All requested units were reserved automatically | | `tenancy.auto_reservation.partially_succeeded` | Some, but not all, requested units were reserved automatically | | `tenancy.auto_reservation.failed` | No requested units were reserved automatically | | `subscription.created` | A subscription is created for the completed order | | `invoice.paid` | An invoice reaches paid status, including when it is manually marked paid | | `unit.reserved` | An individual unit has been reserved | `order.completed` is the primary signal that the booking is complete. Webhook delivery order is not guaranteed, so do not infer processing order from event arrival. Track invoice payment separately through `invoice.paid`. Use the `tenancy.auto_reservation.*` events to determine the complete reservation outcome. Each successfully reserved unit also emits `unit.reserved`. For partial or failed attempts, use the date-dependent manual recovery described under [Unit allocation](#what-stora-creates). > [!TIP] > > Use webhooks to detect booking completion, not redirects. After hosted checkout, the customer is redirected to Stora's account setup flow, not back to your application. See [Webhooks](/2025-09/guides/webhooks) for setup, payload structure, and signature verification. ## Understanding orders in detail ### Line items There are four line item types: | Type | Description | | - | - | | `unit_type` | The storage unit rental. References a unit type ID. At least one required per order. | | `protection` | Goods protection or insurance coverage. References a protection level ID belonging to the order's site. | | `product` | An add-on product or service (e.g. padlock, admin fee). References a product ID. | | `security_deposit` | A one-off refundable deposit. References the unit type ID. | Every line item needs a `type`, `quantity`, `price.amount`, and `item.id`. For `unit_type` line items, set `price.amount` from the matching `unit_type.live_prices` entry for the selected billing period. For `protection` and `product` line items, use the relevant resource's `prices` array. The API requires at least one `unit_type` line item but does not enforce protection or security deposit inclusion — your application controls the checkout experience. ### Operator expectations The unit type's `require_insurance_coverage` and `require_security_deposit` flags indicate what the operator expects. When `true`, your checkout should prompt the customer accordingly. The API won't reject an order missing these. ### Tax Tax is calculated automatically based on the operator's configuration at the site level — you don't set it yourself. Each line item type can have its own tax rate. Security deposits are never taxed. Each line item returns `tax` and `total_excluding_tax` fields, and the order has aggregate tax fields across all line items. ### Promotions Unit types can include a `promotion` when a promotional coupon is associated with them. Expand or inspect the selected Unit Type before creating the order so you can apply that promotion consistently. When an order is created by automation or AI, use `unit_type.promotion` as the order `coupon` when it is present: ```json theme={null} { "coupon": { "id": "cpn_9f4a1d7b2c8e3456" } } ``` This keeps automated bookings aligned with the promotion **the customer would see in a normal booking flow**. If you also let customers enter coupon codes manually, decide whether the entered code or `unit_type.promotion` takes precedence before creating the order. ### Coupons You can apply one coupon per order by including the `coupon` field: ```json theme={null} { "coupon": { "id": "cpn_a26d0d4c582740c1" } } ``` To let customers enter a coupon code, fetch available coupons with `GET /coupons` and match by the `code` field. Public coupons, also called promotions, have `code: null`, so you can't match them by code. The list excludes expired and deleted coupons. Coupons fall into two categories based on their `auto_apply_to` configuration: * **Subscription-level** (`auto_apply_to.subscriptions: true`) — apply to the subscription as a whole. * **Line-item level** — apply individually to matching line items. The `auto_apply_to` object controls which types: `unit_types`, `protections`, and/or `products`. Stora applies the coupon to the relevant line items automatically based on this configuration. The order's `total_discount` field reflects the result. > [!NOTE] > > * Only one coupon per order. > * Fixed-amount coupons can only apply at the subscription level. > * One-off products and security deposits are never discounted. ### Invoicing The hosted checkout page collects the customer's payment method. It does not collect an immediate payment. Track each invoice's paid status through `invoice.paid`, not `order.completed`. An invoice can also be manually marked paid, so `invoice.paid` is not exclusively a successful card-charge notification. After checkout, charges are split across separate invoices: | Line item type | When invoiced | Invoice type | | - | - | - | | `unit_type` | First billing cycle | Subscription (recurring) | | `protection` | First billing cycle | Subscription (recurring) | | `product` (recurring) | First billing cycle | Subscription (recurring) | | `product` (one-time) | Shortly after checkout | Separate invoice, charged immediately | | `security_deposit` | Shortly after checkout | Separate invoice, charged immediately | ### Order summary fields Every order response includes calculated totals that update as line items change: | Field | What it represents | | - | - | | `subtotal` | Recurring charges before tax | | `tax` | Total tax across all line items | | `total` | Recurring charges including tax and discounts | | `total_discount` | Total coupon discount applied | | `one_time_total` | One-off charges (security deposits, one-time products) including tax | Each line item also returns `price`, `tax`, `total`, `total_excluding_tax`, and `discount_total` for per-item breakdowns. Use the `formatted` field on any money object for display-ready strings. ### Email notifications Stora sends the customer a booking confirmation and move-in day reminder by default. The content is customised by the operator in the BackOffice. Use `email_notifications` to control these emails per order. Set `payment_details` to `true` when Stora should email the customer a payment link after the order is finalized: ```json theme={null} { "email_notifications": { "booking_confirmation": false, "move_in_day": false, "payment_details": true } } ``` ### Metadata Attach up to 20 key-value pairs for your own references: ```json theme={null} { "metadata": { "external_booking_id": "BK-20260330-001", "channel": "website" } } ``` See [Metadata](/2025-09/guides/metadata) for details. ## Edge cases ### Availability races Stora does not hold units during checkout. If a unit type sells out between browsing and checkout completion, the order still completes but no unit is allocated. The operator handles this from the back office. Refresh availability data at your order summary page to reduce the risk. ### Abandoned orders Stora doesn't abandon Public API orders automatically. An order that is finalized but never completed stays `finalized`. Track `order.finalized` events and look for orders that don't receive `order.completed` within a reasonable timeframe. To close such an order, use [Abandon an Order](/2025-09/api-reference/orders/abandon-an-order) (`POST /orders/{order_id}/abandon`). It moves a `draft` or `finalized` order to `abandoned` and emits `order.abandoned`. After that, the order's `payment_url` no longer opens hosted checkout. A contact who already has the hosted checkout page open can still complete it. The order then moves to `completed`. ### Validation errors Common issues: * **"Line items must include at least one unit type line item"** — every order needs at least one storage unit. * **"Billing period must exist"** — the order has no `billing_period`. Set it when you create or update the order. ### Idempotency Use the `Idempotency-Key` header on `POST` requests to safely retry on network errors. See [Idempotent requests](/2025-09/guides/requests#idempotent-requests). # Changelog Source: https://docs.stora.co/2025-09/guides/changelog Version history for the Stora Public API. **2026-11-14** **Changed** * **OAuth 2**: with the Client Credentials grant, `POST /oauth2/token` returns the current access token, with its remaining `expires_in`, while it has more than a quarter of its lifetime left, instead of issuing a new one for the same scopes. Requests made while a token is reusable get the same token, so revoking it revokes it for all of them. **2026-11-13** **Added** * **Contract Templates API**: retrieve a contract template with `GET /contract_templates/{contract_template_id}`. Archived contract templates return `404`. * **Errors**: the errors guide lists every error code, with what it means, what to do and whether you can retry. The OpenAPI specification lists the codes in `x-error-codes`. Error codes are part of the API contract.; an invalid `fields` or `expand` parameter links to the guide for selecting fields or expanding responses in `links`. The code stays `invalid_url_param`. * **OpenAPI specification**: endpoints document the error codes they return, such as `opportunity_associated` on archiving an opportunity and `duplicate_price_adjustment` on scheduling a price adjustment.; the `Idempotency-Key` header is documented on all `POST` endpoints except OAuth 2, which already accepted it. The first successful response for a key is stored for 24 hours and returned for retries with the same key. **Changed** * **Errors**: the `Errors` link in `links` points to the section for the error's code, such as `https://docs.stora.co/2025-09/guides/errors#opportunity_associated`.; errors returned before the request reaches the endpoint, such as `invalid_token`, `too_many_requests` and `idempotency_conflict`, also link to the API reference page of the endpoint.; `api_error` returns `502 Bad Gateway` instead of `400 Bad Request`, with the message "A third-party service failed.". It means a service that Stora depends on, such as Stripe or PandaDoc, failed.; when Stora fails to delete a resource, such as a note or an order, the response is `500 Internal Server Error` with code `internal_server_error` and a message such as "Failed to delete the note.". Previously it was `400 Bad Request` with code `api_error` and the message "Internal or third-party API error.". **2026-11-12** **Added** * **OpenAPI specification**: `expand` is documented on the create, update and action endpoints of notes, price adjustments, tasks, units and webhook endpoints, which already accepted it. * All endpoints that return a resource take a `fields` query parameter, such as `fields=id,status,site.name`, and return only those fields. Identifiers and constant fields are always returned, and a field inside an expandable association also needs it in `expand`, unless the collapsed association returns it, such as `site.id`. An unknown or unexpanded path returns `422 Unprocessable Content` before the request changes anything. Endpoints that return a success message, such as deletes, and PDF responses ignore `fields`. Not available on OAuth 2 and image endpoints. **Changed** * Endpoints whose resources have nothing to expand, such as contacts, sites, coupons and staff, ignore `expand`. Previously, an `expand` value such as `*` or `expand[]=x` could return `422 Unprocessable Content` there. * Show, create, update and action endpoints process `expand` like list endpoints. In this version, an invalid value such as `expand[site]=yes` is dropped with a `Stora-Warning` header instead of returning `422 Unprocessable Content`. **2026-11-11** **Added** * **Subscriptions API**: `site_id`, `billing_period` and `cancellation_reason` filters, and `starts` (`starts_after`, `starts_before`) and `ends` (`ends_after`, `ends_before`) time-range filters on the subscriptions list endpoint. `cancellation_reason` accepts `unspecified` to filter by `null`. * **Tenancies API**: `site_id` filter, and `starts` (`starts_after`, `starts_before`) and `ends` (`ends_after`, `ends_before`) time-range filters on the tenancies list endpoint. * **Unit Types API**: `status` filter (`bookable`, `lead_capture`, `hidden`) on the unit types list endpoint. **Fixed** * **Contacts API**: `type`, `source`, `marketing_source` and `use_case` normalized to return `null` instead of an empty string when no value is set. This also applies to expanded contacts and `contact.*` webhook payloads. The `unspecified` filter value on these fields now matches these contacts too. * **Tenancies API**: retrieving an unknown tenancy returns the error message "The Tenancy was not found." instead of "The Subscription was not found." * **Timeline Events API**: creating or updating an event with a `tenancy` reference finds the tenancy by its ID. Previously a tenancy ID returned `404` with "The Subscription was not found.", and only the subscription's ID was accepted. * **Units API**: reserving or granting access to a unit for an unknown `tenancy_id` returns the error message "The Tenancy was not found." instead of "The Subscription was not found." **2026-11-10** **Added** * **Errors**: `links` includes the API reference page of the endpoint that returned the error, with `kind` set to `api_reference`. Errors with code `invalid_token`, `forbidden`, `too_many_requests`, `invalid_request` and `invalid_format` also link to the guide that explains them.; endpoints for orders, opportunities, deals, price adjustments, timeline, webhook endpoints, protection levels, units and unit allocations link to the guide for that feature in `links`. **Changed** * **Deals and Opportunities API**: expanding `line_items.item` no longer requires the `public.product:read` scope. Their line items contain only unit types and protection levels. * **Errors**: a request to an unsupported API version, such as `/2024-01/contacts`, returns the message "The requested API version is not supported." and links to the API versioning guide. The code stays `invalid_endpoint`. * **List endpoints**: `sort_direction` is case-insensitive. A value such as `desc` no longer gets a `Stora-Warning` header and is no longer deprecated. * **Notes API**: expanding `creator` now requires the `public.contact:read` scope. A note can have a contact as its creator. For example, when a contact signs a contract and a file they uploaded can't be saved, Stora adds a note with that contact as the creator. * Expanding a nested field also expands its parent. For example, `expand=deal.stage` now returns `deal` in full, with `stage` expanded inside it. Previously the nested path was applied only when the parent was also requested, as in `expand=deal,deal.stage`. **Fixed** * **Idempotent requests**: when a request with the same `Idempotency-Key` is still being processed, the `409` response is a standard error object with code `idempotency_conflict` and a link to the idempotent requests guide. Previously the body was `{"error": "Concurrent requests detected"}`. * **OpenAPI specification**: schemas now match what the API returns: * **Remove Overlock API**: `meta.unit_ids` lists units in a stable order, as Overlock does. Previously the order could differ between requests. * A request to an unsupported API version, such as `/2024-01/contacts`, returns a `404` `invalid_endpoint` error whose links point to the latest released version. **2026-11-09** **Changed** * **List endpoints validate their query params against the documented types. Values accepted before keep working**: instead of returning `422 Unprocessable Content`, the API corrects them and lists each correction in the `Stora-Warning` response header. Blank values such as `page=` are ignored. `sort_direction` and other values from a list are matched case-insensitively, so `desc` is read as `DESC`. A `limit` above 100 is read as 100. A timestamp without an offset is read as UTC. Invalid `page`, `limit`, `sort_by`, `sort_direction` and `expand` values are ignored. * \*\*Validation errors for a value that does not match its documented format say ``value `…` at `/…` does not match pattern**: …``. This applies to path, query and body values. * A path ID that does not have the resource's format, such as a contact ID `con_…` in `/deals/{deal_id}`, returns `422 Unprocessable Content` with code `invalid_url_param` and a `pointer` naming the param, such as `/deal_id`. Before, it returned `404 Not Found`. A well-formed ID that matches no resource still returns `404 Not Found`. * Filters sent in the body of a `GET` request are ignored. Send them in the query string. * Invalid filter values still return `422 Unprocessable Content`. The error message is now generic, and `details` has one entry with a `pointer` for each invalid value. * Params that only another API version declares return `422 Unprocessable Content`, in every version. * The `email` filter checks the email format. The `metadata` filter accepts up to 20 keys with string values. **Deprecated** * Query param values that the `Stora-Warning` header reports as corrected. Newer API versions return `422 Unprocessable Content` for them. **Fixed** * **Tasks and Webhook Endpoints API**: a repeated `status` value, such as `status=open,open`, now filters by that status. Before, the list was returned unfiltered. **Documented** * **Filters that already worked are now in the API reference**: `metadata` on Deals, Sites and Units, and `contact_id` on Tenancies. `assignee_id` on Deals and Tasks and `resource_id` on Notes and Tasks are documented as comma-separated lists. **2026-11-06** **Changed** * **Price Adjustments API**: errors come only from the percentage style the request uses, `percentages` or `percentage` with `applies_to`. A create request that sends neither is now asked for `percentages`. A request that sends both gets one error, at `percentage` or `applies_to`. * **Validation errors**: a `422 Unprocessable Content` response now lists one error per problem. Deals and Opportunities API: `line_items` errors come only from the line item type set in `type`. Before, each item also got errors from the other type. **Fixed** * **Orders API**: updating an existing line item's `price` in `PATCH /orders/{id}` now changes the price. Before, the request succeeded but the price stayed the same. **2026-11-05** **Fixed** * Resource IDs in request paths are now validated strictly. Endpoints accept only a resource's `id` as returned by the API; any other identifier returns `404 Not Found`. **2026-11-02** **Fixed** * **Subscriptions API**: `cancellation_reason` normalized to return only `null` for unknown reasons. **2026-10-29** **Added** * **Price Adjustments API**: `percentages` gives each type its own percentage change: `unit_types`, `protection_levels` and `products`. Responses and `price_adjustment.*` webhook payloads always include it, with `0` for a type that is not applied. Create and update requests can send it instead of `percentage` with `applies_to`. On create, a type left out is not applied. On update, a type left out is unchanged, and `0` switches it off. **Deprecated** * **Contacts**: `stripe_customer_id`. * **Price Adjustments API**: `percentage` and `applies_to`, in favour of `percentages`. They keep working. A request sends either `percentages` or `percentage` with `applies_to`, not both. When the applied types have different percentages, the `percentage` response field is the change in the subscription total. * **Prices, including nested prices**: `stripe_price_id`. * **Subscriptions**: `stripe_subscription_id` and `stripe_subscription_schedule_id`. * **Unit types and protection levels**: `stripe_product_id`. **2026-10-28** **Fixed** * **Notes API**: expanding `resource.assignee` now requires the `public.staff:read` scope * **Orders API**: expanding `line_items` now requires the `public.order:read` scope, including on the finalize, validate and abandon endpoints * **Unit Types API**: expanding `promotion` on the base price endpoint, and on nested unit types such as `unit_type.promotion`, now requires the `public.coupon:read` scope for apps and API keys created from 2026-07-08 * Expanding a line item's `item`, such as `line_items.item`, now requires the `public.unit_type:read`, `public.protection_level:read` and `public.product:read` scopes for apps and API keys created from 2026-10-28 **2026-10-23** **Fixed** * **Pagination**: records with the same sort value now keep a stable order across pages, so paging through a list no longer repeats or skips records. **2026-10-21** **Fixed** * **Pagination**: fixed a bug where requests using an invalid pagination URL parameter could return a successful response instead of an error. **2026-10-20** **Fixed** * **Contacts API**: `contact.updated` is now sent when only the `company_registration_number` or `identity_check.required` change. * **Coupons API**: `coupon.updated` is now sent when only the `amount` or `max_redemptions` change. * **Credit Notes API**: `credit_note.updated` is now sent when only the `subtotal`, `total` or `line_items` change. * **Invoices API**: `invoice.updated` is now sent when only the `subtotal`, `tax`, `total`, `line_items`, `finalized_at`, `paid_at`, `voided_at`, `contact`, `site` or `tenancy` change. Before, these changes sent no event. **2026-10-16** **Added** * **Invoices API**: nullable `payment_url` field on the Invoice resource. Returns a Stora payment link for open invoices, including overdue invoices; `null` otherwise. **2026-10-09** **Added** * **Opportunities API**: `opportunity.created`, `opportunity.updated`, `opportunity.archived`, `opportunity.unarchived`, `opportunity.associated`, and `opportunity.deleted` webhook events **Fixed** * **Opportunities API**: deleting a deal now returns its opportunities to `open`, so they can be associated or converted again **2026-10-07** **Added** * **Unit Types API**: optional `search` parameter on the list endpoint to find unit types by name (fuzzy match). **BETA** **2026-10-05** **Added** * **Contacts API**: nullable `accounting_code` field on the Contact resource, settable on create and update. Changing it emits `contact.updated` * **Opportunities API**: create deal endpoint, which converts an opportunity into a deal at a chosen stage and associates them; associate deal endpoint, where `POST` links an opportunity to an existing deal of the same contact and `DELETE` removes that link; `deal_id` filter on the list endpoint **Fixed** * **Opportunities API**: expanding `deal.assignee` now requires the `public.staff:read` scope **2026-09-29** **Fixed** * **Orders API**: line items now require a site-scoped protection level; a global or wrong-site protection level ID returns `422 Unprocessable Content`. **2026-09-28** **Fixed** * **Opportunities API**: creating or updating an opportunity with a line item now requires a matching site; a missing or different site returns `422 Unprocessable Content`. **2026-09-25** **Added** * **Credit Notes API**: nullable `refunded` Money object on the Credit Note resource. * **Invoices API**: `refund_status` field on the Invoice resource. **2026-09-24** **Added** * **Opportunities API**: archive and unarchive endpoints * **Price Adjustments API**: update endpoint; `price_adjustment.created`, `price_adjustment.scheduled`, `price_adjustment.updated`, `price_adjustment.rescheduled`, `price_adjustment.cancelled`, `price_adjustment.invoiced`, and `price_adjustment.failed` webhook events **2026-09-23** **Added** * **Opportunities API**: delete endpoint; update endpoint **2026-09-22** **Added** * **Opportunities API**: create endpoint **Changed** * **Contacts and Orders API**: contact address fields now accept `null`, which clears that field. Omitted fields are left unchanged. **2026-09-16** **Fixed** * **Deals API**: creating or updating a deal with a unit type now requires a matching site; a missing or different site returns `422 Unprocessable Content`. **2026-09-04** **Changed** * **Protection Levels API**: base-price updates now accept global protection-level IDs before insurance site-scoping activation and site-scoped IDs after activation. Requests using the non-authoritative catalogue return a conflict. **2026-09-03** **Added** * **Opportunities API**: list and show endpoints **2026-09-02** **Added** * **Price Adjustments API**: read endpoints; create endpoint; destroy endpoint; schedule endpoint **2026-08-19** **Added** * **Protection Levels API**: `site` expandable association **Preparation for protection levels moving from the account to each site**; filter by `site_id`; expandable responses enabled for read endpoints **Changed** * **Deals API**: a `protection` line item must reference an account-level protection level, or one belonging to the deal's site **Preparation for protection levels moving from the account to each site** **2026-08-10** **Added** * **Invoices API**: `due` time-range filters (`due_after`, `due_before`); `due_date` sorting on the invoices list endpoint **2026-07-23** **Added** * **Invoices API**: `invoice.overdue` webhook event, fired when an invoice becomes overdue for payment; `collection_status` and `due_date` fields on the Invoice resource; `collection_status` filter on the invoices list endpoint **2026-07-22** **Added** * **Credit Notes API**: `accounting_code` field on line items, also included in the `credit_note.created` and `credit_note.updated` webhook payloads **2026-07-09** **Added** * **Tenancies API**: `tenancy.auto_reservation.succeeded`, `tenancy.auto_reservation.partially_succeeded`, and `tenancy.auto_reservation.failed` webhook events **2026-07-07** **Added** * **Contract Templates API**: `updated` and `created` time-range filters * **Contracts API**: `updated` time-range filters * **Coupons API**: `updated` and `created` time-range filters * **Credit Notes API**: `updated` time-range filters * **Deal Stages API**: `updated` and `created` time-range filters * **Invoices API**: `updated` time-range filters * **Notes API**: `updated` time-range filters * **Orders Line Items API**: `updated` and `created` time-range filters * **Products API**: `updated` time-range filters * **Protection Levels API**: `updated` and `created` time-range filters * **Sites API**: `updated` and `created` time-range filters * **Subscriptions API**: `updated` and `created` time-range filters * **Tasks API**: `updated` time-range filters * **Tenancies API**: `updated` and `created` time-range filters * **Timeline Sources API**: `updated` time-range filters * **Timeline Templates API**: `updated` time-range filters * **Unit Allocations API**: `updated` and `created` time-range filters * **Unit Types API**: `updated` and `created` time-range filters * **Units API**: `updated` time-range filters * **Webhook Endpoints API**: `updated` and `created` time-range filters **Changed** * **Orders API**: payment URLs and the new payment details email are now generally available. **2026-07-06** **Added** * **Orders API**: **beta** support for the new payment details email; abandon endpoint and `order.abandoned` webhook event **Fixed** * **Orders API**: `emails` is marked as deprecated in favor of the `email_notifications` field in the [Create](https://docs.stora.co/2025-09/api-reference/orders/create-an-order) and [Update](https://docs.stora.co/2025-09/api-reference/orders/update-an-order) requests **2026-07-01** **Added** * **Unit Types API**: `live_prices` field **2026-06-30** **Added** * **Orders API**: **beta** support for new payments URLs **2026-06-23** **Added** * **Subscriptions API**: `subscription.resumed` webhook event **Fixed** * **Subscriptions API**: `subscription.cancelled` webhook event emits for every subsequent cancellation after the first **2026-06-15** **Added** * **Products API**: images **2026-05-28** **Fixed** * **Tenancies API**: webhook response payloads will be presented with `tenancy` data root **2026-05-26** **Added** * **Deals API**: `deal.stage_changed` webhook event **2026-05-21** **Added** * **Contacts API**: add `status` field and filter by `status` **2026-05-20** **Added** * **Deals API**: create, update, and destroy endpoints **2026-05-06** **Added** * **Orders API**: filter by `source` and `billing_period`, plus `updated_at` and `starts_at` time-range filters **2026-04-14** **Added** * **Contacts API**: filter by `use_case`, `type`, `source` `marketing_source` **2026-04-08** **Added** * **Contacts API**: expose `identity_check` **2026-04-03** **Added** * **Contracts API**: filter by `contact_id`, `contract_template_id` and `tenancy_id` query params **2026-04-01** **Added** * **Identity Verifications API**: webhook events **2026-03-31** **Added** * **Identity Verifications API**: read endpoints * **Unit Types API**: `promotion` expandable association **2026-03-24** **Added** * **Deals API**: index filters **2026-03-23** **Added** * **Unit Types API**: filter by `site_id` query parameter **2026-03-20** **Added** * **Contracts API**: link to sign the contract on Storefront * **Unit Types API**: link to create a new order on Storefront **2026-03-19** **Added** * **Images API**: expose sites and unit types images **2026-03-17** **Added** * **Deals API**: add `lose` endpoint; add `reopen` endpoint **2026-03-13** **Fixed** * **Invoices API**: response payload will show accounting nominal code **2026-03-11** **Added** * **Invoices API**: add `subscription` and `tenancy` expandable objects and filters to invoice resource **2026-03-09** **Added** * **Deals API**: add `win` endpoint **2026-03-04** **Added** * **Contacts API**: add `metadata` to contact resource * **Orders API**: add `metadata` to order resource * **Tasks API**: add `metadata` to task resource **2026-03-03** **Added** * **Notes API**: add `metadata` to note resource * **Timeline Events API**: create, update, and destroy endpoints * **Timeline Sources API**: read endpoints * **Timeline Templates API**: read endpoints **2026-02-27** **Added** * **Contracts API**: `contract.created` webhook event; `contract.signed` webhook event * **Deals API**: `deal.won` webhook event; `deal.reopened` webhook event; `deal.lost` webhook event **2026-02-26** **Added** * **Contracts API**: filter by site ID and status **Fixed** * **Contracts API**: replace `subscription` with `tenancy` in contract response **2026-02-24** **Added** * **Contracts API**: show endpoint; list endpoint * **Notes API**: filter by resource_type * **Webhook Endpoints API**: add `metadata` to webhook endpoint resource **2026-02-20** **Added** * **Credit Notes API**: sorting * **Deals API**: `deal.created` webhook event; `deal.updated` webhook event * **Units API**: search filter on the list endpoint **2026-02-17** **Added** * **Notes API**: `note.created` webhook event; `note.updated` webhook event; create endpoint * **Sites API**: search filter on the list endpoint * **Subscriptions API**: filter by contact ID **Fixed** * **OpenAPI**: add missing pagination params to Staff API **2026-02-16** **Added** * **Contacts API**: search filter on the list endpoint * **Notes API**: update endpoint; destroy endpoint; show endpoint * **Units API**: overlock endpoint; remove overlock endpoint **Fixed** * **OpenAPI**: fixes (consistency & references) **2026-02-13** **Added** * **Deal Stages API**: list and show endpoints * **Deals API**: list and show endpoints * **Notes API**: list endpoint **2026-02-11** **Added** * **Staff API**: search filter by name or email * **Units API**: add `unit_allocation` expandable object to unit resource **2026-02-10** **Added** * **Units API**: grant access endpoint; deallocate endpoint **2026-02-09** **Added** * **Tasks API**: index filters and sorting **2026-02-05** **Added** * **Units API**: reserve endpoint **2026-02-04** **Added** * **Tasks API**: `task.reopened` webhook event; `task.updated` webhook event * **Webhook Endpoints API**: endpoints scoped and managed by OAuth apps **2026-02-03** **Added** * **Webhook Endpoints API**: add `creator` to webhook endpoint resource **2026-01-29** **Added** * **Tasks API**: `task.completed` webhook event; `task.created` webhook event **2026-01-28** **Added** * **Staff API**: show endpoint **2026-01-27** **Added** * **Staff API**: list endpoint **2026-01-23** **Added** * **Tasks API**: open endpoint **2026-01-22** **Added** * **Tasks API**: complete endpoint; delete endpoint; update endpoint * **Unit Allocations API**: list endpoint **2026-01-21** **Added** * **OAuth 2**: Authorization Code flow support * **Unit Allocations API**: show endpoint **2026-01-19** **Added** * **Contacts API**: filter by email **2026-01-16** **Added** * **Tasks API**: create endpoint **2026-01-13** **Added** * **Tasks API**: show endpoint; list endpoint **2025-12-17** **Added** * **Webhook Endpoints API**: index filters **2025-12-16** Official release of the `2025-09` version. **Added** * **Contacts API**: initial * **Contract Templates API**: initial * **Coupons API**: initial * **Credit Notes API**: PDF support; filters; initial * **Filters**: Time ranged filters * **Invoices API**: PDF support; filters; initial * **Orders API**: orders summary; support for starts at now; update action; filters; initial version of the create action; add `billing_period` to the order; initial version of index and show actions * **Orders Line Items API**: delete endpoint; update endpoint; create endpoint; list endpoint * **Product Categories API**: initial * **Products API**: filters; initial * **Protection Levels API**: initial * **Sites API**: initial * **Subscriptions API**: initial * **Tenancies API**: initial * **Unit Types API**: Base Price; initial * **Units API**: filters; initial * Add the `Money` component * Expandable responses * Initial resource sorting * Preparation for expandable resources in responses * Webhooks Core # Connect an account Source: https://docs.stora.co/2025-09/guides/connect-account Invite a Stora account to connect to your developer company and approve access to manage API credentials. Connect a Stora account to your developer company when you need to manage that account's API credentials and webhook endpoints in the [Developer Portal](https://developer.stora.co). > [!NOTE] > > This connection is for accounts you work with directly. If you build a partner app that operators authorise themselves, follow [Building a partner integration](/2025-09/guides/partner-integrations) instead. ## Prerequisites You need: * A Developer Portal account with an admin role in your developer company to generate the invitation link. * A Stora account with Public API access. * A Stora staff member with the **Accept developer company connections** permission to approve the connection. You can approve the connection yourself if you have the required access to both accounts. Otherwise, share the invitation with the appropriate Stora staff member. > [!TIP] > > To explore the API without real account data, [create a test operator](/2025-09/guides/developer-portal#testing--looking-around) first. You do not need an invitation to a real Stora account to start testing. ## Connect a Stora account **1. Open connected accounts** Sign in to [`developer.stora.co`](https://developer.stora.co). If you are creating your Developer Portal account, choose **Account integration** as your purpose. Open **Connected accounts**. **2. Generate an invitation link** Click **Invite account**, then **Generate invitation link**. Copy the link. If a link already exists, you can copy that link instead. Share it directly with the Stora staff member who will approve access. Stora does not email the invitation for you. Share it only with someone you already work with. **3. Approve the connection in Stora** The staff member opens the link and signs in to Stora. If they belong to multiple operator accounts, they select the account to connect. They review the developer company name, confirm the acknowledgement that they know and trust your company, and click **Approve connection**. If the account does not have Public API access, it must be upgraded before the connection can be approved. **4. Select the connected account** Return to **Connected accounts** in the Developer Portal. Open the account with an **Active** connection to manage its **Access tokens**, **OAuth clients**, and webhook endpoints. > [!WARNING] > > Approval allows your developer company to create API credentials and webhook endpoints for the Stora account. Credentials can use any Public API scopes available to that account. Only approve a company you trust, with any required commercial or data-processing agreements in place. ## Manage invitation links In **Connected accounts**, a developer-company admin can click **Invite account** to copy the current invitation link, regenerate it, or revoke it. Regenerating or revoking the link invalidates the previous link. Existing account connections are not affected. The invitation link belongs to your developer company, not to an individual Stora account. To end an existing connection, see [Manage access](/2025-09/guides/manage-account-access#terminate-an-account-connection). ## Troubleshoot a connection | Problem | What to check | | - | - | | You cannot generate an invitation | Ask an admin in your developer company to generate the link. | | The invitation link no longer works | Ask the developer company for its current link. The previous link may have been regenerated or revoked. | | The staff member cannot approve the connection | Check their **Accept developer company connections** permission and that they have an active membership in the Stora account. | | The account shows Public API unavailable | The account needs Public API access before it can approve a connection or manage credentials. | | The connection is revoked | Ask an authorised Stora staff member to accept the invitation again. This restores developer management of the existing credentials, but does not automatically enable disabled credentials. | ## Next steps * [API credentials](/2025-09/guides/managed-account-authentication) — choose Access Tokens or OAuth Clients and make authenticated requests. * [Manage access](/2025-09/guides/manage-account-access) — manage scopes, credential expiry, and connection termination. # Core concepts Source: https://docs.stora.co/2025-09/guides/core-concepts Understand Stora's domain model, key resources, how they relate, and the lifecycles that drive the system. Before diving into specific endpoints, it helps to understand how Stora's domain model fits together. This guide covers the key resources, how they relate, and the lifecycles that drive the system. ## The big picture Stora models a self-storage business. At the top level, an operator runs one or more **sites** (physical locations). Each site has **unit types** (storage categories) containing individual **units** (bookable spaces). **Contacts** rent units through **orders**, which create **tenancies** (the storage agreement) and **subscriptions** (the billing agreement). ```mermaid actions={false} theme={null} %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4', 'edgeLabelBackground': '#FF7237'}}}%% graph TD Site --> UT["Unit Type"] --> Unit Contact -->|"  creates  "| Order Order -->|"  completes  "| Tenancy Order -->|"  completes  "| Subscription Tenancy --> UA["Unit Allocations"] Subscription --> Invoices ``` ## Sites, unit types, and units These three resources represent the physical world of a storage facility. ### Site A single physical self-storage location. It's the container for everything at that location: units, pricing, access control, and reporting. A site has an address, access hours, and contact details. ### Unit type A standardised storage offering at a site — for example "50 sq ft indoor" or "20 ft container." Unit types define the size, features, and pricing that apply to all units of that type. ### Unit A specific, bookable storage space — for example "Unit A-012" of a given unit type. Each unit tracks its own status as it moves through the rental lifecycle. **Unit states:** | State | Meaning | | - | - | | `available` | Ready to be rented | | `reserved` | Allocated to a tenancy that hasn't started yet | | `occupied` | Allocated and the tenancy is active | | `overlock` | Access restricted, typically due to non-payment | | `repossessed` | Contents repossessed after prolonged non-payment | | `unavailable` | Taken offline by staff (maintenance, etc.) | The typical happy path is: `available` → `reserved` → `occupied` → `available` (when the tenant moves out). Overlocking and repossession are exception paths for non-payment. ```mermaid actions={false} theme={null} %%{init: {'theme': 'base', 'flowchart': {'defaultRenderer': 'elk'}, 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4'}}}%% graph LR available --> reserved --> occupied --> available occupied --> overlock occupied --> repossessed unavailable <--> available ``` ## Contacts A contact is the end user of a storage business — an individual or company that inquires, books, and pays for storage. Contacts exist at the operator level (not per-site), so the same person can rent at multiple locations. Contacts support [metadata](/2025-09/guides/metadata) for attaching your own external identifiers. ## The rental lifecycle: orders, tenancies, and subscriptions This is the most important relationship in the API. Three resources represent different views of a rental: ### Order An order captures a contact's intent to rent storage. It includes the selected site, unit type, move-in date, pricing, and optional add-ons (protection, products, services). **Order states:** | State | Meaning | | - | - | | `draft` | Being assembled — line items can be added or changed | | `finalized` | Locked in — validated and ready for completion | | `completed` | Done — a tenancy and subscription have been created | | `abandoned` | Cancelled before completion | An order contains **line items** — the individual charges that make up the rental (unit rent, protection, products, fees). ### Tenancy A tenancy represents the ongoing storage agreement between a contact and an operator. It answers the questions: **who** has **which unit**, at **which site**, **from when to when**? A tenancy is created when an order completes. It links to: * The **order** that created it * The **subscription** that bills for it * The **unit allocations** — which specific units are assigned * The **site** and **contact** ### Subscription A subscription is the billing side of the same rental. It represents the recurring payment agreement — billing period, prices, discounts, and taxes. Subscriptions generate **invoices** on each billing cycle. A price adjustment changes selected recurring charges on one subscription at a future renewal. It has its own draft, scheduling, notification, and application lifecycle. See [Schedule a subscription price adjustment](/2025-09/guides/price-adjustments). ### How they fit together When an order completes, Stora creates both a tenancy and a subscription. They represent the same rental from two different angles: * **Tenancy** = the physical/logistical view ("who is storing what, where") * **Subscription** = the financial view ("what are they paying, and when") ```mermaid actions={false} theme={null} %%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#e8ebf4', 'primaryTextColor': '#05195A', 'primaryBorderColor': '#e8ebf4', 'lineColor': '#FF7237', 'secondaryColor': '#e8ebf4', 'tertiaryColor': '#e8ebf4', 'edgeLabelBackground': '#FF7237'}}}%% graph TD Order -->|"  the storage agreement  "| Tenancy Order -->|"  the billing agreement  "| Subscription Tenancy --> UA["Unit Allocations"] Subscription --> Invoices ``` You can navigate between them: an order references its tenancy and subscription. A tenancy references its order and subscription. A subscription references its tenancy and order. Use the `expand` parameter to include related resources inline. ## Billing: invoices and credit notes ### Invoices A subscription generates invoices on each billing cycle. Invoices are also created for one-off charges and security deposits. **Invoice states:** | State | Meaning | | - | - | | `draft` | Being prepared — not yet issued | | `deleted` | A draft that was deleted before it was issued | | `open` | Issued — awaiting payment | | `paid` | Settled | | `uncollectible` | Payment failed and won't be retried | | `void` | Cancelled | Stora returns invoices as JSON by default, or as CSV when you send `Accept: text/csv`. To get a PDF, retrieve a single invoice with `Accept: application/pdf`. If the invoice has no PDF, the request returns `406`. Credit notes support PDF the same way. Invoice lists don't support PDF. ### Credit notes A credit note reduces or reverses part or all of a previously issued invoice. It references the original invoice and specifies the corrected amounts. ## Opportunities An opportunity records a contact's interest in storage before that interest becomes a qualified sales deal. It can include a site, a unit-type preference, a protection preference, and metadata. Capturing an opportunity does not create an order or reserve a unit. An opportunity is `open`, `archived`, or `associated` with a deal. Several opportunities can refer to the same deal, but an opportunity can refer to only one deal at a time. Association restricts updates to the opportunity's metadata. See [Capture and qualify leads](/2025-09/guides/opportunities-and-deals) to create an opportunity, convert it to a deal, or associate it with a deal that already exists. ## Deals A deal is a pre-sale CRM record representing a potential order. Where an order captures firm intent with agreed pricing, a deal tracks the early-stage sales process — an inquiry that may or may not convert. **Deal states:** `open` → `won` or `lost` A deal links to a contact, and optionally a site and unit type. When a deal is won, it typically leads to an order being created. ## Supporting resources ### Contracts A contract is a document generated from a **contract template** for a specific contact and tenancy. It tracks the signing lifecycle: `pending` → `signed`, `voided`, `declined`, or `deleted`. ### Notes A text annotation attached to a resource — a contact, unit, subscription, or task. Notes capture observations, reminders, or context added by staff or integrations. ### Tasks A piece of work, optionally linked to a resource (a unit, subscription, or contact). Tasks are either `open` or `completed`, and can be assigned to staff. ### Products and protection levels **Products** are sellable items or services (e.g. padlocks, insurance, admin fees). **Protection levels** are optional add-ons that protect a contact's stored goods up to a chosen coverage amount. Both can appear as line items on an order. ### Coupons Reusable promotions that reduce the price a contact pays, by a percentage or fixed amount. Coupons can be scoped to specific charge types and limited by duration or number of uses. ## Unit allocations A unit allocation joins a specific unit to a tenancy. It tracks when the unit was reserved, when access was granted, and by whom. This is what drives the unit's status — allocating a unit moves it from `available` to `reserved` or `occupied`. For a full walkthrough of the allocation lifecycle, auto-reservation, access control sync, and the API endpoints for managing unit access, see [Allocations and access](/2025-09/guides/allocations-and-access). ## Resource IDs All resources use prefixed string IDs. The prefix tells you the resource type at a glance: | Prefix | Resource | | - | - | | `site_` | Site | | `utype_` | Unit Type | | `unit_` | Unit | | `alloc_` | Unit Allocation | | `con_` | Contact | | `order_` | Order | | `olitm_` | Order Line Item | | `ten_` | Tenancy | | `sub_` | Subscription | | `pradj_` | Price Adjustment | | `inv_` | Invoice | | `cred_` | Credit Note | | `opp_` | Opportunity | | `deal_` | Deal | | `dstg_` | Deal Stage | | `ctr_` | Contract | | `ctpl_` | Contract Template | | `note_` | Note | | `task_` | Task | | `prod_` | Product | | `pcat_` | Product Category | | `plvl_` | Protection Level | | `cpn_` | Coupon | | `staff_` | Staff | | `idver_` | Identity Verification | | `tsrc_` | Timeline Source | | `aetpl_` | Timeline Template | | `aevt_` | Timeline Event | | `we_` | Webhook Endpoint | ## Scopes Every API endpoint (except OAuth 2) requires at least one scope. Scopes follow the format: ``` public.: ``` For example: `public.contact:read`, `public.order:write`, `public.site:read`. When expanding related resources in a response, your token needs the read scope for each expanded resource. For example, expanding `site` on a subscription requires `public.site:read` in addition to `public.subscription:read`. # Data synchronisation Source: https://docs.stora.co/2025-09/guides/data-synchronisation Reduce API calls by fetching data once and using webhooks to keep your local copy current. If your integration serves data from Stora to end users — unit types on a booking page, prices on a comparison tool, coupon codes in a checkout — you'll want to avoid fetching everything from the API on every request. The API has [rate limits](/2025-09/guides/requests#rate-limiting) (10 requests per second, 60 per minute), and round trips add latency. Fetch an initial snapshot, use webhooks for ongoing updates, and reconcile periodically to recover missed changes. ## How often does data actually change? Not all resources change at the same rate. Understanding this helps you decide what's safe to cache and for how long. ### Rarely These typically only change when an operator reconfigures their offering. * [Sites](/2025-09/api-reference/sites/list-all-sites) * [Unit types](/2025-09/api-reference/unit-types/list-all-unit-types) * [Products](/2025-09/api-reference/products/list-all-products) * [Product categories](/2025-09/api-reference/product-categories/list-all-product-categories) * [Protection levels](/2025-09/api-reference/protection-levels/list-all-protection-levels) * [Contract templates](/2025-09/api-reference/contract-templates/list-all-contract-templates) * [Staff](/2025-09/api-reference/staff/list-all-staff) These are safe to cache for long periods — hours or even a full day — and refresh on a schedule or when you receive a relevant webhook. ### On business events These change when an operator takes a deliberate action, like updating pricing or creating a promotion. * [Coupons](/2025-09/api-reference/coupons/list-all-coupons) * Unit Type live prices on [unit types](/2025-09/api-reference/unit-types/list-all-unit-types), plus base prices on [products](/2025-09/api-reference/products/list-all-products) and [protection levels](/2025-09/api-reference/protection-levels/list-all-protection-levels) > [!NOTE] > > Price changes on unit types and protection levels trigger their respective `.updated` webhooks. Use these to invalidate cached pricing, including Unit Type `live_prices` used by booking flows. ### Frequently These change with customer and operational activity — bookings, payments, unit status changes. * [Units](/2025-09/api-reference/units/list-all-units) * [Contacts](/2025-09/api-reference/contacts/list-all-contacts) * [Orders](/2025-09/api-reference/orders/list-all-orders) * [Deals](/2025-09/api-reference/deals/list-all-deals) * [Tenancies](/2025-09/api-reference/tenancies/list-all-tenancies) * [Subscriptions](/2025-09/api-reference/subscriptions/list-all-subscriptions) * [Invoices](/2025-09/api-reference/invoices/list-all-invoices) * [Credit notes](/2025-09/api-reference/credit-notes/list-all-credit-notes) * [Contracts](/2025-09/api-reference/contracts/list-all-contracts) * [Tasks](/2025-09/api-reference/tasks/list-all-tasks) * [Notes](/2025-09/api-reference/notes/list-all-notes) * [Unit allocations](/2025-09/api-reference/unit-allocations/list-all-unit-allocations) Cache selectively based on your use case. If you're building a dashboard that shows unit occupancy across sites, caching unit status and keeping it fresh via webhooks makes sense. If you only read invoices when processing a payment, fetch them at that point instead. ## Using webhooks to stay in sync [Webhooks](/2025-09/guides/webhooks) are the primary tool for knowing when data has changed. Rather than polling the API on a timer, subscribe to the events that matter to your integration and react when they fire. For partner apps and developers managing several operator accounts, run this sequence separately for each connected operator. Keep snapshots, checkpoints, resource mappings, and queued events associated with that operator. Follow [Syncing multiple operators](/2025-09/guides/caching#syncing-multiple-operators) when adding or reconnecting an operator. Use this sequence to avoid a gap between the initial fetch and webhook subscription: 1. [Subscribe to relevant webhook events](/2025-09/guides/webhooks#getting-started). Verify signatures and durably enqueue events before returning `2xx`. 2. Record the sync-start timestamp for each resource type, then fetch all pages of the data you need. Buffer incoming events until the snapshot is stored. 3. Reconcile buffered events by re-fetching affected resources. Serialise updates per resource so older results cannot overwrite newer data. Retain events that arrive during reconciliation and retry processing failures. 4. For resources with time-range filters, run a catch-up query from just before the sync-start timestamp. Use overlapping ranges and advance the checkpoint only after all pages and local writes succeed. Follow the [polling checkpoint procedure](/2025-09/guides/caching#polling-with-updated_after). 5. Continue processing queued events and schedule periodic reconciliation to recover missed changes. Webhook payloads include the full resource. You can use them directly if you reject stale updates, because delivery order is not guaranteed. Otherwise, re-fetch the resource. For example, a unit type event includes: ```json theme={null} { "event": { "type": "unit_type.updated", "data": { "unit_type": { "id": "utype_abc123", "name": "50 sq ft Indoor", "status": "bookable" } } } } ``` Most resources have webhook events, but not all — sites, products, product categories, contract templates, and staff don't have webhooks yet. For these, fetch on a schedule. Since they all change rarely, even polling once a day may be enough depending on your use case. For the full list of available events, see the [webhooks guide](/2025-09/guides/webhooks#available-events). # Secure your Developer Portal account Source: https://docs.stora.co/2025-09/guides/developer-account-security Set up an authenticator app, save recovery codes, add passkeys, and recover access to your account. The Developer Portal requires multi-factor authentication. Set up your authenticator app before you manage applications or operator credentials. ## Set up your authenticator app After you create your account or have its MFA reset, the portal opens **Set up an authenticator app**. 1. Open an authenticator app that supports time-based one-time passwords, such as 1Password, Bitwarden, or Google Authenticator. 2. Scan the QR code. If you cannot scan it, enter the setup key shown in the portal. 3. Enter the six-digit code from your authenticator app in **Verification code**. 4. Click **Continue**. 5. Save the recovery codes in a secure location that you can access without your authenticator app. 6. Click **Continue** to open the portal. Each recovery code works once. Do not share your authenticator setup key or recovery codes with teammates. Each teammate needs a separate Developer Portal account. ## Add a passkey 1. Open **Settings**, then **Security**. 2. Under **Passkeys**, click **Add passkey**. 3. If the portal asks you to confirm access, use a passkey or enter an authenticator code. 4. Follow your browser's prompt to create the passkey. The passkey appears in the list. Use the edit action beside the passkey to give it a label that identifies its device or password manager. To remove a lost or unused passkey, click its remove action and confirm. That passkey can no longer sign in to your account. ## Replace your recovery codes > [!WARNING] > > Generating new recovery codes invalidates the previous set. Save the new codes before you leave the result page. 1. Open **Settings**, then **Security**. 2. Click **Regenerate recovery codes**. 3. If prompted, confirm access with a passkey or an authenticator code. 4. Store the new codes securely. Replace any saved copy of the previous set. ## Sign in when your authenticator is unavailable If you have a registered passkey, use the passkey sign-in option. Otherwise, sign in with your account credentials. On **Verify your identity**, click **Use recovery code**, enter an unused code, and click **Continue**. If you have no working passkey, authenticator, or recovery code, ask a developer-company admin whether they can reset your MFA. ## Request an MFA reset An admin can reset MFA for another team member who does not have the **Admin** role. An admin cannot use this action for themselves or another admin. If no eligible admin can help, contact Stora for account recovery assistance. To reset an eligible member's MFA: 1. Open **Team Members**. 2. Find the member and click **Reset MFA**. 3. Confirm the reset for that account. The reset removes the account's authenticator configuration, recovery codes, and passkeys. The member must set up an authenticator app again when they next access the portal. For invitations and role changes, see [Manage your developer company and team](/2025-09/guides/developer-company-and-team). # Manage your developer company and team Source: https://docs.stora.co/2025-09/guides/developer-company-and-team Update company details, invite teammates, assign roles, and hand over administration. Use separate Developer Portal accounts for your teammates. A team invitation grants access to your developer company. It does not invite a Stora operator to connect or test an application. ## Before you start Sign in to the [Developer Portal](https://developer.stora.co). You need the **Admin** role to change company details or manage team membership. Members can use the portal for development, but they cannot administer the team or update the company profile. The **Admin** role is a developer-company role, not a staff role in a connected Stora operator. ## Update company details 1. Open **Settings**, then **Company profile**. 2. Update the company name, website, technical contact email, and marketing contact email as needed. 3. Select what you are building with Stora. 4. Click **Save changes**. Keep the technical contact email current so Stora can reach the right person about your integration. ## Invite a teammate 1. Open **Team Members**. 2. Click **Invite member**. 3. Enter the teammate's **Full name** and **Email**. 4. Choose **Member** for development access or **Admin** if the teammate also needs to manage the company and team. 5. Click **Send invitation**. The team list shows **Pending** until the teammate accepts the invitation. The teammate then completes their account setup, including [multi-factor authentication](/2025-09/guides/developer-account-security). If the invitation does not arrive, check the email address and ask the teammate to check their spam folder. Contact Stora if you need help sending another invitation. ## Change a role 1. Open **Team Members**. 2. Click **Edit role** beside the teammate. 3. Select **Member** or **Admin**. 4. Click **Save changes**. At least one active admin must remain. The portal rejects a change that demotes the last active admin. ## Hand over administration Before you demote or remove an admin who is leaving: 1. Invite the replacement if they do not already belong to the company. 2. Wait until the replacement has accepted the invitation and appears as **Active**. 3. Assign the replacement the **Admin** role. 4. Confirm that the replacement can access company and team settings. 5. Change the departing admin's role or ask another admin to remove them. You cannot remove yourself. Another admin must remove your membership if you leave the company. ## Remove a teammate 1. Open **Team Members**. 2. Find the teammate and click **Remove**. 3. Confirm the removal. Removing a member removes their membership of this developer company. It does not replace a credential review. If the teammate could access client secrets or tokens, review those credentials and replace or revoke them as appropriate. For a member who has lost access to their authenticator, see [Request an MFA reset](/2025-09/guides/developer-account-security#request-an-mfa-reset). # Developer Portal Source: https://docs.stora.co/2025-09/guides/developer-portal Create test operators, manage connected operator accounts, and build partner apps for the Stora API. Use the Developer Portal at [`developer.stora.co`](https://developer.stora.co) to set up and manage development access for the Stora API. The portal guides you through three workflows: * **Testing / exploration** — create a test operator and explore the API safely. * **Account integration** — connect a real operator account when you need to manage API access for that operator. * **Partner app** — create an OAuth application for partner integrations and marketplace distribution. Choose the workflow that matches what you are building. You do not need to connect a real operator account just to explore the API. ## Testing / looking around Start here when you want to explore the API. Create a Developer Portal account and [set up multi-factor authentication](/2025-09/guides/developer-account-security). Then [create a test operator](/2025-09/guides/test-operators) for your developer company. A test operator is separate from any real operator connection. Use a test operator to try requests, create credentials, configure webhook endpoints, and test integration behavior before working with real operator data. > [card] [Set up authentication](/2025-09/guides/authentication) > > Create credentials and learn how access tokens and OAuth 2.0 work. > [card] [Make your first request](/2025-09/guides/first-request) > > Use your test operator to make your first API call. ## Manage accounts Use **Account integration** when you need to manage API access for a specific real operator. Connecting an operator account is optional. Use this flow when you are building a single-operator integration or when a developer manages credentials for an operator. Follow the **Manage accounts** guides: * [Connect an account](/2025-09/guides/connect-account) — generate an invitation and get staff approval to manage the account's API access. * [API credentials](/2025-09/guides/managed-account-authentication) — choose Access Tokens or OAuth Clients and use Client Credentials. * [Manage access](/2025-09/guides/manage-account-access) — change scopes, manage expiry, disable or revoke credentials, and terminate a connection. Either side can revoke the connection. This stops developer management, but does not automatically stop existing credentials. See [Terminate an account connection](/2025-09/guides/manage-account-access#terminate-an-account-connection) for the differences between developer-side and Stora-side revocation. ## Create partner app Use **Partner app** when you are building an integration for multiple operators or preparing an app for marketplace distribution. In the Developer Portal, you can: * Create and maintain partner applications. * Develop against your test operators. * [Invite selected operators to test your application](/2025-09/guides/partner-integrations#invite-a-real-operator-to-test), then complete OAuth consent separately. * Review the [partner approval checklist](/2025-09/guides/partner-approval-checklist) before you submit. * [Submit your application for review](/2025-09/guides/partner-integrations#submit-your-application-for-review) when it is ready. * After application approval, [submit a marketplace listing](/2025-09/guides/publish-marketplace-listing) through a separate review. Creating a partner application creates a test app. Configure its redirect URIs, copy its client ID, and reveal its client secret once. Store the secret securely on your backend. Test applications are intentionally limited. They can be used with your developer company's test operators, or with real operators that accept an application invitation. Approval publishes a separate live application with its own credentials. Use those credentials for production connections. See [Partner app credentials](/2025-09/guides/partner-integrations#partner-app-credentials) for details. For deeper guidance, see: * [Building a partner integration](/2025-09/guides/partner-integrations) * [Distributing a public plugin](/2025-09/guides/distributing-public-plugins) * [Third-party plugin naming rules](/2025-09/guides/third-party-plugin-naming) ## Manage your developer company Use separate accounts for your teammates. Developer-company admins can update company details, invite members, assign roles, and remove members. * [Manage your developer company and team](/2025-09/guides/developer-company-and-team). * [Secure your Developer Portal account](/2025-09/guides/developer-account-security), including recovery codes, passkeys, and MFA recovery. # Developer tools Source: https://docs.stora.co/2025-09/guides/developer-tools Use AI tools, MCP, and machine-readable specs to work with the Stora API more efficiently. This documentation site includes built-in integrations that help you work with the Stora API using AI assistants, code editors, and automation tools. ## Contextual menu Every page in these docs has a contextual menu (look for the icons in the page header) that lets you: * **Copy as markdown** — grab the page content for use in prompts or notes * **Open in ChatGPT, Claude, or Perplexity** — send the current page directly to an AI assistant with one click * **Install MCP server** — connect your docs-aware AI tools to the Stora API docs ## Documentation MCP server The Stora docs include a hosted [Model Context Protocol](https://modelcontextprotocol.io/) (MCP) server. When connected, your AI tools can search the content of these docs directly instead of relying on training data or web search. This is a documentation search tool — it doesn't connect to the Stora API or your account data. The MCP server URL is: ``` https://docs.stora.co/mcp ``` > [tab] Claude Code > > ```bash theme={null} > claude mcp add stora-docs --transport sse https://docs.stora.co/mcp > ``` > [tab] Cursor > > Add the following to your `.cursor/mcp.json`: > > ```json theme={null} > { > "mcpServers": { > "stora-docs": { > "url": "https://docs.stora.co/mcp" > } > } > } > ``` > [tab] VS Code > > Add the following to your `.vscode/mcp.json`: > > ```json theme={null} > { > "servers": { > "stora-docs": { > "url": "https://docs.stora.co/mcp" > } > } > } > ``` Once connected, your AI assistant can answer questions about the Stora API using the latest documentation rather than potentially outdated training data. ## OpenAPI specification The full OpenAPI 3.1 specification is available in JSON format at: ``` https://docs.stora.co/2025-09/openapi.json ``` Most AI coding assistants and agent frameworks can consume this spec directly. Point your agent to the URL above and provide it with an access token. ## llms.txt These docs automatically generate and maintain [`llms.txt`](/llms.txt) and [`llms-full.txt`](/llms-full.txt) files at the documentation root. These are an [industry standard](https://llmstxt.org/) that helps AI systems efficiently index and understand documentation — similar to how a sitemap helps search engines. ## Tips for AI integration > [!NOTE] > > These tips apply whether you're using the MCP server, feeding the OpenAPI spec to an agent, or working with an AI assistant that has access to these docs. * **Start with read-only scopes.** When experimenting, limit the access token to `read` scopes to prevent unintended modifications. * **Use idempotency keys for writes.** When the agent sends a `POST` request, such as creating a resource, include an `Idempotency-Key` header to avoid duplicate operations on retries. `PATCH` and `DELETE` requests ignore it. * **Respect rate limits.** AI agents can generate bursts of requests. Implement backoff when receiving `429` responses. # Distributing a public plugin Source: https://docs.stora.co/2025-09/guides/distributing-public-plugins Connect operators to Stora from distributed code you don't host (WordPress plugins, browser extensions, on-premise packages). If you're distributing an integration to many operators through code that runs outside infrastructure you control — for example a WordPress plugin, browser extension, client-side app extension, or packaged on-premise tool — you cannot embed OAuth 2.0 client credentials in that distributed code. This guide compares two patterns: the recommended **broker** pattern, and a lighter **authorization proxy** alternative for cases where you accept that Stora tokens will live in each plugin installation. ## Choose an option **Use the broker pattern when:** * Your integration is installed by each operator on infrastructure you don't control (their WordPress site, browser, server, or laptop). * You need access to operator data beyond simple read-only, public information. * You want a single place to rotate credentials, revoke individual installations, and monitor usage. **Use the authorization proxy alternative only when:** * You need to keep the Stora `client_secret` out of distributed plugin code, but you cannot operate a full broker that stores tokens and proxies every API call. * Your plugin can protect Stora access and refresh tokens on each operator's infrastructure. * You accept weaker revocation, observability, and compromise isolation than the broker pattern provides. **You don't need this pattern** if your integration runs on infrastructure you control and operators authorise it directly — that's a standard [Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code). | Pattern | Stores Stora `client_secret` | Stores Stora access and refresh tokens | Responsible for token security | | - | - | - | - | | Broker | Your broker | Your broker | Your backend infrastructure | | Authorization proxy | Your proxy | Each plugin installation | Your plugin and the operator's infrastructure | > [!NOTE] > > A hosted Shopify app usually uses the standard Authorization Code flow because the app backend is operated by the app developer and can act as the confidential OAuth client. Do not put Stora credentials or tokens in Shopify theme code, app extensions, or other client-side/distributed code. Route those calls through a backend you host. ## Option 1: Broker pattern (recommended) The broker pattern is the preferred option for public plugins. It keeps Stora tokens and OAuth credentials on infrastructure you control, and gives you one place to revoke installations, monitor usage, and handle refresh-token rotation. ### Architecture The broker pattern splits responsibility across three actors. Your distributed integration code runs inside an environment you don't control — it holds no Stora credentials. Your broker is a backend service you host — it holds your Stora `client_id` and `client_secret`, stores each operator's access and refresh tokens, and is the only thing Stora sees on the other end of OAuth. Stora issues exactly one confidential OAuth application to you, regardless of how many installations of your integration exist. ### Connection flow at a glance ```mermaid theme={null} sequenceDiagram participant User as Operator
(browser) participant Plugin as Plugin
(operator's site) participant Broker as Your broker
(backend you host) participant Stora as Stora OAuth User->>Plugin: Clicks "Connect to Stora" Plugin->>Plugin: Authorise operator, store connection attempt in session Plugin->>Broker: POST /connection-attempts (installation authentication) Broker-->>Plugin: Short-lived, single-use connect_code Plugin-->>User: 302 to broker /connect?connect_code=… User->>Broker: GET /connect?connect_code=… Broker->>Broker: Consume connect_code, mint session-bound state Broker-->>User: 302 → Stora /oauth2/authorize User->>Stora: Log in, approve scopes Stora-->>User: 302 → broker /callback?code=…&state=… User->>Broker: GET /callback?code=…&state=… Broker->>Broker: Validate and consume state Broker->>Stora: POST /oauth2/token (with client_secret) Stora-->>Broker: access_token + refresh_token Broker->>Broker: Store tokens keyed by install_id Broker-->>User: 302 to registered plugin callback with completion_code User->>Plugin: GET callback?completion_code=… Plugin->>Plugin: Verify initiating operator session Plugin->>Broker: POST /connection-completions (code + installation authentication) Broker->>Broker: Validate and consume completion_code Broker-->>Plugin: broker_token (server-to-server response) ``` ### API call flow at a glance ```mermaid theme={null} sequenceDiagram participant Plugin as Plugin participant Broker as Your broker participant Stora as Stora API Plugin->>Broker: GET /api/orders
Authorization: Bearer <broker_token> Broker->>Broker: Look up Stora tokens for install
Refresh if expired Broker->>Stora: GET /2025-09/orders
Authorization: Bearer <stora_token> Stora-->>Broker: 200 OK (JSON) Broker-->>Plugin: 200 OK (JSON) ``` > [!TIP] > > Stora sees one client (your broker), one redirect URI, one pair of credentials. Operators see your plugin. This is what makes the pattern safe to distribute publicly — the credentials that prove identity to Stora never leave your servers. ### Why the broker doesn't hand Stora tokens to the plugin It's tempting to skip the broker's own token layer and just forward Stora's `access_token` and `refresh_token` to the plugin. Doing so re-creates the problems the broker exists to avoid: * **Refresh-token theft persists.** Stora's refresh tokens are long-lived bearer credentials. Once exfiltrated from a plugin's database or backup, they work until revoked. * **Revocation requires reconnection.** Without a broker-issued token, stopping an installation requires revoking its Stora access and refresh token pair. That installation must reconnect. Other installations are affected only if they share the same pair. * **You lose scope narrowing.** Broker-issued tokens can be narrower than the upstream OAuth grant. Raw Stora tokens cannot. * **You lose observability.** Direct plugin → Stora calls bypass your broker's logs, metrics, and rate limiting. * **Refresh rotation gets messy.** Stora rotates refresh tokens on every use; with plugin-held tokens, every rotation has to be pushed back to each installation. * **The `client_secret` is irrelevant after exfiltration.** Attackers use stolen tokens directly — they don't need to mint new ones. If you decide to hand Stora tokens to the plugin anyway, use the [authorization proxy alternative](#option-2-authorization-proxy-lighter-alternative) below rather than putting your `client_secret` in the plugin. Encrypt tokens at rest. Review the limitations in [Alternatives considered](#alternatives-considered). Encryption at rest protects against database dumps, but not against remote code execution or a malicious sibling plugin. ### Connecting an operator Before you can make API calls on behalf of an operator, the operator's installation needs to go through the Authorization Code flow once. All three of `client_id`, `client_secret`, and the `redirect_uri` belong to your broker — the plugin never sees them. The flow below shows what your broker implements. > [!NOTE] > > Create a test partner application in the Developer Portal and configure its redirect URI to point at your broker, for example `https://broker.yourcompany.com/stora/callback`. Copy the client ID and reveal the client secret once, then store them on your broker. After approval, use the separate live application's credentials for production. See [Partner app credentials](/2025-09/guides/partner-integrations#partner-app-credentials) for the test and live setup. **1. Plugin starts the connection** The operator clicks **Connect to Stora** in your plugin's UI. Verify that the operator is authorised to connect this installation and protect this action against CSRF. Store a connection-attempt identifier in the operator's session. From the plugin's backend, create a connection attempt through an authenticated HTTPS request to your broker. Use the [installation authentication](#plugin-to-broker-authentication) you established during registration. Keep reusable credentials in request headers, not browser URLs. Bind the attempt to the installation, the session's connection-attempt identifier, and a previously registered plugin callback URL. The broker returns an unpredictable, short-lived, single-use `connect_code`. Redirect the browser to: ```text theme={null} GET https://broker.yourcompany.com/stora/connect?connect_code=CONNECT_CODE ``` The code identifies this connection attempt only. It is not an installation credential or an API token. Exclude connection codes from logs and use a restrictive referrer policy on callback pages. **2. Broker redirects to Stora** The broker validates and atomically consumes the `connect_code`. Reject missing, expired, or reused codes. Create a fresh `state` value and bind it to the broker's browser session and the stored connection attempt, including its installation and registered callback URL. Store it with a short expiry, then redirect the operator's browser to Stora: ``` HTTP/1.1 302 Found Location: https://app.stora.co/oauth2/authorize ?client_id=YOUR_CLIENT_ID &redirect_uri=https://broker.yourcompany.com/stora/callback &response_type=code &scope=public.contact:read public.order:read &state= ``` The `state` parameter is not optional for a broker: it prevents CSRF on the callback and lets you correlate the returning code with the right installation. Bind it to the initiating browser session as described in the [Authorization Code walkthrough](/2025-09/guides/authentication#step-1-redirect-the-user-to-authorise). **3. Operator approves in Stora** The operator logs in to their Stora BackOffice (if not already) and approves the requested scopes. Stora redirects back to your broker's callback with a one-time code: ``` GET https://broker.yourcompany.com/stora/callback ?code=AUTHORIZATION_CODE &state= ``` **4. Broker exchanges the code for tokens** [Validate and consume the state](/2025-09/guides/authentication#step-2-validate-the-callback) before exchanging the code. Recover the `install_id` associated with the validated state. Then exchange the code at Stora's token endpoint, authenticating with your `client_secret`: ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=authorization_code" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "code=AUTHORIZATION_CODE" \ -d "redirect_uri=https://broker.yourcompany.com/stora/callback" ``` Response: ```json theme={null} { "access_token": "ACCESS_TOKEN", "token_type": "Bearer", "expires_in": 7200, "scope": "public.contact:read public.order:read", "created_at": 1710000000, "refresh_token": "REFRESH_TOKEN" } ``` **5. Broker stores tokens and returns to the plugin** Store the `access_token`, `refresh_token`, and `expires_at` in your broker's database, keyed by `install_id`. Generate an unpredictable, short-lived, single-use `completion_code` bound to the installation and the original connection attempt. Redirect to the plugin callback registered for that attempt: ```text theme={null} HTTP/1.1 302 Found Location: https://shop.example.com/wp-admin/admin.php?page=your-plugin&completion_code=COMPLETION_CODE ``` Do not include a broker token, installation secret, or Stora token in this URL. Do not accept an arbitrary callback URL from the browser. **6. Plugin exchanges the completion code** Verify that the callback belongs to the operator session that started the connection. From the plugin's backend, send the `completion_code` and the stored connection-attempt identifier to the broker in an authenticated HTTPS request. The broker verifies the installation authentication, code expiry, and binding to the installation and connection attempt. Reject missing, expired, mismatched, or reused codes. Atomically consume the code before returning a broker-scoped token in the server-to-server response. Store the broker token on the plugin's backend. It authenticates subsequent API calls to your broker. Stora's access and refresh tokens remain on your broker. Clear the pending connection attempt and redirect the browser to a success page without the completion code in its URL. > [!TIP] > > The `redirect_uri` Stora sees on every connection is always `https://broker.yourcompany.com/stora/callback` — one URL, regardless of how many operator installations exist. That's the property that makes this pattern safe to distribute publicly. ### Making API calls Once connected, the plugin makes requests to your broker, the broker translates them into Stora API calls using the stored `access_token`, and returns the response to the plugin. The broker is responsible for refreshing expired tokens silently and for surfacing a "reconnect required" signal when refresh fails. #### The happy path The plugin calls your broker. Authenticate the plugin with the broker-scoped token you issued during the connect flow: ```bash theme={null} curl -X GET "https://broker.yourcompany.com/stora/orders" \ -H "authorization: Bearer BROKER_TOKEN" ``` The broker looks up the installation, checks the stored `expires_at`, refreshes if needed (see below), and proxies the request to Stora: ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/orders" \ -H "authorization: Bearer STORA_ACCESS_TOKEN" ``` Return the response to the plugin as-is, or reshape it to match your plugin's data model — your choice. #### Refreshing tokens Stora access tokens expire after 2 hours. When the stored `expires_at` is within a small buffer of now (e.g. 5 minutes), refresh before making the call: ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/x-www-form-urlencoded" \ -d "grant_type=refresh_token" \ -d "client_id=YOUR_CLIENT_ID" \ -d "client_secret=YOUR_CLIENT_SECRET" \ -d "refresh_token=STORA_REFRESH_TOKEN" ``` The response contains a new `access_token` **and** a new `refresh_token`. The previous refresh token is revoked immediately. Your broker must atomically update both values, or the next refresh will fail. > [!WARNING] > > Refresh-token rotation is not optional on Stora's side — every successful refresh invalidates the previous refresh token. If your broker loses track of the latest `refresh_token` (crash between HTTP response and DB write, race between two parallel refresh attempts for the same installation), the installation cannot refresh its Stora access tokens until the operator reconnects. Serialise refresh attempts per installation and write the new token before returning the new access token to callers. #### When refresh fails A `400` from the Stora token endpoint with `"error": "invalid_grant"` means the grant is no longer valid — usually because the operator disconnected your integration in Stora BackOffice. You cannot recover this without the operator going through the connect flow again. The broker should: mark the installation's tokens as revoked locally, return a well-defined error to the plugin (e.g. `401 Unauthorized` with a body like `{"error":"stora_reconnect_required"}`), and let the plugin prompt the operator to reconnect. #### Rate limits Stora applies rate limits per operator (10 req/s, 60 req/min — see [rate limiting](/2025-09/guides/requests#rate-limiting)). Your broker adds no rate-limit protection by default; a `429` from Stora propagates back to the plugin. Consider short request coalescing (same plugin, same endpoint, same operator, within the same second) if your plugin is chatty. ### Disconnecting and reconnecting Operators need to offboard cleanly, re-grant access after revocation, and occasionally switch which Stora account they've connected — without uninstalling the plugin. Your plugin's settings UI must expose Disconnect and Reconnect actions, and the broker must back them with the logic below. #### Disconnect The plugin's settings UI exposes a Disconnect button. When the operator clicks it, the plugin calls a disconnect endpoint on your broker — authenticated with the broker token — and your broker: 1. Calls Stora's `POST /oauth2/revoke` with the stored access token and your OAuth client credentials. 2. Deletes the stored Stora tokens and the broker token for this installation. 3. Returns `204 No Content` to the plugin. ```bash theme={null} curl -X POST "https://public-api.stora.co/oauth2/revoke" \ -H "content-type: application/json" \ -d '{ "token": "STORA_ACCESS_TOKEN", "grant_type": "client_credentials", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET" }' ``` Stora stores the access token and refresh token on the same OAuth record, so revoking either string revokes the pair — one call is enough. > [!TIP] > > Broker routes such as `/stora/connect`, `/stora/callback`, and `/stora/disconnect` are illustrative throughout this guide. Your broker can expose whatever URLs you prefer; only the upstream Stora calls (`/oauth2/authorize`, `/oauth2/token`, `/oauth2/revoke`) are fixed. #### Reconnect The plugin's settings UI also exposes a Reconnect button, which redirects the operator back through your existing connect entry point. The broker overwrites the installation's stored tokens on the next successful callback — no new endpoint required. Expose Reconnect even while the current tokens are still valid. Operators use it to re-grant expanded scopes when your integration adds a new feature, or to switch to a different Stora account without a reinstall. #### On plugin uninstall The integration should fire the same disconnect flow automatically when the operator removes it from their host, using whatever uninstall or deprovisioning hook the platform exposes — for example WordPress's `register_uninstall_hook`, or Shopify's `app/uninstalled` webhook for hosted Shopify apps. Treat uninstall hooks as a hygiene layer, not a replacement for the explicit Disconnect action. Some platforms don't fire them reliably: a user who deletes a WordPress site wholesale never triggers plugin uninstall hooks, and webhook delivery can fail on any hosted platform. The explicit Disconnect action plus Stora-side revocation remains the source of truth. ### What your broker is responsible for The broker is a piece of infrastructure you own and operate. At minimum, plan for the following. #### Plugin-to-broker authentication Stora authenticates your broker via `client_secret`. Your broker needs its own way to authenticate plugin installations. A common pattern: the plugin generates a long random value at activation time, registers it with the broker (HTTPS call keyed by install URL + admin email), and uses it as a bearer token on subsequent calls. Bind each token to one installation so a token stolen from one site can't be used to impersonate another. HMAC-signing requests with a per-install secret is a stronger alternative. #### Token storage and rotation Store `access_token`, `refresh_token`, and `expires_at` per installation. Refresh tokens rotate on every use — the previous one is revoked the instant Stora returns a new one. Write the new `refresh_token` to your database *before* you return the response to whoever triggered the refresh, and serialise refresh attempts per installation so two parallel workers can't race. Encrypt tokens at rest; the column on your broker's database is as sensitive as your Stora `client_secret`. #### Per-installation kill switch Because the broker mints its own plugin-facing tokens, you can cut off a single installation without touching Stora: invalidate the broker token locally and the plugin starts receiving your reconnect error on every call. This is the fastest response to a compromised installation — no Stora support ticket, no scope re-negotiation, no impact on other installations. #### Monitoring and abuse detection Log every call that passes through the broker with `install_id`, endpoint, and status code. Basic alerts to set up: sustained `429` rates per installation (indicates a runaway plugin), sustained `4xx` rates (indicates a broken installation or probing), sudden growth in call volume from a single installation, and anything that looks like credential-stuffing against your own `/connect` endpoint. Ship these to whatever you already use — you don't need anything Stora-specific. #### Disconnect and reconnect endpoints Expose routes the plugin can call to trigger [Disconnect](#disconnect) (broker revokes tokens at Stora and wipes local state) and [Reconnect](#reconnect) (broker redirects back through the connect flow). Wire the same revoke-and-discard path into the plugin's platform-specific uninstall hook as best-effort hygiene. > [!TIP] > > Operators never see your broker. To them, your plugin is the integration and Stora is the data source. Everything about the broker — its URL, its storage, its uptime — is your private implementation detail. ## Option 2: Authorization proxy (lighter alternative) The authorization proxy is a lighter alternative to the broker pattern. It keeps your Stora `client_secret` on infrastructure you control, but it does **not** keep Stora tokens out of the plugin. The plugin installation — for example a WordPress site — stores the operator's Stora `access_token` and `refresh_token`, and calls the proxy whenever it needs to exchange an authorization code or refresh a token. > [!WARNING] > > Prefer the broker pattern for production integrations that handle customer > PII, payments, contracts, access control, or other sensitive data. The > authorization proxy reduces deployment complexity, but every plugin > installation becomes part of your token trust boundary. You are responsible > for protecting those tokens on the operator's infrastructure. WordPress > environments vary widely, and tokens can be exposed through database dumps, > backups, compromised admin accounts, vulnerable plugins, or server-level > access. The authorization proxy protects your Stora `client_secret`, but it > does not protect operator tokens after they are issued. If a refresh token is > leaked, an attacker can mint access tokens until the grant is revoked, or > until refresh-token rotation invalidates the stolen token before the attacker > uses it. Choose the broker pattern if you do not want plugin installations to > hold Stora tokens. ### How the authorization proxy works The plugin backend first verifies that the operator can connect this installation and protects the connect action against CSRF. Create a single-use `wp_state` value and store it in the operator's plugin session. Through an authenticated HTTPS request, register a connection attempt with the proxy. Bind it to the installation, `wp_state`, and a registered HTTPS callback URL. The proxy returns a short-lived, single-use `connect_code` for the browser redirect. Never send installation credentials in browser URLs. When the browser presents `connect_code`, the proxy validates and atomically consumes it. Create an unpredictable OAuth `state` value bound to the proxy's initiating browser session and the stored connection attempt. Store it with a short expiry, then redirect to Stora. A signed value alone does not establish this browser-session binding. On callback, [validate and atomically consume OAuth state](/2025-09/guides/authentication#step-2-validate-the-callback) before issuing `code_context` or forwarding the authorization code. Reject missing, mismatched, expired, or reused state. Create a signed, short-lived `code_context` bound to the authorization code and connection attempt. Redirect only to the registered plugin callback, including the code, `code_context`, and the original `wp_state`. Exclude these values from logs and use a restrictive referrer policy on callback pages. The plugin validates and consumes `wp_state` against its initiating operator session before requesting tokens. Reject callbacks that do not match that session. The plugin then calls the proxy server-to-server to exchange the code for Stora access and refresh tokens. The server-to-server call must authenticate the plugin installation, for example with an `Authorization` header or HMAC signature. The plugin stores the returned tokens locally, but never calls Stora's token endpoint directly. When the access token expires, the plugin sends the stored refresh token to the proxy; the proxy authenticates to Stora with the partner `client_secret`, performs the refresh, and returns the rotated tokens for the plugin to replace locally. The `code_context` is not a replacement for the Stora authorization code or session-bound state. It binds the code to the stored connection attempt, plugin installation, and callback URL. The proxy retains short-lived connection and replay-prevention records, but does not store the plugin's Stora tokens between requests. You can implement `code_context` as a signed JWT/JWS or any equivalent authenticated token format. The payload should include the authorization code hash, connection-attempt identifier, installation identifier, callback URL, and short expiry. Sign it with a proxy-only secret. Do not put the Stora `client_secret` or access/refresh tokens in `code_context`. ```json theme={null} { "code_hash": "sha256:BASE64URL_SHA256_OF_AUTHORIZATION_CODE", "connection_id": "CONNECTION_ATTEMPT_ID", "install_id": "demo-self-storage.example.com", "callback_url": "https://demo-self-storage.example.com/wp-admin/admin.php?page=your-plugin", "expires_at": 1710000300 } ``` When `/token` is called, authenticate the installation. Verify the `code_context` signature and expiry, then match its `connection_id`, `install_id`, callback URL, and code hash against the stored attempt. Atomically mark the token-exchange attempt as consumed before exchanging the code with Stora. Reject expired, mismatched, or reused attempts. The diagram below uses WordPress as the example plugin host. ```mermaid theme={null} sequenceDiagram autonumber actor Operator as Operator participant Browser as Operator browser participant WP as WordPress site
public plugin participant Proxy as Authorization proxy participant StoraAuth as Stora OAuth authorize participant StoraToken as Stora OAuth token Operator->>WP: Click "Connect to Stora" WP->>WP: Authorise operator and store wp_state in session WP->>Proxy: Authenticated POST /connection-attempts
install_id, registered callback, wp_state Proxy-->>WP: Short-lived, single-use connect_code WP-->>Browser: Redirect to proxy /connect?connect_code=… Browser->>Proxy: GET /connect?connect_code=… Proxy->>Proxy: Validate and consume connect_code
Create stora_state bound to proxy browser session
and stored connection attempt Proxy-->>Browser: 302 to Stora /oauth2/authorize
client_id, redirect_uri=proxy callback,
response_type=code, scope, state=stora_state Browser->>StoraAuth: Open authorization page Operator->>StoraAuth: Log in and approve scopes StoraAuth-->>Browser: 302 to proxy callback
code=AUTHORIZATION_CODE, state=stora_state Browser->>Proxy: GET /stora/callback?code&state Proxy->>Proxy: Validate session binding and expiry
Atomically consume stora_state
Create signed code_context bound to attempt and code Proxy-->>Browser: 302 to WordPress callback
code=AUTHORIZATION_CODE,
code_context=SIGNED_CONTEXT,
state=wp_state Browser->>WP: GET /wp-admin/...your-plugin?code&code_context&state WP->>WP: Validate and consume session-bound wp_state WP->>Proxy: POST /token
code, code_context, install_id
Authorization: Bearer plugin_secret
or HMAC signature Proxy->>Proxy: Authenticate plugin and verify code_context
Match stored attempt, code, and installation
Atomically consume token-exchange attempt Proxy->>StoraToken: POST /oauth2/token
grant_type=authorization_code,
client_id, client_secret,
code=AUTHORIZATION_CODE,
redirect_uri=proxy callback StoraToken-->>Proxy: access_token, refresh_token, expires_in Proxy-->>WP: access_token, refresh_token, expires_in WP->>WP: Store tokens securely for this site WP-->>Operator: Show connected state Note over WP,Proxy: The client_secret stays only in the proxy.
WordPress receives the Stora authorization code, but never receives the client_secret. Note over WP: WordPress stores Stora access and refresh tokens for this site. Note over Proxy: Retain short-lived session binding and replay-prevention records.
Signing state does not replace these checks. Note over WP,StoraToken: WordPress never calls Stora's token endpoint directly.
Code exchanges and refreshes go through the proxy because Stora requires the partner client_secret. rect rgb(245, 248, 255) WP->>Proxy: Later: POST /refresh
refresh_token, install_id
Authorization: Bearer plugin_secret
or HMAC signature Proxy->>Proxy: Validate plugin authentication
Read client_secret from proxy secrets Proxy->>StoraToken: POST /oauth2/token
grant_type=refresh_token,
client_id, client_secret, refresh_token StoraToken-->>Proxy: new access_token, new refresh_token Proxy-->>WP: new access_token, new refresh_token, expires_in WP->>WP: Replace stored tokens with rotated tokens end ``` ### Authorization proxy trade-offs Compared with the broker pattern, the authorization proxy removes the need to store per-installation Stora tokens on your backend. You still need short-lived connection records, browser-session binding, and single-use validation. Signed `state` and `code_context` values do not remove those requirements. The trade-off is that Stora tokens now live in the plugin installation. A compromised WordPress database, backup, admin account, server, or sibling plugin can expose the operator's Stora tokens. You also lose the broker's per-installation kill switch, API-level observability, rate limiting, and scope narrowing. Use this pattern only when that risk is acceptable, and document the token-storage responsibility clearly for operators. ## Alternatives considered You don't need to read this section to build the integration. It exists for partners who want to understand why we recommend the broker pattern over the alternatives the OAuth 2.0 spec technically allows. > [accordion] Why not a public client with PKCE? > > PKCE protects authorisation codes from interception during the redirect. It does not protect OAuth tokens after they're issued. For a plugin distributed to many operators, the consequences are: > > * **Tokens live on the operator's infrastructure.** `wp_options` is plaintext; other sensitive values in the same table get exfiltrated together in DB dumps, backups copied to staging, and compromised-plugin incidents. > * **No client authentication.** A public `client_id` can be copied into any application. PKCE binds a code to a device but proves nothing about *who* the client is. A phishing app reusing your `client_id` presents the real Stora consent screen with your branding. > * **Refresh tokens are long-lived bearer credentials.** Once out of the operator's database they work until revoked. Rotation shrinks the window; it doesn't close it. > * **Loose redirect URIs.** Thousands of installations mean either wildcard redirect URIs (vulnerable to subdomain takeover) or Dynamic Client Registration (see below). > * **No abuse isolation.** Revoking the public `client_id` breaks every installation simultaneously. > * **No consent phishing protection.** An attacker can complete the flow with your `client_id` since there's no secret to prove identity. > > Public clients plus PKCE are designed for **single-user applications on a user's own device** (RFC 8252 — native mobile and desktop apps). They are not designed for server-resident multi-tenant integrations where every installation stores its own long-lived tokens on infrastructure you don't control. Hosted marketplace apps with developer-operated backends are different: the backend can keep credentials and tokens server-side, which is the same security boundary the broker pattern creates. > [accordion] Dynamic Client Registration (RFC 7591) > > DCR would let each plugin installation register its own `client_id` (still public, still PKCE) at install time. Each site then has its own OAuth client record on Stora's side, which solves the redirect-URI and abuse-isolation problems. > > Stora does not currently support Dynamic Client Registration. If you have a use case that specifically requires it, [get in touch](https://stora.co/contact) — we prioritise based on partner demand. DCR alone doesn't solve the token-storage problem (tokens still live in `wp_options`); it mainly simplifies the consent and redirect-URI side of operating many public-client installations. > [accordion] If you insist on sharing Stora tokens with the plugin > > We understand the broker pattern adds operational overhead. If you decide to let the plugin store Stora access and refresh tokens, use the [authorization proxy](#option-2-authorization-proxy-lighter-alternative) shape above. Do **not** put the Stora `client_secret` in the plugin, and do **not** have the plugin call Stora's token endpoint directly. The plugin should receive the authorization code in its callback, then call your proxy to exchange the code or refresh token. Your proxy authenticates to Stora with the `client_secret` and returns the resulting tokens to the plugin. > > At minimum, do the following: > > * **Keep the `client_secret` proxy-side.** The proxy exists to protect the confidential OAuth client credentials. The plugin should only ever see the authorization code, `code_context`, access token, refresh token, expiry, and the plugin-to-proxy credential you design. > * **Bind OAuth state to the initiating browser session.** Register the connection attempt through an authenticated plugin-backend request. Use a registered HTTPS callback URL. Validate and atomically consume session-bound OAuth state before forwarding the authorization code. Validate and consume the plugin's session-bound `wp_state` before requesting tokens. A signature alone is not sufficient. > * **Validate `code_context` and prevent replay.** Bind the signed, expiring context to the authorization code hash, connection attempt, installation, and callback URL. Authenticate the installation and atomically consume the token-exchange attempt before calling Stora. Reject expired, tampered, mismatched, or reused values. > * **Authenticate plugin-to-proxy calls.** The `/token` and `/refresh` endpoints still need plugin authentication, such as an `Authorization` header with an install-time shared secret or HMAC-signed requests. Do not pass that secret through browser redirects or query strings. Otherwise anyone with a code or refresh token can ask your proxy to use your `client_secret` for them. > * **Encrypt tokens at rest.** WordPress core stores `wp_options` values as plaintext. Google Site Kit's [`Data_Encryption`](https://github.com/google/site-kit-wp/blob/main/includes/Core/Storage/Data_Encryption.php) is the de-facto reference implementation — AES-256-CTR with a key derived from `LOGGED_IN_KEY` in `wp-config.php`. Most major plugins (Jetpack, WooCommerce Stripe, Mailchimp for WooCommerce) don't encrypt at all; doing so puts you ahead of the ecosystem default. > * **Understand what encryption buys you.** It only mitigates stolen SQL backups, misconfigured phpMyAdmin, read-only DB leaks, and compromised noisy neighbours on shared MySQL. It does **not** mitigate a compromised WordPress admin, an RCE on the host, a malicious sibling plugin, or a `wp-config.php` leak — in all those cases the key is on the same box. > * **Narrow your scopes aggressively.** Request only what the plugin genuinely needs. Every scope you request is a scope an attacker inherits. > * **Rotate refresh tokens through the proxy and persist the replacement.** Stora rotates refresh tokens on every successful refresh. The plugin must send the current refresh token to the proxy, the proxy must refresh with the `client_secret`, and the plugin must atomically replace both the access token and refresh token it has stored. > * **Revoke the installation's Stora token pair to stop access.** Without a broker-issued token layer, disabling the plugin's proxy credential alone does not invalidate Stora tokens it already holds. Revoke its access and refresh token pair. Other installations are affected only if they share that pair. > > Even with all of the above, the integration's security posture is bounded by the weakest plugin installation running it. The authorization proxy protects your `client_secret`; it does not remove the plugin host from the Stora token trust boundary. The broker pattern does, which is why we recommend it for anything touching customer PII, payments, contracts, access control, or other sensitive data. ## Next steps You now have the OAuth side built. Before going live, also review: > [card] [Partner approval checklist](/2025-09/guides/partner-approval-checklist) > > Review OAuth, scopes, Timeline Events, webhooks, disconnect behavior, and public plugin requirements before you submit. > [card] [Rate limiting and backoff](/2025-09/guides/requests#rate-limiting) > > Per-operator limits apply. Your broker or plugin must handle 429s, depending > on the pattern. > [card] [Webhooks](/2025-09/guides/webhooks) > > React to Stora events instead of polling. Your broker or proxy receives them > on a single URL. > [card] [Authentication reference](/2025-09/guides/authentication) > > Full details on OAuth flows, token exchange, and token refresh. Questions about any of the above, or an integration pattern that doesn't fit these options? [Contact us](https://stora.co/contact) before you start building — it's cheaper than rebuilding. # Errors Source: https://docs.stora.co/2025-09/guides/errors Error response format, error codes, and how to handle them in the Stora Public API. When a request fails, the API responds with a `4xx` or `5xx` status code and an error object. Use the error's `code` to decide what your integration does next. ## Response format Every error response has the same shape: ```json theme={null} { "error": { "code": "invalid_content", "details": [ { "message": "value at `/email` does not match format: email", "pointer": "/email" } ], "links": [ { "kind": "api_reference", "name": "Create a Contact", "url": "https://docs.stora.co/2025-09/api-reference/contacts/create-a-contact" }, { "kind": "open_api", "name": "OpenAPI specification", "url": "https://docs.stora.co/2025-09/openapi.json" }, { "kind": "documentation", "name": "Errors", "url": "https://docs.stora.co/2025-09/guides/errors#invalid_content" } ], "message": "The request body content is not valid.", "request_id": "01563646-58c1-4607-8fe0-cae3e92c4477", "type": "invalid_request_error" } } ``` | Field | Description | | - | - | | `code` | A short code for the error, such as `invalid_content`. Each code is listed below. | | `message` | A human-readable summary of the error. | | `type` | `invalid_request_error` when the request needs to change, or `api_error` when the problem is on Stora's side or with a service Stora depends on. | | `details` | Specific problems with the request. Empty when there are none. | | `details[].message` | A human-readable description of one problem. | | `details[].pointer` | Where the problem is. A value starting with `/`, such as `/email`, is the exact field. A value without `/` is a hint, such as an attribute name. `null` means the problem isn't tied to a field. | | `links` | Pages that help you fix the error. They always include the OpenAPI specification and this page's section for the code. They can also include the API reference page of the endpoint, the guide for its feature, and a guide for the code. | | `request_id` | A unique ID for the request. Include it when you contact support. | ## Handling errors * **Branch on `code`, not `message`.** Codes are part of the API contract, and changes to them appear in the [changelog](/2025-09/guides/changelog). Messages can change at any time. * **Show `message` to people.** It explains the error in plain language. * **Retry only codes marked as retryable.** Wait before each retry, and increase the wait each time. For `too_many_requests`, wait until the time in the `RateLimit-Reset` header. * **Send the same `Idempotency-Key` when you retry a `POST`.** The API stores only successful responses, so a retry after an error is processed again, and a retry after a success returns the stored response. See [idempotent requests](/2025-09/guides/requests#idempotent-requests). * **Fix the request before you send it again** for codes that aren't retryable. Sending the same request again returns the same error. ## Errors any endpoint can return For more on these errors, see [authentication](/2025-09/guides/authentication) for `invalid_token`, [authorization scopes](/2025-09/guides/authorization) for `forbidden`, and [rate limiting](/2025-09/guides/requests#rate-limiting) for `too_many_requests`. ### `invalid_request` The request is malformed or is missing a required parameter. Check the request against the endpoint's reference, fix it, and send it again. **HTTP status:** `400` · **Type:** `invalid_request_error` · **Retryable:** no ### `invalid_token` The access token is missing, invalid, expired or revoked. Send a valid token in the `Authorization: Bearer ` header. Request a new token if it has expired. **HTTP status:** `401` · **Type:** `invalid_request_error` · **Retryable:** no ### `forbidden` Your access token doesn't have a scope that the endpoint requires. Check the scopes listed in the endpoint's description, and use a token that has them. **HTTP status:** `403` · **Type:** `invalid_request_error` · **Retryable:** no ### `invalid_endpoint` The endpoint doesn't exist, or the API version in the path isn't supported. Check the HTTP method, the path and the API version, such as `/2025-09/contacts`. **HTTP status:** `404` · **Type:** `invalid_request_error` · **Retryable:** no ### `invalid_format` The `Accept` header asks for a format that the endpoint can't return, or the requested PDF isn't available, such as for a contract that isn't signed. Send `Accept: application/json`, `Accept: text/csv`, or `Accept: application/pdf` for endpoints that return PDF documents. If the PDF isn't available, request the resource as JSON. **HTTP status:** `406` · **Type:** `invalid_request_error` · **Retryable:** no ### `idempotency_conflict` Another request with the same `Idempotency-Key` is still being processed. Wait for the first request to finish, then retry with the same `Idempotency-Key`. If the first request succeeded, the retry returns its stored response. If it failed, the retry processes the request again. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** yes ### `too_many_requests` The operator has exceeded its rate limit. Wait until the time in the `RateLimit-Reset` header, then send the request again. **HTTP status:** `429` · **Type:** `invalid_request_error` · **Retryable:** yes ### `internal_server_error` An unexpected error happened in Stora. Retry the request later. If it keeps failing, contact support with the `request_id`. **HTTP status:** `500` · **Type:** `api_error` · **Retryable:** yes ## Error codes These codes depend on the endpoint. Each one lists the endpoints that return it. ### 404 Not Found #### `resource_not_found` The resource doesn't exist, or it belongs to another operator. Check the ID, and that the resource belongs to the operator your access token is for. **HTTP status:** `404` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Archive an Opportunity](/2025-09/api-reference/opportunities/archive-an-opportunity) * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) * [Complete a Task](/2025-09/api-reference/tasks/complete-a-task) * [Create a Deal](/2025-09/api-reference/deals/create-a-deal) * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) * [Create an Opportunity](/2025-09/api-reference/opportunities/create-an-opportunity) * [Deallocate a Unit](/2025-09/api-reference/units/deallocate-a-unit) * [Delete a Contact](/2025-09/api-reference/contacts/delete-a-contact) * [Delete a Deal](/2025-09/api-reference/deals/delete-a-deal) * [Delete a Line Item](/2025-09/api-reference/orders-line-items/delete-a-line-item) * [Delete a Note](/2025-09/api-reference/notes/delete-a-note) * [Delete a Task](/2025-09/api-reference/tasks/delete-a-task) * [Delete a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/delete-a-webhook-endpoint) * [Delete an Opportunity](/2025-09/api-reference/opportunities/delete-an-opportunity) * [Delete an Order](/2025-09/api-reference/orders/delete-an-order) * [Disable a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/disable-a-webhook-endpoint) * [Disassociate an Opportunity from its Deal](/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal) * [Enable a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/enable-a-webhook-endpoint) * [List all Line Items](/2025-09/api-reference/orders-line-items/list-all-line-items) * [Lose a Deal](/2025-09/api-reference/deals/lose-a-deal) * [Open a Task](/2025-09/api-reference/tasks/open-a-task) * [Overlock Units by Contact](/2025-09/api-reference/units/overlock-units-by-contact) * [Remove Overlock from Units by Contact](/2025-09/api-reference/units/remove-overlock-from-units-by-contact) * [Reopen a Deal](/2025-09/api-reference/deals/reopen-a-deal) * [Reserve a Unit](/2025-09/api-reference/units/reserve-a-unit) * [Show a Contract](/2025-09/api-reference/contracts/show-a-contract) * [Show a Contract Template](/2025-09/api-reference/contract-templates/show-a-contract-template) * [Show a Credit Note](/2025-09/api-reference/credit-notes/show-a-credit-note) * [Show a Unit Type](/2025-09/api-reference/unit-types/show-a-unit-type) * [Show an Identity Verification](/2025-09/api-reference/identity-verifications/show-an-identity-verification) * [Show an Invoice](/2025-09/api-reference/invoices/show-an-invoice) * [Show an Opportunity](/2025-09/api-reference/opportunities/show-an-opportunity) * [Unarchive an Opportunity](/2025-09/api-reference/opportunities/unarchive-an-opportunity) * [Update a Contact](/2025-09/api-reference/contacts/update-a-contact) * [Update a Deal](/2025-09/api-reference/deals/update-a-deal) * [Update a Line Item](/2025-09/api-reference/orders-line-items/update-a-line-item) * [Update a Note](/2025-09/api-reference/notes/update-a-note) * [Update a Task](/2025-09/api-reference/tasks/update-a-task) * [Update a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/update-a-webhook-endpoint) * [Update an Opportunity](/2025-09/api-reference/opportunities/update-an-opportunity) * [Update an Order](/2025-09/api-reference/orders/update-an-order) * [Win a Deal](/2025-09/api-reference/deals/win-a-deal) ### 409 Conflict #### `adjustment_already_scheduled` The price adjustment has already been scheduled, so it can't be updated or scheduled again. If the price adjustment is still `pending`, delete it and create a new one. Otherwise, it can't be changed. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) #### `adjustment_not_deletable` Only draft, pending or cancelled price adjustments can be deleted. Check the price adjustment's `status` before deleting it. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Delete a Price Adjustment](/2025-09/api-reference/price-adjustments/delete-a-price-adjustment) #### `adjustment_not_editable` A price adjustment can only be updated while it's a draft. Create a new price adjustment instead. Only a draft can be updated. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) #### `adjustment_not_schedulable` A price adjustment can only be scheduled while it's a draft. Create a new draft price adjustment and schedule that one. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) #### `conflict` The resource can't be changed or deleted because of its current state or the records that depend on it. Read `message` for the reason, change the resource's state, and send the request again. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create Base Price for the Protection Level](/2025-09/api-reference/protection-levels/create-base-price-for-the-protection-level) * [Create a Line Item](/2025-09/api-reference/orders-line-items/create-a-line-item) * [Delete a Contact](/2025-09/api-reference/contacts/delete-a-contact) * [Delete a Line Item](/2025-09/api-reference/orders-line-items/delete-a-line-item) * [Update a Line Item](/2025-09/api-reference/orders-line-items/update-a-line-item) #### `draft_expired` The draft price adjustment's adjustment date has passed. Update the draft with a later adjustment date, then schedule it. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) #### `duplicate_price_adjustment` The subscription already has a price adjustment on the same adjustment date. Choose another adjustment date, or delete the existing price adjustment if it's still `pending`. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) #### `no_future_renewal_dates` The subscription has no future renewal dates to apply the price adjustment on. Check that the subscription renews, or choose another subscription. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) #### `opportunity_already_archived` The opportunity is already archived. No action is needed. To make the opportunity active again, unarchive it. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Archive an Opportunity](/2025-09/api-reference/opportunities/archive-an-opportunity) #### `opportunity_associated` The opportunity is associated with a deal, so it can't be deleted, archived, unarchived, converted or associated with another deal. Only its `metadata` can be updated. Work with the associated deal, or remove the association with `DELETE /opportunities/{opportunity_id}/associate_deal` first. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Archive an Opportunity](/2025-09/api-reference/opportunities/archive-an-opportunity) * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) * [Delete an Opportunity](/2025-09/api-reference/opportunities/delete-an-opportunity) * [Unarchive an Opportunity](/2025-09/api-reference/opportunities/unarchive-an-opportunity) * [Update an Opportunity](/2025-09/api-reference/opportunities/update-an-opportunity) #### `opportunity_contact_mismatch` The deal belongs to a different contact than the opportunity. Associate the opportunity with a deal of the same contact. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) #### `opportunity_converted` The opportunity was converted to a deal that has since been deleted, so it can't be converted or associated with a deal again. Create a new opportunity for the contact instead. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) #### `opportunity_not_archived` Only an archived opportunity can be unarchived, and this one isn't archived. No action is needed. The opportunity is already active. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Unarchive an Opportunity](/2025-09/api-reference/opportunities/unarchive-an-opportunity) #### `opportunity_not_associated` The opportunity isn't associated with a deal, so there is no association to remove. No action is needed. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Disassociate an Opportunity from its Deal](/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal) #### `opportunity_not_convertible` The opportunity can't be converted to a deal because its line items don't belong to its site. Update the opportunity so its line items belong to its site, then convert it again. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) #### `same_day_adjustment` A price adjustment can't be scheduled to take effect on the same day. Update the draft with a later adjustment date, then schedule it. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) #### `subscription_has_scheduled_adjustment` The subscription already has a scheduled price adjustment, and a subscription can have only one. Wait until the scheduled price adjustment is applied, or delete it if it's still `pending`. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) #### `subscription_not_eligible` The subscription isn't eligible for price adjustments. Only active subscriptions billed through Stripe that aren't archived or scheduled to end are eligible. Check the subscription's status before creating or scheduling a price adjustment for it. **HTTP status:** `409` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) ### 422 Unprocessable Content #### `invalid_content` The request body doesn't match the endpoint's schema or breaks a validation rule. Read `details` for each invalid field, which `pointer` identifies. Fix the body and send the request again. **HTTP status:** `422` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Abandon an Order](/2025-09/api-reference/orders/abandon-an-order) * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) * [Create Base Price for the Product](/2025-09/api-reference/products/create-base-price-for-the-product) * [Create a Contact](/2025-09/api-reference/contacts/create-a-contact) * [Create a Deal](/2025-09/api-reference/deals/create-a-deal) * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) * [Create a Line Item](/2025-09/api-reference/orders-line-items/create-a-line-item) * [Create a Note](/2025-09/api-reference/notes/create-a-note) * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Create a Task](/2025-09/api-reference/tasks/create-a-task) * [Create an Event](/2025-09/api-reference/timeline-events/create-an-event) * [Create an Opportunity](/2025-09/api-reference/opportunities/create-an-opportunity) * [Create an Order](/2025-09/api-reference/orders/create-an-order) * [Deallocate a Unit](/2025-09/api-reference/units/deallocate-a-unit) * [Finalize an Order](/2025-09/api-reference/orders/finalize-an-order) * [Grant Access to a Unit](/2025-09/api-reference/units/grant-access-to-a-unit) * [Lose a Deal](/2025-09/api-reference/deals/lose-a-deal) * [Overlock Units by Contact](/2025-09/api-reference/units/overlock-units-by-contact) * [Remove Overlock from Units by Contact](/2025-09/api-reference/units/remove-overlock-from-units-by-contact) * [Reopen a Deal](/2025-09/api-reference/deals/reopen-a-deal) * [Reserve a Unit](/2025-09/api-reference/units/reserve-a-unit) * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) * [Update a Contact](/2025-09/api-reference/contacts/update-a-contact) * [Update a Deal](/2025-09/api-reference/deals/update-a-deal) * [Update a Line Item](/2025-09/api-reference/orders-line-items/update-a-line-item) * [Update a Note](/2025-09/api-reference/notes/update-a-note) * [Update a Task](/2025-09/api-reference/tasks/update-a-task) * [Update an Opportunity](/2025-09/api-reference/opportunities/update-an-opportunity) * [Validate an Order](/2025-09/api-reference/orders/validate-an-order) * [Win a Deal](/2025-09/api-reference/deals/win-a-deal) #### `invalid_effective_from` `effective_from` isn't an ISO 8601 date or `next_billing_period`, or it's more than 13 months from today. Send an ISO 8601 date within 13 months from today, or `next_billing_period`. **HTTP status:** `422` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) #### `invalid_notice_period` `notification.notice_period` would notify the customer on a date in the past for the adjustment date. Send a shorter notice period, `send_immediately`, or a later adjustment date. **HTTP status:** `422` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Create a Price Adjustment](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) #### `invalid_url_param` A path or query parameter is invalid, such as an ID with the wrong prefix or an unsupported page size. Read `details` for the invalid parameter, fix it, and send the request again. **HTTP status:** `422` · **Type:** `invalid_request_error` · **Retryable:** no **Returned by:** * [Abandon an Order](/2025-09/api-reference/orders/abandon-an-order) * [Archive an Opportunity](/2025-09/api-reference/opportunities/archive-an-opportunity) * [Associate an Opportunity with a Deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) * [Complete a Task](/2025-09/api-reference/tasks/complete-a-task) * [Create Base Price for the Product](/2025-09/api-reference/products/create-base-price-for-the-product) * [Create Base Price for the Protection Level](/2025-09/api-reference/protection-levels/create-base-price-for-the-protection-level) * [Create Base Price for the Unit Type](/2025-09/api-reference/unit-types/create-base-price-for-the-unit-type) * [Create a Deal from an Opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity) * [Create a Line Item](/2025-09/api-reference/orders-line-items/create-a-line-item) * [Deallocate a Unit](/2025-09/api-reference/units/deallocate-a-unit) * [Delete a Contact](/2025-09/api-reference/contacts/delete-a-contact) * [Delete a Deal](/2025-09/api-reference/deals/delete-a-deal) * [Delete a Line Item](/2025-09/api-reference/orders-line-items/delete-a-line-item) * [Delete a Note](/2025-09/api-reference/notes/delete-a-note) * [Delete a Price Adjustment](/2025-09/api-reference/price-adjustments/delete-a-price-adjustment) * [Delete a Task](/2025-09/api-reference/tasks/delete-a-task) * [Delete a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/delete-a-webhook-endpoint) * [Delete an Event](/2025-09/api-reference/timeline-events/delete-an-event) * [Delete an Opportunity](/2025-09/api-reference/opportunities/delete-an-opportunity) * [Delete an Order](/2025-09/api-reference/orders/delete-an-order) * [Disable a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/disable-a-webhook-endpoint) * [Disassociate an Opportunity from its Deal](/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal) * [Enable a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/enable-a-webhook-endpoint) * [Finalize an Order](/2025-09/api-reference/orders/finalize-an-order) * [Grant Access to a Unit](/2025-09/api-reference/units/grant-access-to-a-unit) * [List all Invoices](/2025-09/api-reference/invoices/list-all-invoices) * [List all Line Items](/2025-09/api-reference/orders-line-items/list-all-line-items) * [List all Product Categories](/2025-09/api-reference/product-categories/list-all-product-categories) * [Lose a Deal](/2025-09/api-reference/deals/lose-a-deal) * [Open a Task](/2025-09/api-reference/tasks/open-a-task) * [Reopen a Deal](/2025-09/api-reference/deals/reopen-a-deal) * [Reserve a Unit](/2025-09/api-reference/units/reserve-a-unit) * [Schedule a Price Adjustment](/2025-09/api-reference/price-adjustments/schedule-a-price-adjustment) * [Show a Contact](/2025-09/api-reference/contacts/show-a-contact) * [Show a Contract](/2025-09/api-reference/contracts/show-a-contract) * [Show a Contract Template](/2025-09/api-reference/contract-templates/show-a-contract-template) * [Show a Coupon](/2025-09/api-reference/coupons/show-a-coupon) * [Show a Credit Note](/2025-09/api-reference/credit-notes/show-a-credit-note) * [Show a Deal](/2025-09/api-reference/deals/show-a-deal) * [Show a Deal Stage](/2025-09/api-reference/deals-stages/show-a-deal-stage) * [Show a Note](/2025-09/api-reference/notes/show-a-note) * [Show a Price Adjustment](/2025-09/api-reference/price-adjustments/show-a-price-adjustment) * [Show a Product](/2025-09/api-reference/products/show-a-product) * [Show a Product Category](/2025-09/api-reference/product-categories/show-a-product-category) * [Show a Protection Level](/2025-09/api-reference/protection-levels/show-a-protection-level) * [Show a Site](/2025-09/api-reference/sites/show-a-site) * [Show a Source](/2025-09/api-reference/timeline-sources/show-a-source) * [Show a Staff Member](/2025-09/api-reference/staff/show-a-staff-member) * [Show a Subscription](/2025-09/api-reference/subscriptions/show-a-subscription) * [Show a Task](/2025-09/api-reference/tasks/show-a-task) * [Show a Template](/2025-09/api-reference/timeline-templates/show-a-template) * [Show a Tenancy](/2025-09/api-reference/tenancies/show-a-tenancy) * [Show a Unit](/2025-09/api-reference/units/show-a-unit) * [Show a Unit Allocation](/2025-09/api-reference/unit-allocations/show-a-unit-allocation) * [Show a Unit Type](/2025-09/api-reference/unit-types/show-a-unit-type) * [Show a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/show-a-webhook-endpoint) * [Show an Identity Verification](/2025-09/api-reference/identity-verifications/show-an-identity-verification) * [Show an Invoice](/2025-09/api-reference/invoices/show-an-invoice) * [Show an Opportunity](/2025-09/api-reference/opportunities/show-an-opportunity) * [Show an Order](/2025-09/api-reference/orders/show-an-order) * [Unarchive an Opportunity](/2025-09/api-reference/opportunities/unarchive-an-opportunity) * [Update a Contact](/2025-09/api-reference/contacts/update-a-contact) * [Update a Deal](/2025-09/api-reference/deals/update-a-deal) * [Update a Line Item](/2025-09/api-reference/orders-line-items/update-a-line-item) * [Update a Note](/2025-09/api-reference/notes/update-a-note) * [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) * [Update a Task](/2025-09/api-reference/tasks/update-a-task) * [Update a Webhook Endpoint](/2025-09/api-reference/webhook-endpoints/update-a-webhook-endpoint) * [Update an Event](/2025-09/api-reference/timeline-events/update-an-event) * [Update an Opportunity](/2025-09/api-reference/opportunities/update-an-opportunity) * [Update an Order](/2025-09/api-reference/orders/update-an-order) * [Validate an Order](/2025-09/api-reference/orders/validate-an-order) * [Win a Deal](/2025-09/api-reference/deals/win-a-deal) ### 502 #### `api_error` A third-party service that Stora depends on, such as Stripe or PandaDoc, failed or returned an invalid response. Retry the request later. If it keeps failing, contact support with the `request_id`. **HTTP status:** `502` · **Type:** `api_error` · **Retryable:** yes **Returned by:** * [Create Base Price for the Unit Type](/2025-09/api-reference/unit-types/create-base-price-for-the-unit-type) ## OAuth 2 errors The OAuth 2 endpoints, such as `POST /oauth2/token`, follow [RFC 6749](https://www.rfc-editor.org/rfc/rfc6749#section-5.2) and return a different error format: ```json theme={null} { "error": "invalid_client", "error_description": "Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method." } ``` `error` is one of the codes defined in RFC 6749, such as `invalid_client`, `invalid_grant` or `invalid_scope`. See [authentication](/2025-09/guides/authentication) for how to request tokens. # Your first API call Source: https://docs.stora.co/2025-09/guides/first-request Make your first request to the Stora Public API and explore the response. With your token in hand, let's make some requests and understand how the API responds. > [!TIP] > > Create a test operator in the [Developer Portal](/2025-09/guides/developer-portal) before exploring real operator data. Test operators are the recommended way to try requests safely. ## List your sites Use a token with `public.site:read`. Replace `YOUR_ACCESS_TOKEN` with your token. ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/sites" \ -H "accept: application/json" \ -H "authorization: Bearer YOUR_ACCESS_TOKEN" ``` Response: ```json theme={null} { "sites": [ { "id": "site_14b419f1096013f1", "name": "Downtown Storage", "description": "Central location with 24/7 access", "phone": "+44 20 7946 0958", "opened_at": "2024-03-15T00:00:00Z", "created_at": "2024-01-10T09:30:00Z", "updated_at": "2025-06-01T14:22:00Z", "directions": { "google_maps_url": "https://maps.google.com/?q=..." }, "access_hours": { "monday": { "status": "set_hours", "open": "06:00", "close": "22:00" }, "tuesday": { "status": "set_hours", "open": "06:00", "close": "22:00" }, "saturday": { "status": "twenty_four_hours" }, "sunday": { "status": "closed" } }, "address": { "line_1": "42 Storage Lane", "line_2": null, "city": "London", "postal_code": "EC1A 1BB" } } ], "meta": { "pagination": { "count": 1, "page": 1, "pages": 1, "limit": 50, "next": null, "prev": null, "last": 1 } } } ``` A few things to notice: * **`sites` array** — resources are wrapped in a key matching the resource name * **`meta.pagination`** — every list response includes pagination info. Use `page` and `limit` query parameters to navigate. * **IDs are prefixed strings** — e.g. `site_14b419f1096013f1`. Use these when referencing resources in other endpoints. ## Fetch a single resource Fetch a single site by its ID. Replace the example site ID with one returned by your list request: ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/sites/site_14b419f1096013f1" \ -H "accept: application/json" \ -H "authorization: Bearer YOUR_ACCESS_TOKEN" ``` ```json theme={null} { "site": { "id": "site_14b419f1096013f1", "name": "Downtown Storage", "..." }, "meta": {} } ``` ## Expand related resources Some endpoints support the `expand` query parameter to include related resources inline. A unit type's `site` relationship contains only the site ID unless you expand it. For this example, use a token with both `public.unit_type:read` and `public.site:read`. First, list unit types: ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/unit_types" \ -H "accept: application/json" \ -H "authorization: Bearer YOUR_ACCESS_TOKEN" ``` Choose an ID from the `unit_types` array and replace `UNIT_TYPE_ID` below. If the array is empty: * **Test operator:** Add a unit type to that test operator, then repeat the list request. * **Real operator:** Skip this optional expansion example or arrange suitable data with the operator. Do not create live inventory just to complete the tutorial. Use credentials for the operator whose data you are querying. Adding data to a different test operator will not change the current token's results. ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/unit_types/UNIT_TYPE_ID?expand=site" \ -H "accept: application/json" \ -H "authorization: Bearer YOUR_ACCESS_TOKEN" ``` In the response, `unit_type.site` now includes the site's fields, such as `name`, instead of only `id`. These excerpts show the difference. Without expansion: ```json theme={null} { "site": { "id": "site_14b419f1096013f1" } } ``` With `expand=site`, the relationship also includes site details. Other site fields are omitted here: ```json theme={null} { "site": { "id": "site_14b419f1096013f1", "name": "Downtown Storage" } } ``` On endpoints that support the relevant relationships, you can expand multiple relations with a comma-separated list and nest with dot notation: ``` ?expand=contact,line_items,line_items.item ``` Each expanded resource requires the appropriate read scope on your token. ## Common patterns These apply across the entire API. Each is covered in more detail in the dedicated guides. ### Pagination List endpoints return 50 items by default, up to a maximum of 100. Use `page` and `limit` to navigate: ``` GET /2025-09/contacts?page=2&limit=25 ``` Check `meta.pagination.pages` for the total number of pages and `meta.pagination.next` for the next page number (`null` on the last page). See [Responses](/2025-09/guides/responses#pagination) for full details. ### Error handling Errors return a consistent structure with a `code` for programmatic handling and `details` for field-level validation messages. See [Errors](/2025-09/guides/errors) for the full list of error codes. ```json theme={null} { "error": { "code": "invalid_content", "type": "invalid_request_error", "message": "The request body content is not valid.", "details": [ { "message": "value at `/email` does not match format: email", "pointer": "/email" } ], "request_id": "01563646-58c1-4607-8fe0-cae3e92c4477" } } ``` ### Idempotency For any `POST` request, include an `Idempotency-Key` header to safely retry without creating duplicates. The API stores a successful response for 24 hours. See [Requests](/2025-09/guides/requests#idempotent-requests) for details. ```bash theme={null} curl -X POST "https://public-api.stora.co/2025-09/contacts" \ -H "content-type: application/json" \ -H "authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "idempotency-key: a1b2c3d4-unique-key" \ -d '{"full_name": "Jane Smith", "email": "jane@example.com"}' ``` ### Rate limits The API allows 10 requests per second and 60 requests per minute. If you exceed this, you'll receive a `429 Too Many Requests` response. Check the `RateLimit-Reset` header for when to retry. See [Requests](/2025-09/guides/requests#rate-limiting) for details. # Introduction Source: https://docs.stora.co/2025-09/guides/introduction Build integrations, automate workflows, and sync data with the Stora Public API. The Stora Public API gives you programmatic access to your self-storage business. Use it to build custom integrations, automate operational workflows, and sync data with the tools you already use. > [!TIP] > > **Not a developer?** Connect Stora to thousands of apps without writing code using our [Zapier integration](https://intercom.help/stora/en/articles/13162033-automate-tasks-in-zapier). > [card] [Core concepts](/2025-09/guides/core-concepts) > > Understand Stora's domain model — sites, units, contacts, orders, tenancies, and more. > [card] [Developer Portal](/2025-09/guides/developer-portal) > > Create test operators, manage connected accounts, and submit partner apps. > [card] [Authentication](/2025-09/guides/authentication) > > Get set up with access tokens or OAuth 2.0 and start making requests. > [card] [Your first API call](/2025-09/guides/first-request) > > Make your first request, explore responses, and learn common patterns. > [card] [Webhooks](/2025-09/guides/webhooks) > > Receive real-time notifications when events happen in Stora. ## What you can do * **Manage contacts and leads** — create, update, and search your customer database * **Automate bookings** — build custom booking flows with orders, tenancies, and subscriptions * **Sync inventory** — track unit availability, allocations, and status changes in real time * **Process billing** — access invoices, credit notes, and subscription data * **React to events** — receive webhooks when things happen in Stora * **Explore safely** — create test operators in the [Developer Portal](/2025-09/guides/developer-portal) before working with real operator data * **Build partner integrations** — create partner apps, develop with test operators, and submit marketplace listings from the [Developer Portal](/2025-09/guides/developer-portal) # Manage access Source: https://docs.stora.co/2025-09/guides/manage-account-access Manage scopes, extend Access Tokens, disable or revoke credentials, and terminate a developer connection to a Stora account. After you [connect an account](/2025-09/guides/connect-account), use **Connected accounts** in the [Developer Portal](https://developer.stora.co) to manage its API credentials. Credential management requires an active account connection and Public API access. Disabling, enabling, revoking, and removing credentials requires an admin role in your developer company. Revoking a real account connection also requires an admin role. > [!NOTE] > > The **Access tokens** list contains tokens you create in the portal. Tokens your backend obtains from an **OAuth Client** are separate, short-lived tokens. To stop access through an OAuth Client, disable or revoke the client itself. ## Change scopes 1. Open the account under **Connected accounts**. 2. Find the Access Token or OAuth Client and open **Actions** → **Manage scopes**. 3. Select only the scopes your integration needs. 4. Click **Save changes**. The available scopes depend on the Stora account. See [Authorization](/2025-09/guides/authorization) for the scope list. For an OAuth Client, request a new token with the required scopes after saving. Changing the client does not add permissions to an already-issued token. Existing tokens retain their issued scopes; do not rely on a scope edit to stop their access immediately. Disable or revoke the client if you need to stop access. For a portal-created Access Token, the saved scopes apply to that token. You do not need a token exchange or a new token string. Stora emails the connected account owners when you change credential scopes. Name-only edits do not send an email. ## Extend an Access Token Portal-created Access Tokens expire. At creation, you can choose **7**, **30**, or **60 days**. The default is 30 days. To extend a token that has not expired or been revoked: 1. Open the account under **Connected accounts**. 2. Find the token under **Access tokens**. 3. Open **Actions** → **Extend by 10 days**. Each extension adds 10 days to the expiry date. You can extend the total lifetime up to 120 days from creation. The action is unavailable when another extension would exceed that limit. You cannot extend an expired or revoked token. Create a replacement if you still need access. > [!TIP] > > Use Access Tokens for one-time scripts or short-lived AI-agent tasks. For an ongoing integration, use an [OAuth Client](/2025-09/guides/managed-account-authentication#use-an-oauth-client) so your backend can obtain new tokens automatically. OAuth-issued tokens expire after 2 hours; the portal's extension action does not apply to them. ## Disable or enable a credential Use **Disable** when you need to pause access without permanently revoking the credential. 1. Open the account under **Connected accounts**. 2. Find the Access Token or OAuth Client. 3. Open **Actions** → **Disable** and confirm. | Credential | Effect of disabling | | - | - | | Access Token | API requests using the token are no longer authorised. | | OAuth Client | The client cannot obtain new tokens, and API requests using its already-issued tokens are no longer authorised. | To restore access, open **Actions** → **Enable**. Enabling does not extend a token's expiry or restore a revoked token. An OAuth Client's previously issued tokens may work again if they are still valid, unexpired, and not revoked. Stora emails the account owners when you disable or enable a credential. ## Revoke or remove a credential Use **Revoke** when a credential is no longer needed or has been exposed. 1. Open the account under **Connected accounts**. 2. Find the Access Token or OAuth Client. 3. Open **Actions** → **Revoke** and confirm. Revocation is permanent: you cannot enable the credential again. Revoking an OAuth Client prevents new token exchanges and API access through its existing tokens. Create a new credential if you need to restore access. After revocation, **Actions** → **Remove** removes the credential from the portal list. You can also remove an expired Access Token. Remove an OAuth Client only after revoking it. > [!WARNING] > > If a token or client secret is exposed, revoke the affected credential rather than extending it or changing its scopes. Create a replacement through [API credentials](/2025-09/guides/managed-account-authentication) and update your backend's protected configuration. ## Terminate an account connection Revoking the account connection stops your developer company from managing that account's credentials. It is different from revoking the credentials themselves. > [!WARNING] > > Revoking a connection does not automatically stop existing credentials or webhook deliveries. Decide which credentials and webhook endpoints should remain active before terminating the relationship. ### From the Developer Portal An admin in your developer company can: 1. Open the real account under **Connected accounts**. 2. Click **Revoke connection**. 3. Confirm **Revoke connection** in the dialog. Existing credentials and webhook endpoints remain active unless they are disabled, revoked, or otherwise become unavailable. If access should stop, disable or revoke the credentials and disable webhook endpoints before revoking the connection. After revocation, your developer company can no longer manage them in the portal. Retained credentials remain visible in Backoffice, but they are view-only there. Credential management requires an active Developer Portal connection; follow [Restore developer management](#restore-developer-management) if management needs to resume. Test-operator connections cannot be revoked through this flow. ### From the Stora account A Stora staff member with the **Revoke developer company connections** permission can: 1. Open **Connected developers** in the Stora account's settings. 2. Find the developer company and click **Revoke**. 3. Review the OAuth Clients, Access Tokens, and webhook endpoints on the revocation screen. 4. Select the **Disable** checkboxes for credentials and endpoints that should stop working. 5. Click **Revoke connection**. The screen preselects active OAuth Clients, active Access Tokens, and enabled webhook endpoints. Selected items are disabled; unselected items keep working. Disabling is not permanent credential revocation. ### Restore developer management Ask an authorised Stora staff member to [approve an invitation again](/2025-09/guides/connect-account#connect-a-stora-account). This reactivates the existing connection and restores management of its credentials and webhook endpoints. Reaccepting the connection does not enable disabled credentials, undo credential revocation, or extend token expiry. Review each credential's status before resuming the integration. ## If Public API access becomes unavailable If the account loses Public API access, its API credentials become unavailable and the Developer Portal stops allowing credential and webhook management. Restoring the account's Public API access restores management for an active connection. Credential expiry, disabling, and revocation still apply. Restoring Public API access does not replace expired or revoked credentials. # API credentials Source: https://docs.stora.co/2025-09/guides/managed-account-authentication Choose Access Tokens for one-time tasks or OAuth Clients for ongoing integrations, and use OAuth 2.0 Client Credentials. Use this guide when you build an integration for a specific Stora account and need to manage its API credentials in the [Developer Portal](https://developer.stora.co). You have two options: **Access Tokens**, which you use directly in API requests, and **OAuth Clients**, which exchange a client ID and secret for short-lived access tokens. > [!NOTE] > > Managed-account OAuth Clients use the **OAuth 2.0 Client Credentials** flow. They are different from partner apps. If you build a partner app that operators authorise themselves, or prepare an app for marketplace distribution, follow [Building a partner integration](/2025-09/guides/partner-integrations) and use Authorization Code instead. ## Connect a Stora account Before creating credentials for a real account, follow [Connect an account](/2025-09/guides/connect-account) to generate an invitation and get staff approval. Then open the active account under **Connected accounts** in the Developer Portal. To explore without real account data, [create a test operator](/2025-09/guides/developer-portal#testing--looking-around) first. ## Choose Access Tokens or OAuth Clients Both options authenticate requests with `Authorization: Bearer `. The difference is how you obtain and renew the token. | | Access Tokens | OAuth Clients | | - | - | - | | Credentials you store | An access token created in the portal | A client ID and client secret | | Before calling the API | Use the token directly | Exchange the client credentials for an access token | | Token expiry | Tokens expire after the lifetime you choose at creation | Issued tokens expire after 2 hours | | Continued access | [Extend the token](/2025-09/guides/manage-account-access#extend-an-access-token) within the allowed limit, or create a replacement | Request another token using the same client credentials | | Best fit | One-time scripts and short-lived AI-agent tasks | Ongoing server-to-server integrations and scheduled jobs | **Access Tokens expire.** Use them for one-time scripts or short-lived tasks performed by an AI agent, where you need to make requests without implementing a token exchange. Once a token expires, it no longer authenticates requests. Use **OAuth Clients** instead for ongoing integrations so your backend can obtain new tokens automatically. For AI-agent tasks, select only the scopes the task needs and the shortest suitable token lifetime. Supply the token through protected runtime configuration, not in a prompt, and revoke it when the task is finished. Use **OAuth Clients** for an ongoing integration where your backend can obtain and renew tokens automatically. Short-lived tokens limit how long a leaked access token remains usable, but you must still protect the client secret: anyone with it can request new tokens. ### Use an Access Token 1. Open the connected account and click **New access token** under **Access tokens**. 2. Enter a **Name**, select the scopes you need, and choose an **Expires** value. 3. Click **Create access token** and copy the token immediately. You cannot view it again. 4. Use it directly as the bearer token in your [first API request](/2025-09/guides/first-request). ## Use an OAuth Client Client Credentials is a server-to-server flow. After creating the client in the portal, your backend can request tokens without a browser redirect, callback URL, or interactive Stora login. ### 1. Create the OAuth Client 1. Open the account under **Connected accounts**. 2. Under **OAuth clients**, click **New OAuth client**. 3. Enter a **Name** that identifies your integration, such as `Reporting sync`. 4. Select only the scopes your integration needs. For the example below, select `public.site:read`. 5. Click **Create OAuth client**. 6. Copy the **Client ID** and **Client secret**, then click **Done**. > [!WARNING] > > The client secret is shown only once. Store it in a server-side secret manager or protected configuration. Never include it in browser JavaScript, mobile apps, distributed plugins, source control, or logs. Keep access tokens private too. ### 2. Exchange the credentials for an access token Send a JSON request to `POST https://public-api.stora.co/oauth2/token`. Replace `YOUR_CLIENT_ID` and `YOUR_CLIENT_SECRET` with the credentials you copied. ```bash theme={null} curl --fail-with-body -X POST "https://public-api.stora.co/oauth2/token" \ -H "content-type: application/json" \ -d '{ "grant_type": "client_credentials", "client_id": "YOUR_CLIENT_ID", "client_secret": "YOUR_CLIENT_SECRET", "scope": "public.site:read" }' ``` * `grant_type` must be `client_credentials`. * `client_id` and `client_secret` identify and authenticate the OAuth Client. * `scope` is required. Use a space-separated list of scopes enabled for the client, such as `public.site:read public.contact:read`. The token endpoint is not versioned. Do not add `/2025-09` to its URL. An example successful response: ```json theme={null} { "access_token": "YOUR_ISSUED_ACCESS_TOKEN", "token_type": "Bearer", "expires_in": 7200, "scope": "public.site:read", "created_at": 1740235260 } ``` Use `access_token` for API requests. `expires_in` is the token lifetime in seconds: `7200` means 2 hours. The response's `scope` tells you which permissions the token has. ### 3. Call the API with the issued token Replace `YOUR_ISSUED_ACCESS_TOKEN` with the `access_token` from the response: ```bash theme={null} curl --fail-with-body "https://public-api.stora.co/2025-09/sites" \ -H "accept: application/json" \ -H "authorization: Bearer YOUR_ISSUED_ACCESS_TOKEN" ``` This returns the sites for the account associated with the OAuth Client. Unlike the token endpoint, resource endpoints include the API version in the path. > [!NOTE] > > The bearer token is the issued `access_token`, not the client ID or client secret. Both portal-created Access Tokens and OAuth-issued access tokens use the same bearer header. ### 4. Obtain a new token before expiry Store the token and its expiry securely on your backend. Reuse the token for API calls rather than requesting a new one for every call. Before the token expires, repeat the request in step 2 with the same client ID, client secret, and required scopes. For example, request a replacement 5 minutes before expiry. Use the new `access_token` in subsequent API requests. **Client Credentials does not issue a refresh token.** Do not use `grant_type: refresh_token` for these OAuth Clients. Renew access by repeating the `client_credentials` exchange. ## Troubleshoot authentication | Problem | What to check | | - | - | | The token exchange fails | Check the client ID and secret, the `client_credentials` grant type, and that the client is active. Inspect the response's `error` and `error_description`. | | A requested scope is rejected | Check that the scope is available to the account and enabled for the OAuth Client. Use spaces, not commas, between scopes. | | An API request is unauthorised | Check that the bearer value is an access token, that it has not expired or been revoked, that the client is active, and that the account still has Public API access. | | A request lacks permission | Check the scopes required by the endpoint against the issued token's scopes. Manage the client's scopes in the portal and request a new token with the required scopes. | See [Authorization](/2025-09/guides/authorization) for available scopes and [Errors](/2025-09/guides/errors) for API error responses. ## Manage existing credentials See [Manage access](/2025-09/guides/manage-account-access) to change scopes, extend Access Tokens, disable or revoke credentials, and terminate an account connection. # Resource metadata Source: https://docs.stora.co/2025-09/guides/metadata Store arbitrary key-value pairs on resources using the metadata field. Some resources support a `metadata` field that allows you to store arbitrary key-value pairs. This is useful for attaching your own identifiers, references, or any other information that is meaningful to your integration. ## Format Metadata is a flat JSON object where both keys and values must be strings. ```json theme={null} { "metadata": { "external_id": "abc_123", "source": "zapier", "correlation.id": "req-001" } } ``` ## Constraints | Constraint | Limit | | - | - | | Maximum number of keys | 20 | | Key format | Lowercase alphanumeric characters, dots (`.`), underscores (`_`), colons (`:`), and hyphens (`-`) | | Maximum key length | 40 characters | | Maximum value length | 500 characters | | Value type | String only | ## Update semantics Metadata updates use **merge-patch** semantics ([RFC 7386](https://datatracker.ietf.org/doc/html/rfc7386)). When updating metadata, only the keys you include in the request are affected. Existing keys that are not included remain unchanged. * **Add or update a key**: include the key with a string value * **Remove a key**: include the key with a `null` value * **Clear all metadata**: send an empty object `{}` * **Leave metadata unchanged**: omit the `metadata` field from the request ```bash title="Create with metadata" theme={null} curl -X POST "https://public-api.stora.co/2025-09/webhook_endpoints" \ -H 'content-type: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' \ -d '{"name": "My Webhook", "url": "https://example.com/webhook", "api_version": "2025-09", "event_types": ["contact.created"], "metadata": {"source": "zapier", "external_id": "abc_123"}}' ``` ```bash title="Update: change one key, remove another" theme={null} curl -X PATCH "https://public-api.stora.co/2025-09/webhook_endpoints/we_..." \ -H 'content-type: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' \ -d '{"metadata": {"source": "make", "external_id": null}}' ``` After the update, the metadata will be `{"source": "make"}` — the `source` key was updated and `external_id` was removed. # Capture and qualify leads Source: https://docs.stora.co/2025-09/guides/opportunities-and-deals Capture an opportunity, create or associate a deal, and manage the opportunity's lifecycle. Use an opportunity to capture interest before you have a qualified sales deal. When the lead is ready for your sales process, create a deal from the opportunity or associate it with an existing deal. An opportunity does not reserve a unit or create an order. Use the [booking flow](/2025-09/guides/booking-flow) when the customer is ready to rent. ## Before you start Use a token with `public.opportunity:read` and `public.opportunity:write`. To create a deal, [associate an opportunity with a deal](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal), or [disassociate it](/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal), also grant `public.deal:write`. Listing deal stages requires `public.deal_stage:read`. You need an existing contact ID for the example below. To include a storage preference, also choose a site and a unit type from that site. All records must belong to the connected operator. Add the appropriate read scopes if you look up or expand those resources. To run this guide's `curl` examples, set `STORA_ACCESS_TOKEN` in your shell to your access token. `STORA_ACCESS_TOKEN` is an example variable name, not an API requirement. Replace the placeholder IDs with your records' IDs. ## Capture the opportunity Generate an idempotency key for the lead: ```bash theme={null} OPPORTUNITY_KEY="$(uuidgen)" ``` [Create an opportunity](/2025-09/api-reference/opportunities/create-an-opportunity) with the contact and the storage preference: ```bash theme={null} curl --request POST \ 'https://public-api.stora.co/2025-09/opportunities' \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" \ --header 'Content-Type: application/json' \ --header "Idempotency-Key: $OPPORTUNITY_KEY" \ --data '{ "contact": {"id": "con_REPLACE"}, "site": {"id": "site_REPLACE"}, "line_items": [ {"type": "unit_type", "item": {"id": "utype_REPLACE"}} ], "metadata": {"external_lead_id": "lead_123"} }' ``` The response contains `opportunity.id`, an `open` status, and a `public_api` source. Save the ID with the lead in your system and set `OPPORTUNITY_ID` to that returned ID for later requests. If the site or storage preference is not known yet, omit `site` and `line_items`. To create a new contact, omit the contact ID and supply `contact.email`. This creates a new contact rather than looking up an existing contact by email. See the [create request](/2025-09/api-reference/opportunities/create-an-opportunity) for the supported contact fields. When you supply a contact ID alongside other contact fields, those fields update that contact. ## Update the customer's preference While the opportunity is not associated with a deal, [update it](/2025-09/api-reference/opportunities/update-an-opportunity) as you qualify the lead. * Keep the original contact. You cannot change the contact on an existing opportunity. * Include at most one unit-type line item and one protection line item. A site is required for either type. * Choose a unit type and [site-scoped protection level](/2025-09/guides/site-scoped-protection-levels) from the opportunity's site. * To remove all line items, send `"line_items": []`. Omitting `line_items` leaves them unchanged. * If you change or clear the site, remove or replace any line items that no longer belong to it in the same request. Use metadata for your own identifiers. Source, creator, and lifecycle fields are read-only. ## Create a deal for a qualified lead [List deal stages](/2025-09/api-reference/deals-stages/list-all-stages) and choose an active stage for the new deal: ```bash theme={null} curl --request GET \ 'https://public-api.stora.co/2025-09/deals/stages?limit=100' \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" ``` Use that stage's ID to [create a deal from the opportunity](/2025-09/api-reference/opportunities/create-a-deal-from-an-opportunity). Generate a different idempotency key for this action: ```bash theme={null} DEAL_KEY="$(uuidgen)" curl --request POST \ "https://public-api.stora.co/2025-09/opportunities/$OPPORTUNITY_ID/deal" \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" \ --header 'Content-Type: application/json' \ --header "Idempotency-Key: $DEAL_KEY" \ --data '{ "stage": {"id": "dstg_REPLACE"}, "name": "Storage enquiry from our CRM" }' ``` The response contains the new `deal`. Stora copies the opportunity's contact, site, and line items, then associates the opportunity with that deal. The opportunity's status becomes `associated`. An archived opportunity is unarchived when it is converted. > [!WARNING] > > Conversion fails while the opportunity is associated or still has a previous conversion recorded. It also fails if its unit type or protection no longer belongs to its site. Fix invalid preferences before retrying. To change an existing association, follow the disassociation procedure below. ## Use an existing deal instead If your CRM already has the deal in Stora, [associate the opportunity](/2025-09/api-reference/opportunities/associate-an-opportunity-with-a-deal) instead of creating another deal. Send `POST /opportunities/{opportunity_id}/associate_deal` with a `deal` object containing the existing deal's `id`. Use an idempotency key for this action too. The deal and opportunity must belong to the same contact. Several opportunities can refer to one deal, but each opportunity can refer to only one deal. Association does not change the deal or copy the opportunity's preferences into it. After either creation or association, you can update only the opportunity's metadata. Update the deal itself for subsequent sales work. ## Archive or remove the association For a lead you no longer need to work, [archive the opportunity](/2025-09/api-reference/opportunities/archive-an-opportunity). You can archive only an open, unassociated opportunity. [Unarchive it](/2025-09/api-reference/opportunities/unarchive-an-opportunity) if interest resumes. To remove a deal association, use [Disassociate an Opportunity from its Deal](/2025-09/api-reference/opportunities/disassociate-an-opportunity-from-its-deal). The deal is unchanged. Association unarchives an archived opportunity. Disassociation returns the opportunity to `open`, or to `archived` if it was archived before association. Disassociation also clears the previous conversion record, so you can associate the opportunity with another deal or convert it again. The original deal remains. Create another deal only if you intend a separate sales record. You cannot delete an associated opportunity. Remove its association first if you need to [delete it](/2025-09/api-reference/opportunities/delete-an-opportunity). Handle `409` responses as lifecycle conflicts. Retrieve the current opportunity before choosing another action. For request timeouts, retry the original action with the same idempotency key rather than creating a duplicate lead or deal. # Building a partner integration Source: https://docs.stora.co/2025-09/guides/partner-integrations Build integrations that work across multiple Stora operators and partner with us. If you're building a product or service that integrates with Stora on behalf of multiple operators, you're building a partner integration. This guide covers how it works, what we expect, and how to get started. ## Operator integrations vs partner integrations There are two ways to connect to the Stora API: | | Operator integration | Partner integration | | - | - | - | | **Who builds it** | The operator or a developer managing access for that operator | A provider whose product operators connect independently | | **Auth flow** | Access Token or Client Credentials | Authorization Code (required) | | **Scope** | Single operator's data | Multiple operators, each authorising independently | | **Setup** | Manage a connected operator account in the Developer Portal | Create and submit a partner app in the Developer Portal | | **Example** | Internal reporting dashboard, custom booking widget | Smart entry provider, CRM connector, accounting sync | > [!WARNING] > > Do not ask operators to share existing access tokens or Client Credentials. > If you manage API access on behalf of a specific operator, use the > [managed-account flow](/2025-09/guides/connect-account) to establish your own > authorised connection and create credentials under it. For a partner product > that operators connect independently, use Authorization Code. ## How the partner programme works **1. Create a partner app** Use the [Developer Portal](/2025-09/guides/developer-portal) to create a test partner application for your integration. Configure its redirect URIs, then copy the client ID and reveal the client secret. The secret can be revealed only once, so store it securely on your backend. See [Partner app credentials](#partner-app-credentials). **2. Develop and test** [Create a test operator](/2025-09/guides/test-operators) and build your integration with the [Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code). For a pilot with a real operator, [send a testing invitation](#invite-a-real-operator-to-test), then complete OAuth consent separately. **3. Submit the application for review** Complete the [partner approval checklist](/2025-09/guides/partner-approval-checklist), then [submit your application](#submit-your-application-for-review). Application review covers scopes, integration behavior, and data handling. **4. Configure the live application** Approval creates a separate live application, or updates its existing live counterpart. For the first live version, copy its client ID and reveal its secret once. Use the live credentials in production, not the test credentials. **5. Publish the marketplace listing** After the application is approved and live, [create and submit a marketplace listing](/2025-09/guides/publish-marketplace-listing). Listing review is separate from application review. Application approval alone does not publish your integration on the marketplace. After launch, we monitor usage and operator feedback. Use the [application review process](#publish-application-changes) to publish changes from your test application to its live counterpart. ## Partner app credentials You create the test application yourself in the Developer Portal. Set its redirect URIs to the callback URLs your backend handles. For a distributed plugin, use your broker's callback URL, not an individual plugin installation's URL. The test application uses Authorization Code and has its own client ID and secret. You can reveal the secret once. Store it securely on your backend before leaving the credential view. Test access is limited to your company's test operators and real operators that accept an application invitation. Approval publishes a separate live application with its own credentials and copies the approved redirect URIs. Use that application's client ID and secret for production connections. The live secret also has a one-time reveal. Do not assume that approving a test app makes its existing credentials production credentials. ## Invite a real operator to test Your company's test operators can use the test application automatically. Use an application invitation for a pilot with a real operator outside your developer company. 1. In the Developer Portal, open **My applications** and select the test application. 2. Open the **Operators** tab. 3. Click **Generate invitation link**. 4. Copy the link and share it privately with the operator's staff member who can approve partner application testing. 5. Ask that staff member to sign in to Stora, select the intended operator, and accept the invitation. 6. Confirm that the operator appears under **External operators**. 7. Send the operator through your app's Authorization Code flow to grant API access. > [!WARNING] > > Accepting a testing invitation approves the operator to test this app. It does not grant API access. OAuth consent is a separate step, and the staff member needs the relevant permissions for each step. Real-operator testing uses real operator data. Agree on the pilot's scope before you test writes or send notifications. The developer company has a configurable limit on invited operators. If acceptance fails because the limit is reached, contact Stora. Do not assume that each application has a separate quota. Use **Regenerate link** if you need to replace a shared link, or **Revoke link** to stop new acceptances. Both actions invalidate the old link. Operators who already accepted stay approved, and existing OAuth tokens are not revoked by changing the invitation link. End API access through the [connection lifecycle](#disconnect-and-reconnect). This invitation differs from [connecting an account](/2025-09/guides/connect-account), which lets a developer manage credentials on an operator's behalf. Do not use the managed-account flow as a substitute for a partner app's OAuth flow. ## Submit your application for review 1. Open the test application under **My applications**. 2. Check its name, description, logo, redirect URIs, and requested scopes. 3. Set **App URL**, **Privacy policy URL**, and **Terms of service URL**. All three URLs are required for submission. 4. Complete the [partner approval checklist](/2025-09/guides/partner-approval-checklist). 5. Open **Live app** and click **Submit for approval**. 6. Describe the app's purpose, customer value, supported workflows, data storage and retention, and expected API traffic in the request form. 7. Explain why the integration needs each requested scope. 8. Provide a working test account URL, username, password, and testing instructions. Use `integration-testing@stora.co` for the test account email address. 9. Submit the request. The test account must let reviewers verify the integration. Instructions or a demonstration do not replace that account. Use the private review form to provide test access, not your published documentation or source repository. You cannot edit the application while its review is in progress. If the reviewer requests changes, open **Live app** and read **Reviewer notes**. Update the application, then click **Edit and resubmit** to update and submit the request again. After approval, configure your production backend with the [live application's credentials](#partner-app-credentials). Then submit the [marketplace listing](/2025-09/guides/publish-marketplace-listing) if you want marketplace distribution. ## Publish application changes Make changes on the test application, not its live counterpart. 1. Edit the test application's settings. 2. Review the portal's unpublished application changes. 3. Click **Request approval for changes**. 4. Update the review answers and scope justifications to describe the change. 5. Submit the request and respond to any reviewer notes. Saving the test application does not update the live application. Approval publishes the reviewed application settings to the live counterpart. This process covers application changes, not only additional scopes. If the change adds scopes, operators who are already connected must re-authorise your application. See [Add scopes after launch](#add-scopes-after-launch). For listing copy, screenshots, categories, or setup links, use the separate [listing update procedure](/2025-09/guides/publish-marketplace-listing#update-a-published-listing). ## Add scopes after launch When a new feature needs scopes your live application doesn't have, request them through review, then ask each connected operator to re-authorise. **1. Request the new scopes** Add the scopes to your test application and [request approval for the changes](#publish-application-changes). Explain why the new feature needs each scope. **2. Detect connections without the new scopes** Approval doesn't change existing connections. Access tokens keep the scopes the operator granted, and refreshing a token doesn't add new ones. Call [`GET /oauth2/token/info`](/2025-09/api-reference/oauth-2/retrieve-info-for-the-access-token) and compare the returned scopes with the scopes the feature needs. A request that needs a scope the token doesn't have returns a `403` [`forbidden` error](/2025-09/guides/errors). **3. Prompt the operator to re-authorise** Stora doesn't notify operators when your application gains new scopes. Show a prompt in your app that explains what the new feature does and why it needs more access. When the operator accepts, run the [Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code) again. Request every scope your integration needs in the `scope` parameter, not only the new ones. The consent screen lists all requested scopes, and the new token covers only what you request. **4. Replace the stored tokens** Store the new access and refresh tokens in place of the old ones. Re-authorising doesn't revoke the previous tokens, so revoke them with [`POST /oauth2/revoke`](/2025-09/api-reference/oauth-2/revoke-an-access-token). Until an operator re-authorises, keep the features that work with the existing scopes running. Hide or disable only the features that need the new scopes. ## Technical requirements These apply to all partner integrations. Meeting them is part of the review process. ### Naming and presentation Your integration must use a distinct product name and must not imply that Stora built, owns, operates, or endorses it. If you're distributing a plugin, extension, or packaged integration, follow the [third-party plugin naming rules](/2025-09/guides/third-party-plugin-naming) before you publish. ### Authentication * You **must** use the [OAuth 2.0 Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code). No other flow is accepted for partner integrations. * Handle [token refresh](/2025-09/guides/authentication#refreshing-tokens) correctly — access tokens expire after 2 hours. * Never ask operators to share or copy-paste credentials. Your integration should handle the OAuth flow end-to-end. * If you're distributing your integration as code that runs outside infrastructure you control (WordPress plugin, browser extension, client-side app extension, packaged on-premise tool, etc.), follow the [broker pattern](/2025-09/guides/distributing-public-plugins) — PKCE alone is not sufficient for multi-tenant distribution. ### Identify the connected operator Use [`GET /oauth2/token/info`](/2025-09/api-reference/oauth-2/retrieve-info-for-the-access-token) with the current access token to inspect the connected account and granted scopes. Your integration must display the returned `operator.name` in your app. A single Stora staff member can have access to multiple operators, so they need to know which operator account is connected. Use the returned scopes to check whether the current token includes the permissions your integration needs. If a newly added feature requires scopes that are missing, prompt the operator to [re-authorise](#add-scopes-after-launch). > [!TIP] > > You can use this endpoint as the initial request to verify the connection. ### Disconnect and reconnect Your integration **must** expose operator-facing Disconnect and Reconnect actions in its UI. Operators expect to manage the connection from inside the product they installed. * **Disconnect** must call [`POST /oauth2/revoke`](/2025-09/api-reference/oauth-2/revoke-an-access-token) with a valid token and your OAuth client credentials, then discard the locally stored tokens. Passing either the access token or the refresh token revokes the pair — one call is enough. * **Reconnect** is re-running the [Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code). Expose it in the UI even while the current tokens are still valid, so operators can re-grant expanded scopes or switch Stora accounts without uninstalling. * **On uninstall or deprovisioning**, your integration **must** automatically revoke tokens and discard local state. For distributed plugins, wire the same revoke-and-discard into the host's uninstall hook. For hosted marketplace apps, use the platform's deprovisioning webhook, such as Shopify's `app/uninstalled` webhook. These hooks are best-effort; treat them as a hygiene layer on top of the explicit Disconnect action, not a replacement for it. Operators may also terminate connections outside your integration. When your integration detects a refresh failure (a `400` or `401` from the token endpoint), surface a clear "reconnect" prompt to the operator. For plugin-distributed integrations, see [Disconnecting and reconnecting](/2025-09/guides/distributing-public-plugins#disconnecting-and-reconnecting) in the broker guide for the broker-side responsibilities. ### External Events When your integration takes an action in Stora on behalf of an operator, it must be visible to them. You're required to create **[Timeline Events](/2025-09/api-reference/timeline-events/create-an-event)** for actions originating on your platform. For example: * "Unit locked via YourApp" * "Customer contacted via YourApp" Use Timeline Sources and Templates to structure these events. Follow [Record integration activity](/2025-09/guides/timeline-events) for a complete example. If you need custom Templates specific to your integration, we'll review and create them during the onboarding process. ### Rate limits Standard rate limits apply (10 requests/second, 60 requests/minute) per operator, shared with their other API usage. Strategic partners may negotiate independent higher limits for operators using their integration. Your integration must implement backoff when receiving `429` responses — see [rate limiting](/2025-09/guides/requests#rate-limiting). ### Idempotency Use `Idempotency-Key` headers on all `POST` requests to prevent duplicate operations. See [idempotent requests](/2025-09/guides/requests#idempotent-requests). ### Error handling Handle all [documented error codes](/2025-09/guides/errors) gracefully. Do not retry indefinitely on `4xx` errors. ### Metadata Use the [`metadata` field](/2025-09/guides/metadata) to store your own references on supported resources (contacts, orders, tasks, notes, webhook endpoints) rather than maintaining external mapping tables. ### Webhooks Use [webhooks](/2025-09/guides/webhooks) to react to Stora events rather than polling. This is more efficient, gives you real-time data, and respects rate limits. ## Scope principles We follow the principle of **least privilege**. Your production credentials will be scoped to only the permissions your integration needs — nothing more. During development, use test operators in the Developer Portal so you can explore freely. Test applications can only be used with your test operators or operators that accept an application invitation. At review time, we'll agree on the minimum set of scopes for production. If you need additional scopes after launch (e.g. you're adding a new feature), submit a request with justification. Operators who have already connected must [re-authorise](#add-scopes-after-launch) to grant the new scopes. ## Get started Ready to build a partner integration? Create a partner app in the [Developer Portal](/2025-09/guides/developer-portal), develop with test operators, review the [partner approval checklist](/2025-09/guides/partner-approval-checklist), then submit your application for review. # Schedule a subscription price adjustment Source: https://docs.stora.co/2025-09/guides/price-adjustments Draft a percentage change, check customer notice, schedule the adjustment, and track its outcome. Use a price adjustment to change selected recurring charges on an existing subscription at a future renewal. This guide stages a 5% rent increase as a draft before scheduling it. > [!WARNING] > > Scheduling can send a customer notification immediately. Test the flow on a test operator first. Check the resolved adjustment date and notice settings before scheduling against a real subscription. ## Before you start Use a token with `public.price_adjustment:read` and `public.price_adjustment:write`. Add `public.subscription:read` if you retrieve the subscription first. The subscription must be active, have been billed through Stripe, and not be archived or scheduled to end. Stora checks these conditions when you create the draft and again when you schedule it. The subscription must also have a renewal date after today, because Stora resolves the adjustment date to a renewal. When you schedule, the adjustment date must be later than today in the operator's timezone. Only one scheduled adjustment can await application for a subscription at a time. Drafts do not reserve that slot. Stora checks the adjustment date, the scheduled slot, and duplicate adjustments for the same date only when you schedule, so a successful draft does not prove that it can be scheduled. To run this guide's `curl` examples, set `STORA_ACCESS_TOKEN` in your shell to your access token. `STORA_ACCESS_TOKEN` is an example variable name, not an API requirement. Replace `sub_REPLACE` below with the subscription ID. ## Create a draft Generate an idempotency key once for this adjustment: ```bash theme={null} ADJUSTMENT_KEY="$(uuidgen)" ``` [Create the draft](/2025-09/api-reference/price-adjustments/create-a-price-adjustment) with the charge types you want to change. This example requests immediate customer notice when you later schedule it: ```bash theme={null} curl --request POST \ 'https://public-api.stora.co/2025-09/price_adjustments' \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" \ --header 'Content-Type: application/json' \ --header "Idempotency-Key: $ADJUSTMENT_KEY" \ --data '{ "subscription": {"id": "sub_REPLACE"}, "effective_from": "next_billing_period", "schedule": false, "percentages": {"unit_types": 5}, "notification": {"notice_period": "send_immediately"} }' ``` The response contains `price_adjustment`. Save its `id` and set `PRICE_ADJUSTMENT_ID` to that returned ID for the later requests. `percentages` sets the percentage change for each charge type: `unit_types`, `protection_levels`, and `products`. A type you leave out, or set to `0`, is not adjusted. Set at least one type to a non-zero value before scheduling. Use a negative value for a decrease. Each value must be greater than `-100` and at most `9999.99`. ## Check the date, estimate, and notice Inspect the returned adjustment before you schedule it: 1. Check `adjust_on`. Stora resolves `effective_from` to the first renewal on or after that date. `next_billing_period` selects the next renewal. 2. Check `percentages` against the intended change. 3. Check `estimation.pre_amount` and `estimation.post_amount`. These are estimates from the subscription's current billing data, not a fixed quote. 4. Check `notification.notice_period`, `notification.scheduled_at`, and `notification.sent_at`. Dates use the operator's timezone. If you need a later renewal, supply a calendar date in `effective_from` instead of `next_billing_period`. The example sends no notice while it remains a draft. Its `send_immediately` setting takes effect only when you schedule it. To give advance notice, use a positive number of days, such as `"notice_period": 30`. If that explicit period puts the notice date in the past, the request returns `422` with code `invalid_notice_period`. Choose a later renewal, shorten the period, or request immediate notice if appropriate. If the notice date is today, Stora returns `send_immediately`. If you omit `notification`, Stora uses the operator's default notice period. Unlike an explicit period that would notify in the past, a default that no longer fits resolves to `send_immediately`. To skip Stora's customer notification, set `"notice_period": null`. This requires `public.price_adjustment:skip_notifications` in addition to the write scope. The extra scope is also required if the operator's default resolves to no notification, or if you update or schedule a draft that already skips notification. ## Edit the draft if needed Use [Update a Price Adjustment](/2025-09/api-reference/price-adjustments/update-a-price-adjustment) to change the draft. Omitted fields stay unchanged. You cannot change its subscription. Create a different adjustment for another subscription. If you change `effective_from`, inspect the newly resolved `adjust_on` and notice settings again. Estimates are recalculated on each write. A scheduled adjustment cannot be edited. Delete it and create a replacement if the date, percentage, or charge types need to change. ## Schedule the adjustment Before scheduling, confirm that the subscription still has the selected charge types and that the estimate reflects the intended change. Scheduling does not guarantee rejection when a selected charge type is absent. If the draft is stale, update it to refresh the estimate. Once you have checked the draft, generate a separate idempotency key for scheduling: ```bash theme={null} SCHEDULE_KEY="$(uuidgen)" curl --request POST \ "https://public-api.stora.co/2025-09/price_adjustments/$PRICE_ADJUSTMENT_ID/schedule" \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" \ --header "Idempotency-Key: $SCHEDULE_KEY" ``` The status becomes `pending`. Stora checks subscription eligibility again and recalculates the estimate from current prices. Compare the returned estimate with the change you intended. Notifications become active when you schedule. A `send_immediately` notice is sent then. If the notice period no longer fits before the adjustment date, Stora sends the notice today and reports `send_immediately`. If scheduling returns `409`, retrieve the current adjustment and subscription before trying again. Check for an ineligible subscription, a date that is today or in the past, or another scheduled adjustment. Do not retry a lifecycle conflict indefinitely. ## Track the outcome [Retrieve the adjustment](/2025-09/api-reference/price-adjustments/show-a-price-adjustment) by ID, or configure [webhooks](/2025-09/guides/webhooks) for price-adjustment events. A scheduled adjustment starts as `pending`. During application it becomes `processing`, then `adjusted` when the prices have been applied. The later `invoiced` state records invoicing, not payment collection. Check billing events separately if you need payment confirmation. Handle `price_adjustment.created`, `price_adjustment.updated`, `price_adjustment.scheduled`, `price_adjustment.rescheduled`, `price_adjustment.cancelled`, `price_adjustment.invoiced`, and `price_adjustment.failed` events. On failure, retrieve the adjustment and investigate before creating another one. Once an adjustment has been applied, it no longer holds the scheduled slot. You can schedule the next one even if the previous adjustment is still awaiting its invoice. ## Call off a scheduled adjustment Before it starts processing, [delete a pending adjustment](/2025-09/api-reference/price-adjustments/delete-a-price-adjustment) to call it off: ```bash theme={null} curl --request DELETE \ "https://public-api.stora.co/2025-09/price_adjustments/$PRICE_ADJUSTMENT_ID" \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" ``` Only `draft`, `pending`, and `cancelled` adjustments can be deleted. Deletion does not send a customer cancellation notice. If Stora has already sent the original notice, communicate the cancellation or replacement through your own customer-support process. For timeouts on a create or schedule request, retry with that action's original idempotency key. See [Idempotent requests](/2025-09/guides/requests#idempotent-requests). # Publish a marketplace listing Source: https://docs.stora.co/2025-09/guides/publish-marketplace-listing Prepare a listing, submit it for review, and publish updates separately from your application's approval. Publish a listing so operators can discover your integration on the [Stora marketplace](https://marketplace.stora.co). Application approval and listing approval are separate. First, [submit your application](/2025-09/guides/partner-integrations#submit-your-application-for-review) and get its live version approved. Then create and submit the marketplace listing. ## Prepare your listing content Prepare the following content before you open the form: * A heading of up to 100 characters that describes the integration. * A **Subtitle description** of up to 65 characters. * A description of up to 500 characters. * Your company website URL, documentation URL, and FAQ URL. * A redirect URL where operators start your app's connection or setup flow. * One or two categories that match the integration. * One to five screenshots. Use landscape PNG or JPEG images, 1280 to 1920 pixels wide and 720 to 1080 pixels tall. Each image must be smaller than 16 MB. You can also add up to five bullet points of 50 characters each. Use the redirect URL for the start of your connection flow, not your OAuth callback. The callback belongs in the application's redirect URI configuration. Operators still need to complete your setup and consent flow after they leave the listing. Follow the [third-party naming rules](/2025-09/guides/third-party-plugin-naming) in the listing's copy and images. ## Create a draft 1. In the [Developer Portal](https://developer.stora.co), open **My applications**. 2. Open the test application and select **Listing**. This tab manages listings for its live counterpart. 3. Click **Create listing**. 4. Enter the prepared copy and URLs. 5. Select the categories. 6. Upload the screenshots. 7. Click **Create Listing**. If the form shows a **Video** field, you can also upload an MP4. Video availability depends on your portal configuration. The saved listing is a draft. Saving does not publish it to the marketplace. ## Submit the draft for review 1. Review the draft's copy, screenshots, categories, and links. 2. Open the redirect URL and check that it starts the intended setup flow. 3. Click **Submit for approval**. While the listing is in review, you cannot edit it. The portal shows that the draft review is in progress and emails you when there is news. If the reviewer requests changes, read **Reviewer notes**, edit the draft, and submit it again. Once approved, the live listing is available on the marketplace. > [!NOTE] > > Approving the application does not publish a listing. Approving a listing does not grant any operator API access. Each operator must complete the app's connection flow. ## Update a published listing 1. Return to the test application's **Listing** tab. 2. Edit the draft listing, not the live version. 3. Save the changes. 4. Review the changes shown in the portal. 5. Click **Request approval for changes** and submit the updated listing. The published version remains separate from the draft. Draft edits do not change the marketplace listing until those edits are approved and published. Changes to application settings, such as scopes or OAuth redirect URIs, use the [application review process](/2025-09/guides/partner-integrations#publish-application-changes), not the listing review process. # Requests Source: https://docs.stora.co/2025-09/guides/requests Request formats, idempotency, and rate limiting for the Stora Public API. ## Request formats The API supports only **JSON** requests. You must specify the format using the `Content-Type` header. ```bash theme={null} curl -X POST "https://public-api.stora.co/2025-09/contacts" \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' \ -d '{"full_name": "John Doe"}' ``` ## Idempotent requests The API supports [idempotency](https://developer.mozilla.org/en-US/docs/Glossary/Idempotent) for `POST` requests to versioned endpoints, such as `/2025-09/contacts`. OAuth 2 endpoints and `PATCH` and `DELETE` requests ignore the `Idempotency-Key` header. To make an idempotent `POST` request, provide an additional `Idempotency-Key: ` header. The key should be a unique value — a generated [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) is a good choice. ```bash theme={null} curl -X POST "https://public-api.stora.co/2025-09/contacts" \ -H 'accept: application/json' \ -H 'content-type: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' \ -H 'idempotency-key: UNIQUE_KEY' \ -d '{"full_name": "John Doe"}' ``` ### How it works When a request with a new idempotency key succeeds, the API stores its response for 24 hours. If you send the same key again within that period, the API returns the stored response, including its original `request_id`, without processing the request again. The API doesn't store failed responses, so you can retry a failed request with the same key. If you send the same key while the first request is still being processed, the API returns `409 Conflict` with the code [`idempotency_conflict`](/2025-09/guides/errors#idempotency_conflict). Wait for the first request to finish, then retry with the same key. Keys are scoped to your operator, aren't case-sensitive, and ignore leading and trailing whitespace. The API doesn't compare the request body or path, so a key reused for a different request returns the first request's response. Use a new key for each request. After 24 hours, the stored response expires, and the next request with that key is processed as new. ## Rate limiting The API uses rate limiting to ensure fair usage and maintain performance. The default rate limit is: * **10 requests per second** * **60 requests per minute** Limits apply per operator, not per access token or application. All integrations accessing the same operator share its quota; different operators have separate quotas. These limits may vary based on the operator's subscription plan or specific agreements with Stora. ### Handling rate limits If you exceed the rate limit, the API responds with a `429 Too Many Requests` status code. The response includes headers with your current rate limit status: | Header | Description | | - | - | | `RateLimit-Limit` | The maximum number of requests allowed in the current time window | | `RateLimit-Reset` | The time at which the current rate limit window resets in UTC epoch seconds | The error code is [`too_many_requests`](/2025-09/guides/errors#too_many_requests). # Responses Source: https://docs.stora.co/2025-09/guides/responses Response formats, expanding, selecting fields, pagination, and links in the Stora Public API. ## Response formats The API supports JSON, CSV, and PDF response formats. Specify your preferred format using the `Accept` header. > [tab] JSON > > ```bash theme={null} > curl -X GET "https://public-api.stora.co/2025-09/contacts" \ > -H 'accept: application/json' \ > -H 'authorization: Bearer ACCESS_TOKEN' > ``` > [tab] CSV > > ```bash theme={null} > curl -X GET "https://public-api.stora.co/2025-09/contacts" \ > -H 'accept: text/csv' \ > -H 'authorization: Bearer ACCESS_TOKEN' > ``` > [tab] PDF > > > [!NOTE] > > > > PDF format is only supported for specific resources such as Invoices and Credit Notes. The endpoint returns a `406 Not Acceptable` if the content cannot be returned in PDF format. > > ```bash theme={null} > curl -X GET "https://public-api.stora.co/2025-09/invoices/inv_195h6kfm9ro15lof" \ > -H 'accept: application/pdf' \ > -H 'authorization: Bearer ACCESS_TOKEN' > ``` ## Expanding responses Some endpoints support expanding nested objects in the response using the `expand` query parameter. You can expand multiple objects with a comma-separated list, and use dot notation for nested objects. For example, when retrieving an order, you can expand the `contact`, `line_items`, and `line_items.item`: ```bash theme={null} curl -X GET "https://public-api.stora.co/2025-09/orders?expand=contact,line_items,line_items.item" \ -H 'accept: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' ``` You can find examples of fully expanded responses in the "Show a \" endpoints. > [!NOTE] > > For each expanded resource, ensure the access token has read scope for that resource. For example, when expanding the `site` on `subscription`, the `public.site:read` scope is required. ## Selecting fields Use the `fields` query parameter to return only the fields you need. It works on every endpoint that returns a resource or a list, including create and update endpoints. For example, create an order and get back only its ID: ```bash theme={null} curl -X POST "https://public-api.stora.co/2025-09/orders?fields=id" \ -H 'accept: application/json' \ -H 'authorization: Bearer ACCESS_TOKEN' \ -H 'content-type: application/json' \ -d '{ ... }' ``` ```json theme={null} { "order": { "id": "order_0c5f5a3cfe9e5b2a" }, "meta": { ... } } ``` * Separate fields with commas. Use dot notation for nested fields, such as `site.name`. * Identifiers and constant fields, such as `object`, are always returned. * A field inside an expandable object also needs that object in `expand`, for example `?expand=site&fields=id,site.name`. * On list endpoints, `fields` applies to each item. Pagination metadata is always returned. * `fields=*` returns every field and can't be combined with other fields. * Endpoints that return only a success message, such as deletes, and PDF responses ignore `fields`. > [!WARNING] > > An unknown field, or a field inside an object that isn't expanded, returns a `422 Unprocessable Content` error with the code [`invalid_url_param`](/2025-09/guides/errors#invalid_url_param) before the request changes anything. ## Pagination List endpoints are paginated. The defaults are: * **50 items per page** by default * **100 items per page** maximum (set via the `limit` query parameter) * Use the `page` query parameter to navigate through pages Pagination data (`count`, `last`, `limit`, `next`, `page`, `pages`, and `prev`) is returned in the response's `meta/pagination` field. ## Links Some resources include a `_links` field containing [HATEOAS](https://en.wikipedia.org/wiki/HATEOAS)-style links. These provide URLs to related actions or pages, such as signing a contract on the storefront or starting a new booking for a unit type. ### Structure Each link is keyed by a namespaced relation name and contains an `href` (relative path) and a human-readable `title`: ```json theme={null} { "unit_type": { "id": "utype_f18fc91387cdf710", "name": "5x5 Storage Unit", "_links": { "sf:new_order": { "href": "/sites/belfast-self-storage/5x5-unit/order/contact-details?unit_type_slug=5x5-unit", "title": "New order" } } } } ``` ### CURIEs Link relation names use a [CURIE](https://www.w3.org/TR/curie/) (Compact URI) prefix to indicate which application the link points to: | Prefix | Application | Example | | - | - | - | | `sf` | Storefront (customer-facing booking site) | `sf:new_order` | | `bo` | Backoffice (operator dashboard) | `bo:view_contact` | The `meta` object includes a `curies` array that maps each prefix to a URL template. To resolve a full URL, replace `{rel}` in the CURIE `href` with the link's `href`: ```json theme={null} { "meta": { "curies": [ { "name": "bo", "href": "https://app.stora.co{rel}", "templated": true, "title": "Backoffice" }, { "name": "sf", "href": "https://acme.stora.co{rel}", "templated": true, "title": "Storefront" } ] } } ``` For example, a link `sf:new_order` with `href` `/sites/belfast/5x5-unit/order/contact-details?unit_type_slug=5x5-unit` resolves to: ``` https://acme.stora.co/sites/belfast/5x5-unit/order/contact-details?unit_type_slug=5x5-unit ``` ### Conditional links Links can be conditional — they only appear when the action is available. For example: * A **contract** only has `sf:show_contract` when it is not voided or deleted * A **unit type** only has `sf:new_order` when its status is `bookable` When no links are available, the `_links` field is an empty object `{}`. # Migrating to site-scoped protection levels Source: https://docs.stora.co/2025-09/guides/site-scoped-protection-levels Update protection listings, pricing, and new line items to use site-specific IDs while preserving historical references. Protection levels now belong to individual sites. The rollout is complete for all accounts. Each site level has its own ID, prices, and Stripe product. Global levels remain readable for historical references, but you cannot select them for new order or deal protection line items. Use this guide to update an integration that still lists, stores, or submits global protection level IDs. > [!WARNING] > > This migration changed behavior within API version `2025-09`. Pinning that version does not restore the global catalogue or allow global IDs on new line items. See the [versioning exception](/2025-09/guides/api-versioning#compatibility-within-a-version). ## Before you start Use a token with `public.protection_level:read` to list protection levels. Base-price updates require `public.protection_level:write`. Order and deal changes require their respective write scopes. Identify any global protection IDs in your configuration, local cache, or order-building code. Keep historical references separate from the catalogue you use for new selections. ## Step 1: Refresh your protection catalogue List the current site-scoped levels: ```text theme={null} GET /2025-09/protection_levels ``` The collection contains only site levels. You do not need the temporary `site_scoped=true` migration parameter. Remove it from requests that still send it. To list levels for a specific site, use `site_id`: ```text theme={null} GET /2025-09/protection_levels?site_id=site_14b419f1096013f1 ``` You can pass multiple site IDs as a comma-separated list: ```text theme={null} GET /2025-09/protection_levels?site_id=site_3e6ffcb963dc4b49,site_76cc3340ef180e55 ``` Replace the example IDs with your own site IDs. Fetch every page and update your local catalogue with the returned protection IDs and site relationships. ### Read the site relationship A site level identifies its site in the `site` field. For example: ```json theme={null} { "id": "plvl_e8f3ad0a07e47566", "cover_level": { "amount": 2000000, "currency": "GBP", "formatted": "£20,000.00" }, "prices": [ { "billing_period": "weekly", "price": { "amount": 999, "currency": "GBP", "formatted": "£9.99" }, "stripe_price_id": "price_123" } ], "site": { "id": "site_14b419f1096013f1" }, "stripe_product_id": "prod_Sj6us30iGDiaXO", "public": true } ``` To include the site's full representation, expand the relationship: ```text theme={null} GET /2025-09/protection_levels?expand=site ``` Expansion also requires `public.site:read`. ## Step 2: Select protection for the order's site Resolve the site before selecting a protection level. Use an ID returned for that site, not a stored global ID or a level from another site. For example, an order's protection line item references a level belonging to the same site: ```json theme={null} { "site": { "id": "site_14b419f1096013f1" }, "line_items": [ { "type": "protection", "quantity": 1, "price": { "amount": 999 }, "item": { "id": "plvl_e8f3ad0a07e47566" } } ] } ``` This is a request excerpt, not a complete order. Include the other required fields and a unit type line item as described in [Building a booking flow](/2025-09/guides/booking-flow). Apply the same selection rule when you add protection through the order's line-item endpoint or submit a new protection line item in an order update. Global and wrong-site IDs return `422 Unprocessable Content` with an item-not-found error. For deals, select protection belonging to the deal's site. Creating a deal or resubmitting protection in a deal update with a global or wrong-site ID returns `404 Not Found`. ## Step 3: Update base-price requests Use the site level's ID when you change base prices: ```text theme={null} POST /2025-09/protection_levels/{id}/base_price ``` Replace `{id}` with the site-scoped protection ID. A global ID returns `409 Conflict` with this message: ```text theme={null} Global protection-level base prices cannot be updated. Use a site-scoped protection-level ID. ``` Update each site's level separately. Do not rely on changes to a global level being mirrored across sites. > [!WARNING] > > Do not archive a site's protection products or prices in Stripe just because they resemble products at another site. Each site level has its own Stripe product and prices. ## Step 4: Preserve historical references Existing orders, deals, and subscriptions can still reference global protection levels. Do not replace those stored references merely to refresh your catalogue for new selections. You can still retrieve an individual global level by ID: ```text theme={null} GET /2025-09/protection_levels/{id} ``` A global level has `site: null`. It does not appear in the protection-level collection. For existing orders, unrelated updates preserve historical global references. You can also update an existing protection line item's price without changing its referenced level. Adding a new protection line item still requires a same-site level. For existing deals, unrelated updates preserve historical global references. If you resubmit the protection selection, use a same-site level instead of the global ID. ## Step 5: Update webhook handling The event names are unchanged: ```text theme={null} protection_level.created protection_level.updated ``` These events describe site levels. Global levels do not emit these events. Use the protection ID and its `site` relationship to update the correct local record. Do not treat a price change at one site as an update to every site's levels. After updating your handler, refresh the site-scoped catalogue to reconcile any global records cached before the migration. Follow the [data synchronisation guidance](/2025-09/guides/data-synchronisation) to retain events during the refresh. ## Verify your integration Before deploying your changes, check the following behavior: * Your catalogue contains site-scoped IDs and retains their site relationships. * New order and deal protection selections belong to the selected site. * New selections do not reuse global IDs from historical records. * Base-price requests use site-level IDs. * Historical global references remain readable and are not rewritten by unrelated updates. * Protection webhooks update the affected site's record. ## Getting help Email [api_support@stora.co](mailto:api_support@stora.co) with your account name and the requests you need help updating. > [card] [Booking flow](/2025-09/guides/booking-flow) > > Use site-level protection in an order. > [card] [Webhooks](/2025-09/guides/webhooks) > > Configure and verify protection event deliveries. # Create a test operator Source: https://docs.stora.co/2025-09/guides/test-operators Create an operator for development, prepare test data, and choose credentials for your integration. Use a test operator to build and test your integration without connecting a real operator account. Test operators belong to your developer company. ## Before you start Sign in to the [Developer Portal](https://developer.stora.co). To create an operator, you need the **Admin** role in your developer company. The portal shows how many test operators your company has used and its current limit. If the company has reached that limit, contact Stora before creating another operator. ## Create the operator 1. Open **Test operators**. 2. Click **New operator**. 3. Select the **Country**. 4. Check the **Timezone** and **Locale** for that country. Choose values that match the behavior you need to test. 5. Click **Create operator**. The operator appears in the list. Your company's test partner applications can use it automatically. You do not need an operator testing invitation. ## Prepare test data 1. In the operator's **Actions** menu, click **Open Backoffice**. 2. Check the sites, unit types, and units available to your test operator. Add or configure the records your integration needs in Backoffice. 3. If you test a booking journey, return to **Test operators** and click **Open Storefront** to inspect the customer-facing flow. Keep test data separate from production data. Use fictional contact details and test credentials in your development environment. > [!NOTE] > > Creating a test operator does not connect a real operator or grant access to a real operator's data. For an integration you manage on an operator's behalf, [connect an account](/2025-09/guides/connect-account). For a pilot of a partner app, [invite the operator to test that app](/2025-09/guides/partner-integrations#invite-a-real-operator-to-test). ## Create credentials Choose the authentication flow that your production integration uses. * For an Access Token or Client Credentials integration, click **Manage credentials** in the operator's **Actions** menu. Follow [API credentials](/2025-09/guides/managed-account-authentication) to create credentials with the scopes you need. * For a partner integration, create a test app under **My applications**. Use that app's credentials in the [Authorization Code flow](/2025-09/guides/authentication#option-c-oauth-2-0-%E2%80%94-authorization-code), then authorise the test operator. Do not substitute an Access Token for the flow you need to test. Store credentials on your backend, outside source control. Keep test app credentials separate from live app credentials. ## Verify access [Make your first request](/2025-09/guides/first-request) with the test operator's credentials. Confirm that the response contains the operator and records you expect before testing writes. If your integration receives events, configure a [webhook endpoint](/2025-09/guides/webhooks) for this operator. A webhook endpoint for a different operator does not cover this one. # Naming third-party plugins Source: https://docs.stora.co/2025-09/guides/third-party-plugin-naming Rules for naming third-party plugins, extensions, and integrations that work with Stora. When you publish a plugin, extension, or packaged integration that works with Stora, use your own product name. You may reference Stora to describe compatibility, but your name must not imply that Stora built, owns, operates, or endorses the integration. These rules are part of the [partner integration requirements](/2025-09/guides/partner-integrations). > [!WARNING] > > Do not name your plugin `Stora`, start the name with `Stora`, or combine > `Stora` with another word. Names such as `Stora Connect`, `StoraWP`, `Stora > Booking`, and `Stora Lead Sync` are not allowed for third-party plugins. ## Naming rules ### Use a distinct product name Your plugin needs its own name. The product name should be distinct from Stora and from Stora product names. | Not allowed | Allowed | | - | - | | `Stora Sync` | `SpaceSync for Stora` | | `Stora Lead Sync` | `Move-In Automations for Stora` | | `Stora WordPress Plugin` | `Self Storage Lead Sync for Stora` | | `Stora Booking` | `Storage Site Connector for Stora` | ### Use Stora only to describe compatibility Use Stora in a referential phrase that explains what your plugin works with. Good patterns: * `[Your product name] for Stora` * `[Your product name] integrates with Stora` * `[Your product name] is compatible with Stora` * `[Your product name] works with Stora` Avoid names where Stora is the main product name, the first word, or part of a new combined word. ### Do not imply official status Do not use words that suggest Stora has built, certified, approved, or endorsed your plugin unless you have written approval from Stora. Avoid: * `official` * `certified` * `approved` * `by Stora` * `Stora partner plugin` * `Stora recommended` > [!NOTE] > > You can say that your plugin integrates with Stora. You cannot say or imply > that your plugin is a Stora product. ### Keep your brand primary Your plugin listing, website, icon, screenshots, and admin UI should make your brand the primary identity. Stora can appear as the platform your plugin connects to, but not as the plugin's brand. Do not use the Stora logo as your plugin icon, marketplace icon, app logo, or primary visual identity unless Stora gives written approval. ## Describing your plugin Use plain language that explains what your integration does. Good examples: * `SpaceSync connects your WordPress site to Stora.` * `Move-In Automations for Stora syncs booking events into your marketing tools.` * `Self Storage Lead Sync for Stora sends website enquiries into your Stora account.` Avoid descriptions that imply Stora owns or operates the plugin: * `The Stora plugin for WordPress` * `Official Stora booking extension` * `Stora's lead sync tool` ## Required disclaimer Include a disclaimer anywhere operators may otherwise assume the plugin is operated by Stora, such as marketplace listings, setup pages, and public documentation. ```text theme={null} This plugin is provided by [Partner Name] and is not built, owned, or operated by Stora. ``` You may adapt the wording to match your product, but keep the meaning clear. ## Examples | Scenario | Use this | Do not use this | | - | - | - | | WordPress plugin that syncs leads | `LeadBridge for Stora` | `Stora Leads` | | Booking widget extension | `Booking Widget for Stora` | `Stora Booking Widget` | | Analytics connector | `StoreTrack Analytics for Stora` | `Stora Analytics` | | Access control integration | `GateLink for Stora` | `Stora GateLink` | | General connector | `Connector for Stora` | `StoraConnect` | ## Review checklist Before you publish, check that: * Your plugin has its own distinct name. * The name does not start with `Stora`. * The name does not combine `Stora` with another word, abbreviation, or suffix. * Stora is used only to describe compatibility, such as `for Stora` or `integrates with Stora`. * Your listing does not imply the plugin is official, certified, approved, or built by Stora. * Your logo and icon use your own brand, not the Stora logo. * Your listing includes a clear third-party disclaimer. > [!TIP] > > If your preferred name follows the pattern `[Your product name] for Stora`, it > is usually a good starting point. ## If you are unsure Send us the proposed plugin name, marketplace listing title, icon, and short description before you publish. It is easier to fix naming before launch than after operators have installed the plugin. # Record integration activity Source: https://docs.stora.co/2025-09/guides/timeline-events Create a Timeline Event that records an action from your integration on a Stora timeline. Record actions from your integration as Timeline Events so operators can see what happened in Stora. An event can link to a contact, site, subscription, tenancy, unit, invoice, or unit type. This guide records an outbound call against a contact. ## Before you start You need: * An access token with `public.timeline_event:write`. You do not need source or template read scopes to create events with known IDs. * The source and template IDs for your integration. Follow the setup below for either a partner app or a custom operator integration. For the outbound-call example in this guide, you also need the ID of a contact in the connected operator's account. Other event types use the references required by their template. To run this guide's `curl` examples, set `STORA_ACCESS_TOKEN` in your shell to your access token. `STORA_ACCESS_TOKEN` is an example variable name, not an API requirement. ## Choose your integration's setup A Timeline Source identifies your integration on the operator's timeline. A Timeline Template defines the event's message and variables. Source setup differs between partner apps and custom integrations built for one operator. > [tab] Partner app > > Ask Stora to create a global source for your integration before you release it. Stora provides a source ID that you can hardcode in your integration. The source is available to all operators, so use the same ID across all operator connections. You do not need to create or discover a source for each operator. > > Agree with Stora on the templates that fit the actions your integration records. If no existing template fits your use case, request one in advance. > > Hardcode the agreed template IDs in your integration. Map each supported action to its intended template. Do not accept arbitrary source or template IDs from operators or incoming requests, and do not discover templates at runtime. > > > [!WARNING] > > > > Do not include template-related scopes in your partner application's requested scopes, including `public.timeline_template:read`. Use hardcoded template IDs to limit the integration to its intended events and prevent template misuse. > [tab] Operator integration > > For an operator's own integration, create a custom source in that operator's Backoffice. You do not need Stora to provision a global source. > > 1. In **Settings**, open **Developers**, then **Timeline events**. > 2. Under **Sources**, click **Edit**. > 3. Click **Add Source**. > 4. Enter the integration's **Name**. Optionally add an **Icon** and **Website URL**. > 5. Click **Create Source**. > > The custom source is available only to the operator where you created it. Save its ID in that operator's integration configuration. Do not reuse the ID for another operator. > > To retrieve the source ID during setup, use [List all Sources](/2025-09/api-reference/timeline-sources/list-all-sources) with a credential that has `public.timeline_source:read`. > > For templates, return to **Timeline events** and click **View** under **Templates** to browse the shared template library. Creating a custom source does not create an operator-specific template. If no template fits your use case, ask Stora for one. > > To retrieve a template ID during setup, use [List all Templates](/2025-09/api-reference/timeline-templates/list-all-templates) with `public.timeline_template:read`. Save the chosen ID in the integration's configuration. Source and template read scopes are not required for event creation once you have the IDs. ## Prepare the example's event data For the **Outbound call** template used below, provide the `contact` reference. You can also supply a `duration` string in `variables`. Other templates can require references such as a unit, subscription, or invoice. Check the references and variables for your chosen template. For a partner app, confirm these requirements with Stora during setup. Creating an event with a missing required reference fails. Custom variables can be incomplete on creation, but omitted values can leave the rendered message incomplete. Supply the values needed to describe the action. ## Create the event Generate an idempotency key once for this action: ```bash theme={null} EVENT_KEY="$(uuidgen)" ``` Replace `tsrc_REPLACE` with the source ID for your integration's setup and `aetpl_REPLACE` with the **Outbound call** template ID. For a partner app, use the hardcoded IDs agreed with Stora. For a custom operator integration, use the IDs saved in its configuration. Replace `con_REPLACE` with the contact ID for this example and the external record details with your own record ID and URL. ```bash theme={null} curl --request POST \ 'https://public-api.stora.co/2025-09/timeline/events' \ --header "Authorization: Bearer $STORA_ACCESS_TOKEN" \ --header 'Content-Type: application/json' \ --header "Idempotency-Key: $EVENT_KEY" \ --data '{ "source": {"id": "tsrc_REPLACE"}, "template": {"id": "aetpl_REPLACE"}, "contact": {"id": "con_REPLACE"}, "description": "Discussed the requested move-in date.", "variables": {"duration": "2 minutes"}, "external": { "id": "call_123", "url": "https://example.com/calls/call_123" } }' ``` A successful request returns `201` with an `event` object. Save `event.id` beside your originating record. Open the contact in Stora Backoffice and confirm that the call appears on its timeline with your source and external link. `description` adds a note alongside the template message. It does not replace the message. `external.id` identifies the record in your system, and `external.url` links to that record. ## Handle retries and corrections If the create request times out, retry with the same body and `EVENT_KEY`. Do not generate a new key for a retry. Use a different key for a different action. An external record ID is not a substitute for an [idempotency key](/2025-09/guides/requests#idempotent-requests). If you need to correct an event, use its saved ID with [Update an Event](/2025-09/api-reference/timeline-events/update-an-event). Updates validate required custom variables too, so preserve the values needed by the template. Only update or [delete](/2025-09/api-reference/timeline-events/delete-an-event) events that your integration is responsible for. For failed requests, inspect the [error response](/2025-09/guides/errors) before retrying. # Webhooks Source: https://docs.stora.co/2025-09/guides/webhooks Receive real-time notifications when events happen in Stora. Webhooks are HTTP callbacks that send real-time `POST` requests to your configured endpoints when specific events occur in Stora. When an event happens — such as an invoice being paid or a unit becoming occupied — Stora immediately notifies all endpoints subscribed to that event type. ## Getting started **1. Create a webhook endpoint** > [tab] Partner app > > Create an endpoint for each authorised operator through the [Webhook Endpoints API](/2025-09/api-reference/webhook-endpoints/create-a-webhook-endpoint), using your partner app's OAuth access token for that operator. This creates an app-managed endpoint. Do not use connected-account portal credentials to provision a partner app's endpoints. > [tab] Operator integration > > Use the [Developer Portal](/2025-09/guides/developer-portal) to manage endpoints for your test operator or connected operator account, including when you manage access on an operator's behalf. You can also create an endpoint through the [Webhook Endpoints API](/2025-09/api-reference/webhook-endpoints/create-a-webhook-endpoint) with that operator's credentials. For API creation, request `public.webhook_endpoint:write`. Add `public.webhook_endpoint:read` if you need to list or retrieve endpoints. Register a publicly accessible HTTPS URL, the event types you need, and the API version. **2. Store your secret key** When you create an endpoint, Stora generates a secret key. Store the endpoint ID and secret securely with the operator's integration configuration. You'll use the secret to verify incoming requests. **3. Handle incoming events** Build a handler that verifies the signature and durably enqueues the event before returning `2xx`. Process the event in a background worker. ## Receiving events for multiple operators This applies to partner apps and developers hosting integrations for several operator accounts. Delivery headers and the event envelope do not include an operator ID or endpoint ID, so your handler needs a local mapping to the correct endpoint and operator connection. 1. Register a connection-specific URL, or use an equivalent local routing mapping, to look up the endpoint's secret and operator connection. 2. Verify the signature with that secret. The URL or routing key alone does not authenticate the request. 3. Durably enqueue the event with the verified operator connection. Workers must use that connection's credentials for subsequent API calls, not whichever token was used most recently. Keep the endpoint ID and secret associated with the connection that created them. The payload and verification examples below are shared across integration types. ## Payload structure Every webhook delivers a JSON payload with this structure: ```json theme={null} { "event": { "id": "evt_1234567890", "type": "invoice.paid", "api_version": "2025-09", "created_at": "2025-01-15T10:30:00Z", "data": { "invoice": { // ... full invoice resource } } } } ``` | Field | Description | | - | - | | `event.id` | Unique identifier for the event — use this for idempotency | | `event.type` | The event type (e.g. `invoice.paid`, `contact.created`) | | `event.api_version` | Matches your endpoint's API version — determines the data structure | | `event.created_at` | ISO 8601 timestamp of when the event occurred | | `event.data` | The resource that triggered the event, keyed by resource type | ## Headers Every webhook request includes these headers: | Header | Description | | - | - | | `Content-Type` | `application/json` | | `User-Agent` | `Stora-Webhooks/1.0` | | `X-Stora-Signature` | HMAC signature for verification (see below) | | `X-Stora-Request-Id` | Unique ID for this delivery attempt — useful for debugging | ## Signature verification All webhook requests are signed using HMAC SHA256. Always verify the signature before processing. The signature is in the `X-Stora-Signature` header: ``` t={timestamp},v1={signature} ``` To verify: 1. Extract the timestamp (`t`) and signature (`v1`) from the header 2. Reconstruct the signed payload: `{timestamp}.{raw_request_body}` 3. Compute the HMAC SHA256 using your endpoint's secret key 4. Compare the computed signature with `v1` 5. Optionally, check the timestamp is recent to prevent replay attacks ```ruby Ruby theme={null} def verify_webhook_signature(request_body, signature_header, secret) parts = signature_header.split(',').map { |p| p.split('=').last } timestamp = parts[0] signature = parts[1] signed_payload = "#{timestamp}.#{request_body}" computed = OpenSSL::HMAC.hexdigest('SHA256', secret, signed_payload) computed == signature end ``` ```python Python theme={null} import hmac import hashlib def verify_webhook_signature(request_body, signature_header, secret): parts = signature_header.split(',') timestamp = parts[0].split('=')[1] signature = parts[1].split('=')[1] signed_payload = f"{timestamp}.{request_body}" computed = hmac.new( secret.encode('utf-8'), signed_payload.encode('utf-8'), hashlib.sha256 ).hexdigest() return hmac.compare_digest(computed, signature) ``` ```php PHP theme={null} function verifyWebhookSignature(string $requestBody, string $signatureHeader, string $secret): bool { $parts = explode(',', $signatureHeader); $timestamp = explode('=', $parts[0])[1]; $signature = explode('=', $parts[1])[1]; $signedPayload = "{$timestamp}.{$requestBody}"; $computed = hash_hmac('sha256', $signedPayload, $secret); return hash_equals($computed, $signature); } ``` ```javascript Node.js theme={null} const crypto = require('crypto'); function verifyWebhookSignature(requestBody, signatureHeader, secret) { const parts = signatureHeader.split(','); const timestamp = parts[0].split('=')[1]; const signature = parts[1].split('=')[1]; const signedPayload = `${timestamp}.${requestBody}`; const computed = crypto .createHmac('sha256', secret) .update(signedPayload) .digest('hex'); return crypto.timingSafeEqual( Buffer.from(computed), Buffer.from(signature) ); } ``` ## Retries Stora makes up to six delivery attempts: the initial attempt and five retries. Each delay below is measured from the preceding failed attempt, not from the initial delivery: | Attempt | Delay after the preceding failure | | - | - | | 2nd attempt (1st retry) | 5 minutes | | 3rd attempt (2nd retry) | 30 minutes | | 4th attempt (3rd retry) | 2 hours | | 5th attempt (4th retry) | 6 hours | | 6th attempt (5th retry) | 12 hours | The retry delays total approximately 20 hours 35 minutes after the initial attempt. Request duration and job scheduling can extend that period. A delivery is retried when your endpoint returns a non-`2xx` status code, a network error occurs, or the request times out (20-second limit). After 6 failed attempts, the delivery is marked as failed. Before each retry, Stora checks the endpoint. If the endpoint is deleted or still disabled, the delivery is cancelled. If you re-enable the endpoint before a retry is due, that retry is sent. ## Disconnecting and reconnecting Keep the IDs of endpoints your integration creates. During a disconnect you control, [delete those endpoints](/2025-09/api-reference/webhook-endpoints/delete-a-webhook-endpoint) before revoking or discarding the credentials needed to manage them. Credential revocation alone does not delete endpoints or guarantee that deliveries stop. On reconnection, [list existing endpoints](/2025-09/api-reference/webhook-endpoints/list-all-webhook-endpoints) and reconcile the IDs you saved before creating replacements. Manage only endpoints your integration owns, and avoid leaving duplicate subscriptions active. For partner apps, include this ordering in your [disconnect and uninstall flow](/2025-09/guides/partner-integrations#disconnect-and-reconnect). ## Best practices > [!TIP] > > Verify the signature and durably enqueue the event before returning `2xx`. If enqueueing fails, return a non-`2xx` response so Stora can retry. Complete this handoff within the 20-second request limit. * **Implement idempotency** — use `event.id` to ensure you don't process the same event twice. Store processed event IDs and check before processing. * **Process asynchronously** — durably enqueue the event before acknowledging delivery, then process it in a background worker. Once you return `2xx`, your worker must retry processing failures. Stora does not retry acknowledged deliveries. * **Log the request ID** — use `X-Stora-Request-Id` to correlate retry attempts when debugging. * **Validate signatures** — always verify the HMAC signature before processing. * **Monitor your endpoint** — extended downtime may exhaust all retry attempts. ## Available events > [accordion] Contact > > | Event | Description | > | - | - | > | [`contact.churned`](/2025-09/api-reference/webhooks/contactchurned) | Triggered when a contact churns. | > | [`contact.converted`](/2025-09/api-reference/webhooks/contactconverted) | Triggered when a contact converts to a customer. | > | [`contact.created`](/2025-09/api-reference/webhooks/contactcreated) | Triggered when a contact is created. | > | [`contact.updated`](/2025-09/api-reference/webhooks/contactupdated) | Triggered when the contact is updated. | > [accordion] Contract > > | Event | Description | > | - | - | > | [`contract.created`](/2025-09/api-reference/webhooks/contractcreated) | Triggered when a contract is created. | > | [`contract.signed`](/2025-09/api-reference/webhooks/contractsigned) | Triggered when a contract is signed. | > [accordion] Coupon > > | Event | Description | > | - | - | > | [`coupon.created`](/2025-09/api-reference/webhooks/couponcreated) | Triggered when a coupon is created. | > | [`coupon.updated`](/2025-09/api-reference/webhooks/couponupdated) | Triggered when the coupon is updated. | > [accordion] Credit Note > > | Event | Description | > | - | - | > | [`credit_note.created`](/2025-09/api-reference/webhooks/credit_notecreated) | Triggered when a new credit is created. | > | [`credit_note.updated`](/2025-09/api-reference/webhooks/credit_noteupdated) | Triggered when a credit note is updated. | > [accordion] Deal > > | Event | Description | > | - | - | > | [`deal.created`](/2025-09/api-reference/webhooks/dealcreated) | Triggered when a deal is created. | > | [`deal.lost`](/2025-09/api-reference/webhooks/deallost) | Triggered when a deal is lost. | > | [`deal.reopened`](/2025-09/api-reference/webhooks/dealreopened) | Triggered when a deal is reopened | > | [`deal.stage_changed`](/2025-09/api-reference/webhooks/dealstage_changed) | Triggered when a deal's stage changes. Fires on every stage transition, including the first time a deal enters its initial stage on creation. In that case, this event is emitted alongside `deal.created`. | > | [`deal.updated`](/2025-09/api-reference/webhooks/dealupdated) | Triggered when a deal is updated. | > | [`deal.won`](/2025-09/api-reference/webhooks/dealwon) | Triggered when a deal is won. | > [accordion] Identity Verification > > | Event | Description | > | - | - | > | [`identity_verification.cancelled`](/2025-09/api-reference/webhooks/identity_verificationcancelled) | Triggered when an identity verification is cancelled | > | [`identity_verification.failed`](/2025-09/api-reference/webhooks/identity_verificationfailed) | Triggered when an identity verification failed | > | [`identity_verification.processing`](/2025-09/api-reference/webhooks/identity_verificationprocessing) | Triggered when an identity verification is processing | > | [`identity_verification.succeeded`](/2025-09/api-reference/webhooks/identity_verificationsucceeded) | Triggered when an identity verification succeeded | > [accordion] Invoice > > | Event | Description | > | - | - | > | [`invoice.created`](/2025-09/api-reference/webhooks/invoicecreated) | Triggered when a new invoice is created. | > | [`invoice.finalized`](/2025-09/api-reference/webhooks/invoicefinalized) | Triggered when an invoice is finalized. | > | [`invoice.marked_uncollectible`](/2025-09/api-reference/webhooks/invoicemarked_uncollectible) | Triggered when an invoice is marked as uncollectible. | > | [`invoice.overdue`](/2025-09/api-reference/webhooks/invoiceoverdue) | Triggered when an invoice becomes overdue for payment. | > | [`invoice.paid`](/2025-09/api-reference/webhooks/invoicepaid) | Triggered when an invoice is mark as paid. | > | [`invoice.payment_failed`](/2025-09/api-reference/webhooks/invoicepayment_failed) | Triggered when an invoice payment fails. | > | [`invoice.updated`](/2025-09/api-reference/webhooks/invoiceupdated) | Triggered when an invoice is updated. | > [accordion] Note > > | Event | Description | > | - | - | > | [`note.created`](/2025-09/api-reference/webhooks/notecreated) | Triggered when a note is created. | > | [`note.updated`](/2025-09/api-reference/webhooks/noteupdated) | Triggered when a note is updated. | > [accordion] Opportunity > > | Event | Description | > | - | - | > | [`opportunity.archived`](/2025-09/api-reference/webhooks/opportunityarchived) | Triggered when an opportunity is archived. | > | [`opportunity.associated`](/2025-09/api-reference/webhooks/opportunityassociated) | Triggered when an opportunity is associated with a deal. | > | [`opportunity.created`](/2025-09/api-reference/webhooks/opportunitycreated) | Triggered when an opportunity is created. | > | [`opportunity.deleted`](/2025-09/api-reference/webhooks/opportunitydeleted) | Triggered when an opportunity is deleted. | > | [`opportunity.unarchived`](/2025-09/api-reference/webhooks/opportunityunarchived) | Triggered when an opportunity is unarchived. | > | [`opportunity.updated`](/2025-09/api-reference/webhooks/opportunityupdated) | Triggered when an opportunity is updated. | > [accordion] Order > > | Event | Description | > | - | - | > | [`order.abandoned`](/2025-09/api-reference/webhooks/orderabandoned) | Triggered when an order is abandoned. | > | [`order.completed`](/2025-09/api-reference/webhooks/ordercompleted) | Triggered when the order is completed. | > | [`order.created`](/2025-09/api-reference/webhooks/ordercreated) | Triggered when a new order is created. | > | [`order.finalized`](/2025-09/api-reference/webhooks/orderfinalized) | Triggered when a new order is finalized (ready to be paid). | > [accordion] Price Adjustment > > | Event | Description | > | - | - | > | [`price_adjustment.cancelled`](/2025-09/api-reference/webhooks/price_adjustmentcancelled) | Triggered when a price adjustment is cancelled and will not be applied. | > | [`price_adjustment.created`](/2025-09/api-reference/webhooks/price_adjustmentcreated) | Triggered when a price adjustment is created, as either a draft or scheduled. | > | [`price_adjustment.failed`](/2025-09/api-reference/webhooks/price_adjustmentfailed) | Triggered when a price adjustment could not be applied and will not fire. | > | [`price_adjustment.invoiced`](/2025-09/api-reference/webhooks/price_adjustmentinvoiced) | Triggered when the adjusted price has landed on a finalized invoice. `invoice` is now populated. | > | [`price_adjustment.rescheduled`](/2025-09/api-reference/webhooks/price_adjustmentrescheduled) | Triggered when Stora moves `adjust_on` to the next billing date at apply time because the subscription was not due to renew on the scheduled date. | > | [`price_adjustment.scheduled`](/2025-09/api-reference/webhooks/price_adjustmentscheduled) | Triggered when a price adjustment is scheduled, either at creation or when a draft is promoted. The adjustment will now be applied on `adjust_on`. | > | [`price_adjustment.updated`](/2025-09/api-reference/webhooks/price_adjustmentupdated) | Triggered when a draft or scheduled price adjustment is updated. | > [accordion] Protection Level > > | Event | Description | > | - | - | > | [`protection_level.created`](/2025-09/api-reference/webhooks/protection_levelcreated) | Triggered when a protection level is created. | > | [`protection_level.updated`](/2025-09/api-reference/webhooks/protection_levelupdated) | Triggered when a protection level is updated. | > [accordion] Subscription > > | Event | Description | > | - | - | > | [`subscription.cancelled`](/2025-09/api-reference/webhooks/subscriptioncancelled) | Triggered when the subscription is cancelled. | > | [`subscription.created`](/2025-09/api-reference/webhooks/subscriptioncreated) | Triggered when the subscription is created. | > | [`subscription.ended`](/2025-09/api-reference/webhooks/subscriptionended) | Triggered when the subscription is ended. | > | [`subscription.resumed`](/2025-09/api-reference/webhooks/subscriptionresumed) | Triggered when a cancellation is undone and the subscription is resumed. | > | [`subscription.started`](/2025-09/api-reference/webhooks/subscriptionstarted) | Triggered when the subscription is started. | > [accordion] Task > > | Event | Description | > | - | - | > | [`task.completed`](/2025-09/api-reference/webhooks/taskcompleted) | Triggered when the task is completed. | > | [`task.created`](/2025-09/api-reference/webhooks/taskcreated) | Triggered when a task is created. | > | [`task.reopened`](/2025-09/api-reference/webhooks/taskreopened) | Triggered when a completed task is reopened. | > | [`task.updated`](/2025-09/api-reference/webhooks/taskupdated) | Triggered when a task is updated. | > [accordion] Tenancy > > | Event | Description | > | - | - | > | [`tenancy.auto_reservation.failed`](/2025-09/api-reference/webhooks/tenancyauto_reservationfailed) | Triggered when no requested units can be automatically reserved for a tenancy. | > | [`tenancy.auto_reservation.partially_succeeded`](/2025-09/api-reference/webhooks/tenancyauto_reservationpartially_succeeded) | Triggered when some, but not all, requested units are automatically reserved for a tenancy. | > | [`tenancy.auto_reservation.succeeded`](/2025-09/api-reference/webhooks/tenancyauto_reservationsucceeded) | Triggered when all requested units are automatically reserved for a tenancy. | > | [`tenancy.created`](/2025-09/api-reference/webhooks/tenancycreated) | Triggered when a tenancy is created. | > | [`tenancy.started`](/2025-09/api-reference/webhooks/tenancystarted) | Triggered when the tenancy is started. | > [accordion] Unit > > | Event | Description | > | - | - | > | [`unit.available`](/2025-09/api-reference/webhooks/unitavailable) | Triggered when a unit is made available. | > | [`unit.created`](/2025-09/api-reference/webhooks/unitcreated) | Triggered when a unit is created. | > | [`unit.deallocated`](/2025-09/api-reference/webhooks/unitdeallocated) | Triggered when a unit is deallocated. | > | [`unit.occupied`](/2025-09/api-reference/webhooks/unitoccupied) | Triggered when a unit is occupied. | > | [`unit.overlocked`](/2025-09/api-reference/webhooks/unitoverlocked) | Triggered when a unit is overlocked. | > | [`unit.repossessed`](/2025-09/api-reference/webhooks/unitrepossessed) | Triggered when a unit is repossessed. | > | [`unit.reserved`](/2025-09/api-reference/webhooks/unitreserved) | Triggered when a unit is reserved. | > | [`unit.unavailable`](/2025-09/api-reference/webhooks/unitunavailable) | Triggered when a unit is made unavailable. | > | [`unit.updated`](/2025-09/api-reference/webhooks/unitupdated) | Triggered when a unit is updated. | > [accordion] Unit Type > > | Event | Description | > | - | - | > | [`unit_type.created`](/2025-09/api-reference/webhooks/unit_typecreated) | Triggered when a unit type is created. | > | [`unit_type.updated`](/2025-09/api-reference/webhooks/unit_typeupdated) | Triggered when a unit type is updated. | For full payload schemas, see the [Webhooks section in the API reference](/2025-09/api-reference/webhooks/). # Show a Product Source: https://docs.stora.co/2025-09/api-reference/products/show-a-product /2025-09/openapi.json get /2025-09/products/{product_id} Get one product with its charge type, prices and images. Expand `site` or `category` to include them. Required authorization scope: `public.product:read` # Create Base Price for the Protection Level Source: https://docs.stora.co/2025-09/api-reference/protection-levels/create-base-price-for-the-protection-level /2025-09/openapi.json post /2025-09/protection_levels/{protection_level_id}/base_price Set a site-scoped protection level's base price for one or more billing periods, such as `monthly` or `weekly`. Only that site's level changes, so update each site's level separately. A global level returns `409`. The new prices apply right away to new orders. Billing periods you leave out keep their prices, and existing subscriptions don't change. A `protection_level.updated` webhook fires. See [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). Required authorization scope: `public.protection_level:write` # List all Protection Levels Source: https://docs.stora.co/2025-09/api-reference/protection-levels/list-all-protection-levels /2025-09/openapi.json get /2025-09/protection_levels List protection levels, which cover a contact's stored goods up to `cover_level`. Each belongs to one site, and an order's `protection` line item must use a level from the order's site. Global levels (`site` is `null`) aren't listed. Filter by `site_id` and expand `site`. Use **List all Products** instead for other add-ons. See [Migrating to site-scoped protection levels](https://docs.stora.co/2025-09/guides/site-scoped-protection-levels). Required authorization scope: `public.protection_level:read` # Show a Protection Level Source: https://docs.stora.co/2025-09/api-reference/protection-levels/show-a-protection-level /2025-09/openapi.json get /2025-09/protection_levels/{protection_level_id} Get one protection level with its cover level and prices. Unlike **List all Protection Levels**, it also returns global levels (`site` is `null`), which older orders, deals and subscriptions may still reference but new orders can't use. Expand `site` to include it. Required authorization scope: `public.protection_level:read` # List all Sites Source: https://docs.stora.co/2025-09/api-reference/sites/list-all-sites /2025-09/openapi.json get /2025-09/sites List the operator's sites, the storage locations, with their address, access hours and images. Filter by name with `search` or by `metadata`. Pass a site's `id` as `site_id` to filter unit types, units and other lists to that site. Required authorization scope: `public.site:read` # Show a Site Source: https://docs.stora.co/2025-09/api-reference/sites/show-a-site /2025-09/openapi.json get /2025-09/sites/{site_id} Get one site with its address, access hours, directions and images. Required authorization scope: `public.site:read` # List all Staff Source: https://docs.stora.co/2025-09/api-reference/staff/list-all-staff /2025-09/openapi.json get /2025-09/staff List the operator's staff members, the people who use Stora to run the business. Staff removed from the operator aren't listed. Search by name or email with `search`. Use a staff member's `id` to assign a task or deal, or to filter tasks and deals by `assignee_id`. Staff are read-only in the API. Required authorization scope: `public.staff:read` # Show a Staff Member Source: https://docs.stora.co/2025-09/api-reference/staff/show-a-staff-member /2025-09/openapi.json get /2025-09/staff/{staff_id} Retrieve one staff member's name and email by ID, such as a task's or deal's `assignee`. Staff removed from the operator aren't found. Required authorization scope: `public.staff:read` # List all Subscriptions Source: https://docs.stora.co/2025-09/api-reference/subscriptions/list-all-subscriptions /2025-09/openapi.json get /2025-09/subscriptions List subscriptions. A subscription is the billing side of a rental, with its billing period, line items and current period. Every tenancy has one subscription. Use **List all Tenancies** for the units, site and dates that are rented. Filter by `contact_id`, `site_id`, `billing_period` or `cancellation_reason`, and expand `tenancy` or `contact`. See [Core concepts](https://docs.stora.co/2025-09/guides/core-concepts). Required authorization scope: `public.subscription:read` # Show a Subscription Source: https://docs.stora.co/2025-09/api-reference/subscriptions/show-a-subscription /2025-09/openapi.json get /2025-09/subscriptions/{subscription_id} Retrieve a subscription with its billing period, line items and current period. `cancelled`, `cancellation_reason` and `ends_at` show whether and when it ends. Expand `tenancy` for the rented units and dates, or `order` for the order it came from. Required authorization scope: `public.subscription:read` # Complete a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/complete-a-task /2025-09/openapi.json post /2025-09/tasks/{task_id}/complete Mark an open task as `completed`. Its `completed_at` is set to the current time, and a `task.completed` webhook fires. Completing an already completed task changes nothing. Use **Open a Task** to undo it, and **Update a Task** for any other change. Required authorization scope: `public.task:write` # Create a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/create-a-task /2025-09/openapi.json post /2025-09/tasks Create an open task. Only `title` is required. You can also set a `resource` (a unit, contact or subscription), a `site`, a due date and an assignee from **List all Staff**. A `task.created` webhook fires. Assigning a task through the API doesn't email the assignee. Send an `Idempotency-Key` header so a retried request doesn't create a duplicate. Required authorization scope: `public.task:write` # Delete a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/delete-a-task /2025-09/openapi.json delete /2025-09/tasks/{task_id} Permanently delete any task, including ones staff or other integrations created, along with its notes. No webhook fires. To close a task but keep it, use **Complete a Task** instead. Required authorization scope: `public.task:write` # List all Tasks Source: https://docs.stora.co/2025-09/api-reference/tasks/list-all-tasks /2025-09/openapi.json get /2025-09/tasks List the operator's tasks, newest first by default. Use `sort_by=due_at` to order them by due date. Filter by `status` (`open` or `completed`), `assignee_id` (`unassigned` for tasks with no assignee), `resource_id` (a unit, contact or subscription) or `due_after` and `due_before`, and expand `assignee`, `creator`, `resource` or `site` to fetch them in the same request. Required authorization scope: `public.task:read` # Open a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/open-a-task /2025-09/openapi.json post /2025-09/tasks/{task_id}/open Reopen a completed task. Its `status` returns to `open`, `completed_at` is cleared, and a `task.reopened` webhook fires. Opening a task that's already open changes nothing. Use **Complete a Task** to close it again. Required authorization scope: `public.task:write` # Show a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/show-a-task /2025-09/openapi.json get /2025-09/tasks/{task_id} Retrieve one task by its ID. Expand `assignee`, `creator`, `resource` or `site` to fetch them in the same request, and use **List all Notes** filtered by `resource_id` for the notes on it. Required authorization scope: `public.task:read` # Update a Task Source: https://docs.stora.co/2025-09/api-reference/tasks/update-a-task /2025-09/openapi.json patch /2025-09/tasks/{task_id} Change any task, including ones staff or other integrations created: title, description, due date, site, assignee or resource. Fields you leave out are unchanged, and `null` removes an optional one. A `task.updated` webhook fires unless only `metadata` changed. A new assignee isn't emailed. To change the status, use **Complete a Task** or **Open a Task** instead. Required authorization scope: `public.task:write` # List all Tenancies Source: https://docs.stora.co/2025-09/api-reference/tenancies/list-all-tenancies /2025-09/openapi.json get /2025-09/tenancies List tenancies. A tenancy records which contact rents which units at which site, from `starts_at` to `ends_at`. Stora creates one with its subscription, for example when an order completes. Use **List all Subscriptions** for the billing side. Filter by `contact_id`, `site_id` or date ranges such as `starts_after` and `ends_before`, and expand `unit_allocations` for the assigned units. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.tenancy:read` # Show a Tenancy Source: https://docs.stora.co/2025-09/api-reference/tenancies/show-a-tenancy /2025-09/openapi.json get /2025-09/tenancies/{tenancy_id} Retrieve a tenancy, which records who rents which units, where and when. Expand `unit_allocations` for the assigned units, `subscription` for its billing, or `order` for the order it came from (`null` if it wasn't booked through one). Use **Reserve a Unit** or **Grant Access to a Unit** to assign units. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.tenancy:read` # Create an Event Source: https://docs.stora.co/2025-09/api-reference/timeline-events/create-an-event /2025-09/openapi.json post /2025-09/timeline/events Record activity from an external system, such as a call, on the timelines of the records it references: a contact, site, subscription or tenancy, unit, invoice, or unit type. `source` identifies your integration and `template` sets the message. References the template requires must be given, but its custom `variables` aren't checked on creation. Send an `Idempotency-Key` header so a retried request doesn't create a duplicate. To add a free-text comment instead, use **Create a Note**. See [Record integration activity](https://docs.stora.co/2025-09/guides/timeline-events) to set up your source and templates. Required authorization scope: `public.timeline_event:write` # Delete an Event Source: https://docs.stora.co/2025-09/api-reference/timeline-events/delete-an-event /2025-09/openapi.json delete /2025-09/timeline/events/{event_id} Permanently delete a timeline event, removing it from every timeline it appears on. Any event recorded through the API can be deleted, not only your integration's, so delete only the events you created. Required authorization scope: `public.timeline_event:write` # Update an Event Source: https://docs.stora.co/2025-09/api-reference/timeline-events/update-an-event /2025-09/openapi.json patch /2025-09/timeline/events/{event_id} Replace a timeline event. Send the whole event, including `source` and `template`. References and values you leave out are removed. Unlike creation, an update checks the template's required custom `variables` and that at least one reference is given when the template needs one. Any API-recorded event can be changed, not only your integration's. See [Record integration activity](https://docs.stora.co/2025-09/guides/timeline-events). Required authorization scope: `public.timeline_event:write` # List all Sources Source: https://docs.stora.co/2025-09/api-reference/timeline-sources/list-all-sources /2025-09/openapi.json get /2025-09/timeline/sources List the timeline sources the operator can use: global sources Stora sets up for partner apps, and custom sources the operator creates in Stora for their own integrations (`global` tells them apart). Sources are read-only in the API. Pass a source's `id` as `source` in **Create an Event**. See [Record integration activity](https://docs.stora.co/2025-09/guides/timeline-events). Required authorization scope: `public.timeline_source:read` # Show a Source Source: https://docs.stora.co/2025-09/api-reference/timeline-sources/show-a-source /2025-09/openapi.json get /2025-09/timeline/sources/{source_id} Retrieve one timeline source by ID: a global source or one of the operator's custom sources. Required authorization scope: `public.timeline_source:read` # List all Templates Source: https://docs.stora.co/2025-09/api-reference/timeline-templates/list-all-templates /2025-09/openapi.json get /2025-09/timeline/templates List the timeline templates, which are shared by all operators and read-only. Each sets an event's message as an English Liquid template. `variables.predefined` lists the references the message can show. `variables.custom` lists the keys you pass in `variables` when you **Create an Event**. Partner apps should hardcode the template IDs agreed with Stora instead of listing templates. See [Record integration activity](https://docs.stora.co/2025-09/guides/timeline-events). Required authorization scope: `public.timeline_template:read` # Show a Template Source: https://docs.stora.co/2025-09/api-reference/timeline-templates/show-a-template /2025-09/openapi.json get /2025-09/timeline/templates/{template_id} Retrieve one timeline template by ID, with its message and `variables`. Check it before **Create an Event** to see which references and custom variables to send. Required authorization scope: `public.timeline_template:read` # List all Unit Allocations Source: https://docs.stora.co/2025-09/api-reference/unit-allocations/list-all-unit-allocations /2025-09/openapi.json get /2025-09/unit_allocations List unit allocations. Each allocation links a unit to the tenancy holding it. A unit has at most one allocation, and Stora deletes it when the unit is deallocated, so the list has only current allocations. Filter by `contact_id`, `tenancy_id`, `unit_id` or `site_id`, and expand `unit` or `tenancy`. Use **List all Units** instead to find units by status. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit_allocation:read` # Show a Unit Allocation Source: https://docs.stora.co/2025-09/api-reference/unit-allocations/show-a-unit-allocation /2025-09/openapi.json get /2025-09/unit_allocations/{unit_allocation_id} Retrieve a unit allocation, the link between a unit and the tenancy holding it, with `reserved_at` and `granted_access_at`. Expand `unit` or `tenancy` to include them. Required authorization scope: `public.unit_allocation:read` # Create Base Price for the Unit Type Source: https://docs.stora.co/2025-09/api-reference/unit-types/create-base-price-for-the-unit-type /2025-09/openapi.json post /2025-09/unit_types/{unit_type_id}/base_price Set the unit type's base price for one or more billing periods, such as `monthly` or `weekly`. The new prices apply right away to new orders. Billing periods you leave out keep their prices, and existing subscriptions don't change. If the unit type uses dynamic pricing and you change the price for the site's main billing period, Stora recalculates its dynamic prices. A `unit_type.updated` webhook fires. Required authorization scope: `public.unit_type:write` # List all Unit Types Source: https://docs.stora.co/2025-09/api-reference/unit-types/list-all-unit-types /2025-09/openapi.json get /2025-09/unit_types List unit types, the kinds of storage a contact can order, such as a 50 sq ft indoor unit. Archived unit types aren't listed. Filter by `site_id` or `status` (`bookable`, `lead_capture`, `hidden`). `live_prices` is the current price, including any dynamic price, for the site's main billing period. For another billing period, use that period's entry in `prices`. To check availability, use **List all Units** with `unit_type_id` and `status=available`. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.unit_type:read` # Show a Unit Type Source: https://docs.stora.co/2025-09/api-reference/unit-types/show-a-unit-type /2025-09/openapi.json get /2025-09/unit_types/{unit_type_id} Get one unit type with its prices, dimensions, selling points and images. An archived unit type returns `404`. `live_prices` is the current price, including any dynamic price, for the site's main billing period. For another billing period, use that period's entry in `prices`. Expand `site` or `promotion` to include them. Required authorization scope: `public.unit_type:read` # Deallocate a Unit Source: https://docs.stora.co/2025-09/api-reference/units/deallocate-a-unit /2025-09/openapi.json post /2025-09/units/{unit_id}/deallocate Release a `reserved`, `occupied`, `overlock` or `repossessed` unit from its tenancy. The unit becomes `available`, its unit allocation is deleted, and `unit.deallocated` and `unit.available` webhooks fire. If the site has an access control integration, Stora syncs the change to it. The tenancy and its subscription are unchanged. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit:write` # Grant Access to a Unit Source: https://docs.stora.co/2025-09/api-reference/units/grant-access-to-a-unit /2025-09/openapi.json post /2025-09/units/{unit_id}/grant_access Give a tenancy access to a unit now, before or after its start date. The unit must be `available`, or `reserved` for that tenancy. It becomes `occupied` and a `unit.occupied` webhook fires. If the site has an access control integration, Stora syncs the change to it. An `available` unit is allocated to the tenancy in the same step. If the tenancy hasn't started, `unit.reserved` fires before `unit.occupied`. If the start date has arrived and no move-in requirements are outstanding, Stora also sends the contact's move-in email and fires `tenancy.started`, unless it already has. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit:write` # List all Units Source: https://docs.stora.co/2025-09/api-reference/units/list-all-units /2025-09/openapi.json get /2025-09/units List units, the physical storage spaces, each of a unit type at a site. Filter by `site_id`, `unit_type_id`, `status` (comma-separated for several) or `search` by reference ID. To check whether a unit type has space, filter by its `unit_type_id` and `status=available`. Expand `unit_allocation` to see the tenancy holding each unit, or use **List all Unit Allocations** instead to look up by contact or tenancy. See [Building a booking flow](https://docs.stora.co/2025-09/guides/booking-flow). Required authorization scope: `public.unit:read` # Overlock Units by Contact Source: https://docs.stora.co/2025-09/api-reference/units/overlock-units-by-contact /2025-09/openapi.json post /2025-09/units/overlock Lock a contact out of all their `occupied` units across all tenancies, typically for non-payment. Each unit becomes `overlock` and a `unit.overlocked` webhook fires for it. If the site has an access control integration, Stora syncs the change to it. `meta.unit_ids` lists the units locked. Use **Remove Overlock from Units by Contact** to restore access. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit:write` # Remove Overlock from Units by Contact Source: https://docs.stora.co/2025-09/api-reference/units/remove-overlock-from-units-by-contact /2025-09/openapi.json post /2025-09/units/remove_overlock Restore access to all of a contact's `overlock` units. Each unit becomes `occupied` and a `unit.occupied` webhook fires for it. If the site has an access control integration, Stora syncs the change to it. `meta.unit_ids` lists the units unlocked. Stora also clears the contact's failed-payment state, so automatic overlocking doesn't lock the units again until another payment fails. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit:write` # Reserve a Unit Source: https://docs.stora.co/2025-09/api-reference/units/reserve-a-unit /2025-09/openapi.json post /2025-09/units/{unit_id}/reserve Hold an `available` unit for a tenancy that hasn't started. The unit becomes `reserved`, Stora creates a unit allocation, and a `unit.reserved` webhook fires. The tenancy's start date must be after today in the operator's timezone. For a tenancy that has started, use **Grant Access to a Unit** instead. Reserving doesn't give the contact access. Stora grants it around 6am in the operator's timezone on the start date, unless move-in requirements such as an unsigned contract are still outstanding. Use **Grant Access to a Unit** to grant it earlier. See [Allocations and access](https://docs.stora.co/2025-09/guides/allocations-and-access). Required authorization scope: `public.unit:write` # Show a Unit Source: https://docs.stora.co/2025-09/api-reference/units/show-a-unit /2025-09/openapi.json get /2025-09/units/{unit_id} Get one unit with its `status` and current unit allocation. Expand `unit_allocation`, `unit_type` or `site` to include the full object. Required authorization scope: `public.unit:read` # Create a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/create-a-webhook-endpoint /2025-09/openapi.json post /2025-09/webhook_endpoints Subscribe a public HTTPS URL to the `event_types` you list. Stora sends each matching event as a signed `POST` in the format of `api_version`. Store the `secret` from this response to verify signatures, as it isn't returned again. Send an `Idempotency-Key` header so a retried request doesn't create a second endpoint. An endpoint that a partner app creates with the Authorization Code grant can be changed, enabled, disabled, or deleted only by that app. See [Webhooks](https://docs.stora.co/2025-09/guides/webhooks) for signature verification and retries. Required authorization scope: `public.webhook_endpoint:write` # Delete a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/delete-a-webhook-endpoint /2025-09/openapi.json delete /2025-09/webhook_endpoints/{webhook_endpoint_id} Delete a webhook endpoint. Deliveries stop, and pending retries are cancelled. It can't be restored. To pause and resume with the same secret, use **Disable a Webhook Endpoint** instead. An endpoint a partner app created can be deleted only by that app. Endpoints keep receiving events after you revoke the credentials that created them, so delete them first. Required authorization scope: `public.webhook_endpoint:write` # Disable a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/disable-a-webhook-endpoint /2025-09/openapi.json post /2025-09/webhook_endpoints/{webhook_endpoint_id}/disable Pause deliveries to a webhook endpoint. `status` becomes `disabled`, and retries that come due while it's disabled are cancelled. Events that happen while it's disabled are never delivered, even after **Enable a Webhook Endpoint**. The URL, event types, and secret are kept. To remove the endpoint, use **Delete a Webhook Endpoint** instead. Required authorization scope: `public.webhook_endpoint:write` # Enable a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/enable-a-webhook-endpoint /2025-09/openapi.json post /2025-09/webhook_endpoints/{webhook_endpoint_id}/enable Resume deliveries to a disabled webhook endpoint. `status` becomes `enabled`, and `disabled_at` is cleared. Only events from now on are delivered, not those that happened while it was disabled. Enabling an enabled endpoint changes nothing. Required authorization scope: `public.webhook_endpoint:write` # List all Webhook Endpoints Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/list-all-webhook-endpoints /2025-09/openapi.json get /2025-09/webhook_endpoints List the operator's webhook endpoints, newest first by default, including ones other integrations created. Filter by `status` (`enabled` or `disabled`). When reconnecting, reconcile these with the endpoint IDs you saved before creating new ones. See [Webhooks](https://docs.stora.co/2025-09/guides/webhooks). Required authorization scope: `public.webhook_endpoint:read` # Show a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/show-a-webhook-endpoint /2025-09/openapi.json get /2025-09/webhook_endpoints/{webhook_endpoint_id} Retrieve one webhook endpoint by ID. To replace a lost secret, create a new endpoint and delete this one. Required authorization scope: `public.webhook_endpoint:read` # Update a Webhook Endpoint Source: https://docs.stora.co/2025-09/api-reference/webhook-endpoints/update-a-webhook-endpoint /2025-09/openapi.json patch /2025-09/webhook_endpoints/{webhook_endpoint_id} Change an endpoint's `name`, `description`, `url`, `event_types`, or `metadata`. Fields you leave out are unchanged. A new `event_types` replaces the whole list. The `api_version` and `secret` can't be changed, so create a new endpoint for those. An endpoint a partner app created can be changed only by that app. To pause deliveries, use **Disable a Webhook Endpoint** instead. Required authorization scope: `public.webhook_endpoint:write` # contact.churned Source: https://docs.stora.co/2025-09/api-reference/webhooks/contactchurned /2025-09/openapi.json webhook contact.churned Triggered when a contact churns. # contact.converted Source: https://docs.stora.co/2025-09/api-reference/webhooks/contactconverted /2025-09/openapi.json webhook contact.converted Triggered when a contact converts to a customer. # contact.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/contactcreated /2025-09/openapi.json webhook contact.created Triggered when a contact is created. # contact.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/contactupdated /2025-09/openapi.json webhook contact.updated Triggered when the contact is updated. # contract.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/contractcreated /2025-09/openapi.json webhook contract.created Triggered when a contract is created. # contract.signed Source: https://docs.stora.co/2025-09/api-reference/webhooks/contractsigned /2025-09/openapi.json webhook contract.signed Triggered when a contract is signed. # coupon.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/couponcreated /2025-09/openapi.json webhook coupon.created Triggered when a coupon is created. # coupon.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/couponupdated /2025-09/openapi.json webhook coupon.updated Triggered when the coupon is updated. # credit_note.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/credit_notecreated /2025-09/openapi.json webhook credit_note.created Triggered when a new credit is created. # credit_note.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/credit_noteupdated /2025-09/openapi.json webhook credit_note.updated Triggered when a credit note is updated. # deal.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/dealcreated /2025-09/openapi.json webhook deal.created Triggered when a deal is created. # deal.lost Source: https://docs.stora.co/2025-09/api-reference/webhooks/deallost /2025-09/openapi.json webhook deal.lost Triggered when a deal is lost. # deal.reopened Source: https://docs.stora.co/2025-09/api-reference/webhooks/dealreopened /2025-09/openapi.json webhook deal.reopened Triggered when a deal is reopened # deal.stage_changed Source: https://docs.stora.co/2025-09/api-reference/webhooks/dealstage_changed /2025-09/openapi.json webhook deal.stage_changed Triggered when a deal's stage changes. Fires on every stage transition, including the first time a deal enters its initial stage on creation. In that case, this event is emitted alongside `deal.created`. # deal.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/dealupdated /2025-09/openapi.json webhook deal.updated Triggered when a deal is updated. # deal.won Source: https://docs.stora.co/2025-09/api-reference/webhooks/dealwon /2025-09/openapi.json webhook deal.won Triggered when a deal is won. # identity_verification.cancelled Source: https://docs.stora.co/2025-09/api-reference/webhooks/identity_verificationcancelled /2025-09/openapi.json webhook identity_verification.cancelled Triggered when an identity verification is cancelled # identity_verification.failed Source: https://docs.stora.co/2025-09/api-reference/webhooks/identity_verificationfailed /2025-09/openapi.json webhook identity_verification.failed Triggered when an identity verification failed # identity_verification.processing Source: https://docs.stora.co/2025-09/api-reference/webhooks/identity_verificationprocessing /2025-09/openapi.json webhook identity_verification.processing Triggered when an identity verification is processing # identity_verification.succeeded Source: https://docs.stora.co/2025-09/api-reference/webhooks/identity_verificationsucceeded /2025-09/openapi.json webhook identity_verification.succeeded Triggered when an identity verification succeeded # invoice.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoicecreated /2025-09/openapi.json webhook invoice.created Triggered when a new invoice is created. # invoice.finalized Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoicefinalized /2025-09/openapi.json webhook invoice.finalized Triggered when an invoice is finalized. # invoice.marked_uncollectible Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoicemarked_uncollectible /2025-09/openapi.json webhook invoice.marked_uncollectible Triggered when an invoice is marked as uncollectible. # invoice.overdue Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoiceoverdue /2025-09/openapi.json webhook invoice.overdue Triggered when an invoice becomes overdue for payment. # invoice.paid Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoicepaid /2025-09/openapi.json webhook invoice.paid Triggered when an invoice is mark as paid. # invoice.payment_failed Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoicepayment_failed /2025-09/openapi.json webhook invoice.payment_failed Triggered when an invoice payment fails. # invoice.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/invoiceupdated /2025-09/openapi.json webhook invoice.updated Triggered when an invoice is updated. # note.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/notecreated /2025-09/openapi.json webhook note.created Triggered when a note is created. # note.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/noteupdated /2025-09/openapi.json webhook note.updated Triggered when a note is updated. # opportunity.archived Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunityarchived /2025-09/openapi.json webhook opportunity.archived Triggered when an opportunity is archived. # opportunity.associated Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunityassociated /2025-09/openapi.json webhook opportunity.associated Triggered when an opportunity is associated with a deal. # opportunity.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunitycreated /2025-09/openapi.json webhook opportunity.created Triggered when an opportunity is created. # opportunity.deleted Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunitydeleted /2025-09/openapi.json webhook opportunity.deleted Triggered when an opportunity is deleted. # opportunity.unarchived Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunityunarchived /2025-09/openapi.json webhook opportunity.unarchived Triggered when an opportunity is unarchived. # opportunity.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/opportunityupdated /2025-09/openapi.json webhook opportunity.updated Triggered when an opportunity is updated. # order.abandoned Source: https://docs.stora.co/2025-09/api-reference/webhooks/orderabandoned /2025-09/openapi.json webhook order.abandoned Triggered when an order is abandoned. # order.completed Source: https://docs.stora.co/2025-09/api-reference/webhooks/ordercompleted /2025-09/openapi.json webhook order.completed Triggered when the order is completed. # order.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/ordercreated /2025-09/openapi.json webhook order.created Triggered when a new order is created. # order.finalized Source: https://docs.stora.co/2025-09/api-reference/webhooks/orderfinalized /2025-09/openapi.json webhook order.finalized Triggered when a new order is finalized (ready to be paid). # price_adjustment.cancelled Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentcancelled /2025-09/openapi.json webhook price_adjustment.cancelled Triggered when a price adjustment is cancelled and will not be applied. # price_adjustment.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentcreated /2025-09/openapi.json webhook price_adjustment.created Triggered when a price adjustment is created, as either a draft or scheduled. # price_adjustment.failed Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentfailed /2025-09/openapi.json webhook price_adjustment.failed Triggered when a price adjustment could not be applied and will not fire. # price_adjustment.invoiced Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentinvoiced /2025-09/openapi.json webhook price_adjustment.invoiced Triggered when the adjusted price has landed on a finalized invoice. `invoice` is now populated. # price_adjustment.rescheduled Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentrescheduled /2025-09/openapi.json webhook price_adjustment.rescheduled Triggered when Stora moves `adjust_on` to the next billing date at apply time because the subscription was not due to renew on the scheduled date. # price_adjustment.scheduled Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentscheduled /2025-09/openapi.json webhook price_adjustment.scheduled Triggered when a price adjustment is scheduled, either at creation or when a draft is promoted. The adjustment will now be applied on `adjust_on`. # price_adjustment.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/price_adjustmentupdated /2025-09/openapi.json webhook price_adjustment.updated Triggered when a draft or scheduled price adjustment is updated. # protection_level.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/protection_levelcreated /2025-09/openapi.json webhook protection_level.created Triggered when a protection level is created. # protection_level.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/protection_levelupdated /2025-09/openapi.json webhook protection_level.updated Triggered when a protection level is updated. # subscription.cancelled Source: https://docs.stora.co/2025-09/api-reference/webhooks/subscriptioncancelled /2025-09/openapi.json webhook subscription.cancelled Triggered when the subscription is cancelled. # subscription.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/subscriptioncreated /2025-09/openapi.json webhook subscription.created Triggered when the subscription is created. # subscription.ended Source: https://docs.stora.co/2025-09/api-reference/webhooks/subscriptionended /2025-09/openapi.json webhook subscription.ended Triggered when the subscription is ended. # subscription.resumed Source: https://docs.stora.co/2025-09/api-reference/webhooks/subscriptionresumed /2025-09/openapi.json webhook subscription.resumed Triggered when a cancellation is undone and the subscription is resumed. # subscription.started Source: https://docs.stora.co/2025-09/api-reference/webhooks/subscriptionstarted /2025-09/openapi.json webhook subscription.started Triggered when the subscription is started. # task.completed Source: https://docs.stora.co/2025-09/api-reference/webhooks/taskcompleted /2025-09/openapi.json webhook task.completed Triggered when the task is completed. # task.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/taskcreated /2025-09/openapi.json webhook task.created Triggered when a task is created. # task.reopened Source: https://docs.stora.co/2025-09/api-reference/webhooks/taskreopened /2025-09/openapi.json webhook task.reopened Triggered when a completed task is reopened. # task.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/taskupdated /2025-09/openapi.json webhook task.updated Triggered when a task is updated. # tenancy.auto_reservation.failed Source: https://docs.stora.co/2025-09/api-reference/webhooks/tenancyauto_reservationfailed /2025-09/openapi.json webhook tenancy.auto_reservation.failed Triggered when no requested units can be automatically reserved for a tenancy. # tenancy.auto_reservation.partially_succeeded Source: https://docs.stora.co/2025-09/api-reference/webhooks/tenancyauto_reservationpartially_succeeded /2025-09/openapi.json webhook tenancy.auto_reservation.partially_succeeded Triggered when some, but not all, requested units are automatically reserved for a tenancy. # tenancy.auto_reservation.succeeded Source: https://docs.stora.co/2025-09/api-reference/webhooks/tenancyauto_reservationsucceeded /2025-09/openapi.json webhook tenancy.auto_reservation.succeeded Triggered when all requested units are automatically reserved for a tenancy. # tenancy.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/tenancycreated /2025-09/openapi.json webhook tenancy.created Triggered when a tenancy is created. # tenancy.started Source: https://docs.stora.co/2025-09/api-reference/webhooks/tenancystarted /2025-09/openapi.json webhook tenancy.started Triggered when the tenancy is started. # unit_type.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/unit_typecreated /2025-09/openapi.json webhook unit_type.created Triggered when a unit type is created. # unit_type.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/unit_typeupdated /2025-09/openapi.json webhook unit_type.updated Triggered when a unit type is updated. # unit.available Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitavailable /2025-09/openapi.json webhook unit.available Triggered when a unit is made available. # unit.created Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitcreated /2025-09/openapi.json webhook unit.created Triggered when a unit is created. # unit.deallocated Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitdeallocated /2025-09/openapi.json webhook unit.deallocated Triggered when a unit is deallocated. # unit.occupied Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitoccupied /2025-09/openapi.json webhook unit.occupied Triggered when a unit is occupied. # unit.overlocked Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitoverlocked /2025-09/openapi.json webhook unit.overlocked Triggered when a unit is overlocked. # unit.repossessed Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitrepossessed /2025-09/openapi.json webhook unit.repossessed Triggered when a unit is repossessed. # unit.reserved Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitreserved /2025-09/openapi.json webhook unit.reserved Triggered when a unit is reserved. # unit.unavailable Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitunavailable /2025-09/openapi.json webhook unit.unavailable Triggered when a unit is made unavailable. # unit.updated Source: https://docs.stora.co/2025-09/api-reference/webhooks/unitupdated /2025-09/openapi.json webhook unit.updated Triggered when a unit is updated.