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.

GEThttps://api.spyne.ai/credit/v6/contracting/get-contract-config
AuthBearer token (console user)Rate limitNot documentedProcessingSynchronous; built from database reads in the same request.

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.currencies in 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

Requiredalways sendOptionalcan be left out
Request checklist
  1. Authenticate: send the Authorization: Bearer YOUR_TOKEN header.
  2. Pick a currency: optionally pass currency. If you leave it out, USD is used.
  3. Keep the pricing: keep the whole data.pricing object. You send it back unchanged in the pricing field of Save or submit a contract.

Headers

ParameterTypeRequiredDescription
AuthorizationstringRequiredBearer YOUR_TOKEN

Query parameters

ParameterTypeRequiredDescription
currencystringOptionalCurrency 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

ParameterTypeDescription
data.basicDetails.dealTypesstring[]Allowed contractDetails.dealType values.
data.basicDetails.customerTypesstring[]Allowed contractDetails.customerType values.
data.basicDetails.currenciesstring[]Currencies that have a stored conversion rate from USD.
data.basicDetails.selectedProductsobject[]Active product lines that have pricing. id is the product line name (for example studioAi, conversationalAi). name is its display name.
data.basicDetails.planNamesstring[]Plan names built from the plan keys of plan-priced product lines, for example Lite, Pro.
data.basicDetails.managerNamesstring[]Allowed contractDetails.managerName values.
data.customerDetails.regionsstring[]Allowed region values.
data.customerDetails.billingTostring[]Allowed customerDetails.billingTo values.
data.billingEntitiesobjectBilling entity options as key to label.
data.rooftopSubTypesstring[]Allowed rooftops[].subType values.
data.billingFrequenciesnumber[]Allowed billingDetails.billingFrequency values.
data.terminationDaysnumber[]Allowed terms.terminationDays values.
data.pricingobjectPricing catalog keyed by product line name. Each entry has type, allowedProducts and items. Prices in items are converted to appliedCurrency.
data.resellerPricingobjectReseller pricing catalog, same shape as pricing.
data.appliedCurrencystringCurrency used for the prices.
data.conversionFactornumberUSD to appliedCurrency rate applied (1 for USD).
data.defaultTcTemplatePathPdfstringDefault terms template path. Send it as terms["t&cTemplatePath"] unless you upload custom terms.
data.defaultAmendmentTcTemplatePathPdfstringDefault terms template path for amendments.
data.*Docx, data.sampleExcelTemplatePathstringOther template file paths.
data.viewPricingSlabsUrlstringLink to a pricing slab reference page.

Errors

StatusReasonWhen it happens
400Currency conversion rate not foundcurrency is not USD and no USD rate exists for it.
401Invalid or missing tokenNo Bearer token, or the token failed validation.
408Request timed outThe token validation call could not connect.
500General API errorAny 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.


Did this page help you?