curl --request POST \
--url https://public-api.stora.co/2025-09/opportunities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact": {
"id": "con_1234567890abcdef"
},
"site": {
"id": "site_14b419f1096013f1"
},
"line_items": [
{
"type": "unit_type",
"item": {
"id": "utype_f18fc91387cdf710"
}
},
{
"type": "protection",
"item": {
"id": "plvl_e8f3ad0a07e47566"
}
}
],
"metadata": {
"crm_id": "opportunity-123"
}
}
'{
"opportunity": {
"id": "opp_a1b2c3d4e5f67890",
"archived_at": null,
"associated_at": null,
"contact": {
"id": "con_1234567890abcdef"
},
"created_at": "2025-02-22T14:41:00Z",
"creator": {
"id": "app_99b90b9d208a137b"
},
"deal": null,
"line_items": [
{
"item": {
"id": "plvl_e8f3ad0a07e47566"
},
"quantity": 1,
"type": "protection"
},
{
"item": {
"id": "utype_f18fc91387cdf710"
},
"quantity": 1,
"type": "unit_type"
}
],
"metadata": {
"crm_id": "opportunity-123"
},
"site": {
"id": "site_14b419f1096013f1"
},
"source": "public_api",
"status": "open",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}Create an Opportunity
Create an open opportunity with an existing contact or create a contact inline. Contact fields supplied alongside an ID update that contact. Without an ID, an email is required. Contact changes and opportunity creation succeed or fail together.
Site, line items and metadata are optional, but a unit type requires a site. API-created opportunities report public_api as their source,
and the creator identifies the creating application. Source, creator and lifecycle fields are read-only.
Required authorization scope: public.opportunity:write
curl --request POST \
--url https://public-api.stora.co/2025-09/opportunities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contact": {
"id": "con_1234567890abcdef"
},
"site": {
"id": "site_14b419f1096013f1"
},
"line_items": [
{
"type": "unit_type",
"item": {
"id": "utype_f18fc91387cdf710"
}
},
{
"type": "protection",
"item": {
"id": "plvl_e8f3ad0a07e47566"
}
}
],
"metadata": {
"crm_id": "opportunity-123"
}
}
'{
"opportunity": {
"id": "opp_a1b2c3d4e5f67890",
"archived_at": null,
"associated_at": null,
"contact": {
"id": "con_1234567890abcdef"
},
"created_at": "2025-02-22T14:41:00Z",
"creator": {
"id": "app_99b90b9d208a137b"
},
"deal": null,
"line_items": [
{
"item": {
"id": "plvl_e8f3ad0a07e47566"
},
"quantity": 1,
"type": "protection"
},
{
"item": {
"id": "utype_f18fc91387cdf710"
},
"quantity": 1,
"type": "unit_type"
}
],
"metadata": {
"crm_id": "opportunity-123"
},
"site": {
"id": "site_14b419f1096013f1"
},
"source": "public_api",
"status": "open",
"updated_at": "2025-02-22T14:41:00Z"
},
"meta": {
"request_id": "01563646-58c1-4607-8fe0-cae3e92c4477",
"curies": [
{
"name": "bo",
"href": "https://app.stora.test{rel}",
"templated": true,
"title": "Backoffice"
},
{
"name": "sf",
"href": "https://acme.stora.test{rel}",
"templated": true,
"title": "Storefront"
}
]
}
}Authorizations
Bearer Token necessary to use API
Query Parameters
This endpoint supports expandable responses. For more, see the documentation page.
Body
Create Opportunity Request
Show child attributes
Show child attributes
The site associated with the opportunity
Show child attributes
Show child attributes
List of line items for the opportunity. At most one item per type is allowed.
2Deal Unit Type Line Item
- Option 1
- Option 2
Show child attributes
Show child attributes
Set of key-value pairs for storing additional information on the opportunity. Learn more about metadata.
Show child attributes
Show child attributes
Was this page helpful?