Get contract config
Load everything the contract form needs: the allowed value for each dropdown, the selectable product lines and Studio AI plans, the pricing catalog for every active product line, and the default terms and conditions template paths. Nothing is written.
Prices come back in the currency you ask for. basePrice and finalPrice are converted from USD using the stored conversion rates.
Send the bearer token of a signed-in Spyne Console user in Authorization: Bearer YOUR_TOKEN. The token is checked against the user validation endpoint on every call.
Before you call it
- You need a valid console user token.
- To price in a currency other than USD, that currency must have a stored conversion rate from USD.
data.basicDetails.currenciesin a USD call lists the currencies that do. - This is the first call of the stage. The response is built from database reads in the same request. The rate limit is not documented.
Request
- Authenticate: send the
Authorization: Bearer YOUR_TOKENheader. - Pick a currency: optionally pass
currency. If you leave it out, USD is used. - Keep the pricing: keep the whole
data.pricingobject. You send it back unchanged in thepricingfield of Save or submit a contract.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Required | Bearer YOUR_TOKEN |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
currency | string | Optional | Currency code for price conversion, for example USD or INR. Default: USD. |
Sample request
curl -X GET "https://api.spyne.ai/credit/v6/contracting/get-contract-config?currency=USD" \
-H "Authorization: Bearer YOUR_TOKEN"import requests
res = requests.get(
"https://api.spyne.ai/credit/v6/contracting/get-contract-config",
params={"currency": "USD"},
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
print(res.status_code, res.json())const res = await fetch(
"https://api.spyne.ai/credit/v6/contracting/get-contract-config?currency=USD",
{ headers: { Authorization: "Bearer YOUR_TOKEN" } }
);
console.log(res.status, await res.json());Sample response
The 200 response is shortened: the pricing objects are cut down.
{
"message": "Contract configuration fetched successfully",
"error": false,
"code": "",
"details": null,
"data": {
"basicDetails": {
"dealTypes": ["New Deal"],
"customerTypes": ["Individual Dealer", "Group Dealer", "Reseller"],
"currencies": ["<currency>", "<currency>"],
"selectedProducts": [{ "id": "conversationalAi", "name": "<displayName>" }],
"planNames": ["Lite", "Pro"],
"managerNames": ["<managerName>"]
},
"customerDetails": {
"regions": ["AMER", "APAC", "EMEA", "OTHERS"],
"billingTo": ["Group Dealer (Combined)"]
},
"billingEntities": { "spyneInc": "<label>", "eventila": "<label>" },
"rooftopSubTypes": ["Independent Dealer", "Franchise Dealer", "Mixed"],
"billingFrequencies": [1, 3, 6, 12],
"terminationDays": [30, 60],
"pricing": {
"conversationalAi": { "type": "<type>", "allowedProducts": {}, "items": {} }
},
"resellerPricing": {},
"appliedCurrency": "USD",
"conversionFactor": 1,
"defaultTcTemplatePathPdf": "contracts/default-terms-and-conditions-template.pdf",
"defaultTcTemplatePathDocx": "contracts/default-terms-and-conditions-template.docx",
"defaultAmendmentTcTemplatePathPdf": "contracts/default-amendment-terms-and-conditions-template.pdf",
"defaultAmendmentTcTemplatePathDocx": "contracts/default-amendment-terms-and-conditions-template.docx",
"sampleExcelTemplatePath": "contracts/sample-excel-bill-gd.xlsx",
"viewPricingSlabsUrl": "<url>"
}
}{
"message": "Currency conversion rate not found for EUR",
"error": true,
"code": "ERROR_BAD_REQ_400",
"details": null,
"data": null
}{
"message": "Invalid Token",
"error": true,
"code": "ERROR_AUTH_401",
"details": null,
"data": null
}{
"message": "General API error. Please try again later.",
"error": true,
"code": "ERROR_SERVER_500",
"details": ""
}Response parameters
| Parameter | Type | Description |
|---|---|---|
data.basicDetails.dealTypes | string[] | Allowed contractDetails.dealType values. |
data.basicDetails.customerTypes | string[] | Allowed contractDetails.customerType values. |
data.basicDetails.currencies | string[] | Currencies that have a stored conversion rate from USD. |
data.basicDetails.selectedProducts | object[] | Active product lines that have pricing. id is the product line name (for example studioAi, conversationalAi). name is its display name. |
data.basicDetails.planNames | string[] | Plan names built from the plan keys of plan-priced product lines, for example Lite, Pro. |
data.basicDetails.managerNames | string[] | Allowed contractDetails.managerName values. |
data.customerDetails.regions | string[] | Allowed region values. |
data.customerDetails.billingTo | string[] | Allowed customerDetails.billingTo values. |
data.billingEntities | object | Billing entity options as key to label. |
data.rooftopSubTypes | string[] | Allowed rooftops[].subType values. |
data.billingFrequencies | number[] | Allowed billingDetails.billingFrequency values. |
data.terminationDays | number[] | Allowed terms.terminationDays values. |
data.pricing | object | Pricing catalog keyed by product line name. Each entry has type, allowedProducts and items. Prices in items are converted to appliedCurrency. |
data.resellerPricing | object | Reseller pricing catalog, same shape as pricing. |
data.appliedCurrency | string | Currency used for the prices. |
data.conversionFactor | number | USD to appliedCurrency rate applied (1 for USD). |
data.defaultTcTemplatePathPdf | string | Default terms template path. Send it as terms["t&cTemplatePath"] unless you upload custom terms. |
data.defaultAmendmentTcTemplatePathPdf | string | Default terms template path for amendments. |
data.*Docx, data.sampleExcelTemplatePath | string | Other template file paths. |
data.viewPricingSlabsUrl | string | Link to a pricing slab reference page. |
Errors
| Status | Reason | When it happens |
|---|---|---|
400 | Currency conversion rate not found | currency is not USD and no USD rate exists for it. |
401 | Invalid or missing token | No Bearer token, or the token failed validation. |
408 | Request timed out | The token validation call could not connect. |
500 | General API error | Any unexpected error. |
What happens next
Use the dropdown values and data.pricing to fill the contract form, then call Save or submit a contract. If you are reopening a saved contract, call Reload a saved contract first.
Called before: none. This is the first call of the stage. Called after: Reload a saved contract, Save or submit a contract.
Updated about 2 hours ago
