Opportunity
The opportunity resource.
Base/opportunity
GET
/opportunityList opportunities
Retrieve a paginated list of opportunities. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GET/opportunity
curl --request GET \
--url '<your-host>/opportunity?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}
]GET
/opportunityRetrieve a opportunity
Fetch a single opportunity by filtering on `id`.
Query parameters
idstringMatch on the opportunity's `id`, e.g. `eq.{id}`.
GET/opportunity
curl --request GET \
--url '<your-host>/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}POST
/opportunityCreate a opportunity
Create a new opportunity.
Body parameters
companyIdstringrequiredReferences company.id
purchaseOrderDocumentPathstringrequestForQuoteDocumentPathstringcustomerIdstringPOST/opportunity
curl --request POST \
--url <your-host>/opportunity \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}PATCH
/opportunityUpdate a opportunity
Update an existing opportunity, matched on `id`.
Body parameters
companyIdstringrequiredReferences company.id
purchaseOrderDocumentPathstringrequestForQuoteDocumentPathstringcustomerIdstringPATCH/opportunity
curl --request PATCH \
--url '<your-host>/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"companyId":"xyz789"}'Response
{
"id": "abc123def456",
"companyId": "xyz789",
"purchaseOrderDocumentPath": "string",
"requestForQuoteDocumentPath": "string",
"customerId": "xyz789"
}DELETE
/opportunityDelete a opportunity
Delete a opportunity, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the opportunity to delete, e.g. `eq.{id}`.
DELETE/opportunity
curl --request DELETE \
--url '<your-host>/opportunity?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content