Get contracting data
Get the active contracts for a rooftop, with the product lines and products on each one.
GET
AuthBearer token (console user)Rate limitNot documentedProcessingSynchronous.
The API reads the rooftop's product line plans in the Contracted or Contract-Live stage, groups them by contract, and returns each contract with its product lines and product names. It also returns the dealer group's name. Nothing is written.
Before you call it
- Send
Authorization: Bearer YOUR_TOKEN. The token is the signed-in console user's session token. It is checked against the user service on every call. - You need the rooftop's
teamIdand its dealer group'senterpriseId. Both come from the signed-in user's selected rooftop. - A contract must exist for the rooftop. It is created in the contracting stage. If no plan is in
ContractedorContract-Live,contractsis an empty array. - The call is synchronous. Rate limit: not documented.
Query parameters
Requiredalways send
Request checklist
- Authenticate: send
Authorization: Bearer YOUR_TOKEN. - Identify the rooftop: pass
enterpriseIdandteamIdas query parameters. - Find the Vini line: pick the contract whose
productLines[].productLineDisplayNameis the Vini line, for example "Conversational AI", and take itsproductLineId.
| Parameter | Type | Required | Description |
|---|---|---|---|
enterpriseId | string | Required | Dealer group ID. |
teamId | string | Required | Rooftop ID. |
Sample request
curl -X GET "https://api.spyne.ai/credit/v6/get-team-contracting-data?enterpriseId=<enterpriseId>&teamId=<teamId>" \
-H "Authorization: Bearer YOUR_TOKEN"import requests
resp = requests.get(
"https://api.spyne.ai/credit/v6/get-team-contracting-data",
params={"enterpriseId": "<enterpriseId>", "teamId": "<teamId>"},
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
print(resp.status_code, resp.json())const params = new URLSearchParams({ enterpriseId: "<enterpriseId>", teamId: "<teamId>" });
const res = await fetch(`https://api.spyne.ai/credit/v6/get-team-contracting-data?${params}`, {
headers: { Authorization: "Bearer YOUR_TOKEN" },
});
const body = await res.json();Sample response
{
"message": "",
"error": false,
"code": "",
"details": null,
"data": {
"contracts": [
{
"contractId": "<contractId>",
"productLines": [
{
"productLineId": "<productLineId>",
"productLineDisplayName": "Conversational AI",
"productNames": ["inboundSales", "outboundService"],
"displayProductNames": ["Sales Inbound", "Service Outbound"],
"plan": null
}
],
"contractStage": "Contracted",
"contractUrl": "",
"arr": "<amount>",
"contractedDate": "2026-01-15T00:00:00.000Z",
"summary": "This is a summary of the contract"
}
],
"enterpriseName": "<enterpriseName>",
"enterpriseId": "<enterpriseId>"
}
}{
"message": "Invalid Token",
"error": true,
"code": "ERROR_AUTH_401",
"details": "",
"data": null
}{
"message": "<connection error message>",
"error": true,
"code": "ERROR_REQ_TIMEOUT_408",
"details": "",
"data": null
}{
"message": "General API error. Please try again later.",
"error": true,
"code": "ERROR_SERVER_500",
"details": ""
}Response parameters (200)
| Parameter | Type | Description |
|---|---|---|
data.contracts | array | One entry per contract with a plan in Contracted or Contract-Live for this rooftop. Empty when there is none. |
data.contracts[].contractId | string | Contract ID. |
data.contracts[].productLines | array | Product lines on this contract for the rooftop. |
data.contracts[].productLines[].productLineId | string | The rooftop's product line ID. |
data.contracts[].productLines[].productLineDisplayName | string | Product line display name, or its registry name when there is no display name. |
data.contracts[].productLines[].productNames | string[] | Product names on the plan, for example inboundSales. |
data.contracts[].productLines[].displayProductNames | string[] | Display names of the same products. |
data.contracts[].productLines[].plan | string or null | Plan label. Always null for the Conversational AI line. |
data.contracts[].contractStage | string | Contract stage, or "". |
data.contracts[].contractUrl | string | Contract document URL, or "". |
data.contracts[].arr | number | Contract value field. Confidential, not shown here. |
data.contracts[].contractedDate | string or null | Date the contract was signed. |
data.contracts[].summary | string | Always the fixed text "This is a summary of the contract". |
data.enterpriseName | string or null | Dealer group name. |
data.enterpriseId | string or null | Echo of the dealer group ID. |
Errors
| Status | Code | When it happens |
|---|---|---|
400 | Missing parameter | enterpriseId or teamId is missing. The framework rejects the request and sets the body, not this API. |
401 | ERROR_AUTH_401 | No Authorization header, it does not start with Bearer, or the token is not valid. |
408 | ERROR_REQ_TIMEOUT_408 | The token check could not reach the user service. |
500 | ERROR_SERVER_500 | Any failure while reading contracts or the dealer group name. |
What happens next
Use the Conversational AI product line's productLineId and productNames to confirm what the rooftop contracted. Then call Get contract product lines.
This call comes after the contracting endpoints in the Contracting section.
Updated about 1 hour ago
Did this page help you?
