Connect an AI assistant
Your AI assistant can read this documentation directly, so it answers from the current content instead of guessing. Add one of the servers below to your client — they use the Model Context Protocol (MCP). Each one covers a different body of content, so add the one you need.
The catalog did not load. Refresh the page to try again.
Loading…
{{server.name}}
{{server.summary}}
{{server.documentCount.toLocaleString()}} pages Not published to this site
- Name
-
{{server.name}} - URL
-
{{mcpServerUrl(server.path)}}
| Tool | What it does |
|---|---|
{{tool.name}} |
{{part.text}}{{part.text}} |
How can we help?
Searching in {{docApp.searchFilterBySpecificBookTitle}}
Searching for:
{{docApp.searchResultFilteredItems.length}} results for:
{{docApp.currentResultsSearchText}}
in {{docApp.searchFilterBySpecificBookTitle}}
Found {{docApp.searchResponse.totalResultsAvailable}} matches. Showing the top {{docApp.searchResponse.results ? docApp.searchResponse.results.length : 0}}. Use a more specific search to further narrow down the results.
No documentation pages match this search, so all content types are shown.
Most matches are in {{docApp.searchDocTypeRescue.best.name}}.
There is no book with the ID "{{docApp.searchBookRescue.bid}}", so the book filter from this link was ignored and results from all books are shown.
You have an odd number of " characters in your search terms - each one needs closing with a matching " character!
-
{{resultItem.title}} {{resultItem.matchedBy === 'semantic' ? 'semantic' : (resultItem.matchedBy === 'both' ? 'keyword + semantic' : 'keyword')}}
{{resultItem.url}}
{{docApp.libraryHomeViewProduct.title || docApp.libraryHomeViewProduct.id}}
{{docApp.libraryHomeViewProduct.description}}
{{group.title || group.id}}
{{group.description}}
Entity API / addSupplierContract
- Article
- 9 minutes to read
Operation Information
- Application Reference:
com.hornbill.suppliermanager - Scope:
Entity - SupplierContracts - Class:
Entity - Required Privilege Level:
user - Required Rights: Group A - canViewSuppliers; Group C - canCreateSupplierContracts
Description
This flowcode operation creates a new supplier contract.
Request Parameters
The addSupplierContract API takes the following input parameters.
Note
When sending a JSON request payload to the API, the order of parameters is not significant. However, for XML request payloads, parameters must be provided in the exact order specified in this documentation to comply with input validation requirements.
| Name | Type | Required | Description |
|---|---|---|---|
supplierId |
xs:integer |
Yes | The supplier primary key. |
name |
xs:string |
Yes | The name of the new supplier contract. |
description |
xs:string |
No | A description of the new supplier contract. |
type |
xs:string |
No | The type of the new supplier contract. |
startDate |
xs:dateTime |
No | The start date of the new supplier contract. |
endDate |
xs:dateTime |
No | The end date of the new supplier contract. |
renewalStartDate |
xs:dateTime |
No | The renewal start date of the new supplier contract. |
renewalEndDate |
xs:dateTime |
No | The renewal end date of the new supplier contract. |
currency |
xs:string |
No | The currency of the new supplier contract. |
value |
xs:decimal |
No | The value of the new supplier contract. |
acquisitionMethod |
xs:string |
No | The acquisition method of the new supplier contract. |
cancellationNoticePeriod |
xs:string |
No | The cancellation notice period of the new supplier contract. |
costCentre |
xs:string |
No | The cost centre of the new supplier contract. |
invoiceNumber |
xs:string |
No | The invoice number of the new supplier contract. |
orderNumber |
xs:string |
No | The order number of the new supplier contract. |
paymentType |
xs:string |
No | The payment type of the new supplier contract. |
status |
xs:string |
No | The status of the new supplier contract. Accepted values are (status.draft,status.active,status.archived). If no value is provided, status.active will be used. |
subStatus |
xs:string |
No | The Supplier Contract Sub Status value taken from the simple list. e.g. 'subStatus.rolling' |
ownedBy |
xs:string |
No | The user id of the owner of the new supplier contract. |
budgetOwner |
xs:string |
No | The user id of the budget owner of the new supplier contract. |
businessOwner |
xs:string |
No | The user id of the business owner of the new supplier contract. |
workingTimeCalendar |
xs:string |
No | The working time calendar to be used against the new supplier contract to record events. |
targetMinutesPerEvent |
xs:integer |
No | The target number of minutes to complete each event against the new supplier contract. |
agreedComplianceTargetPercentage |
xs:decimal |
No | The agreed compliance target percentage for the new supplier contract. |
contactEmailAddress |
xs:string |
No | A contact email address for the parent supplier for the new supplier contract. |
penaltyDescription |
xs:string |
No | A description of any penalties occurred for missing the agreed compliance target percentage for the new supplier contract. |
notes |
xs:string |
No | Any additional notes for the new supplier contract. |
custom0 |
xs:string |
No | Custom data held against the new supplier contract. |
custom1 |
xs:string |
No | Custom data held against the new supplier contract. |
custom2 |
xs:string |
No | Custom data held against the new supplier contract. |
custom3 |
xs:string |
No | Custom data held against the new supplier contract. |
custom4 |
xs:string |
No | Custom data held against the new supplier contract. |
custom5 |
xs:string |
No | Custom data held against the new supplier contract. |
custom6 |
xs:string |
No | Custom data held against the new supplier contract. |
custom7 |
xs:string |
No | Custom data held against the new supplier contract. |
custom8 |
xs:string |
No | Custom data held against the new supplier contract. |
custom9 |
xs:string |
No | Custom data held against the new supplier contract. |
custom10 |
xs:string |
No | Custom data held against the new supplier contract. |
custom11 |
xs:dateTime |
No | Custom data held against the new supplier contract. |
custom12 |
xs:dateTime |
No | Custom data held against the new supplier contract. |
custom13 |
xs:dateTime |
No | Custom data held against the new supplier contract. |
custom14 |
xs:dateTime |
No | Custom data held against the new supplier contract. |
custom15 |
xs:dateTime |
No | Custom data held against the new supplier contract. |
custom16 |
xs:integer |
No | Custom data held against the new supplier contract. |
custom17 |
xs:integer |
No | Custom data held against the new supplier contract. |
custom18 |
xs:integer |
No | Custom data held against the new supplier contract. |
custom19 |
xs:integer |
No | Custom data held against the new supplier contract. |
custom20 |
xs:integer |
No | Custom data held against the new supplier contract. |
custom21 |
xs:decimal |
No | Custom data held against the new supplier contract. |
custom22 |
xs:decimal |
No | Custom data held against the new supplier contract. |
custom23 |
xs:decimal |
No | Custom data held against the new supplier contract. |
custom24 |
xs:decimal |
No | Custom data held against the new supplier contract. |
custom25 |
xs:decimal |
No | Custom data held against the new supplier contract. |
Response Parameters
| Name | Type | Description |
|---|---|---|
outcome |
xs:string |
The outcome of the flowcode operation. |
supplierContractId |
xs:string |
The id of the new supplier contract. |
supplierContractName |
xs:string |
The name of the new supplier contract. |
Code Examples
curl -X POST 'https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts' \
-H 'Authorization: ESP-APIKEY yourHornbillAPIKey' \
-H 'Content-Type: application/json' \
-d '{"@service":"apps/com.hornbill.suppliermanager/SupplierContracts","@method":"addSupplierContract","params":{"supplierId":1,"name":"xs:string","description":"xs:string","type":"xs:string","startDate":"xs:dateTime","endDate":"xs:dateTime","renewalStartDate":"xs:dateTime","renewalEndDate":"xs:dateTime","currency":"xs:string","value":1.23,"acquisitionMethod":"xs:string","cancellationNoticePeriod":"xs:string","costCentre":"xs:string","invoiceNumber":"xs:string","orderNumber":"xs:string","paymentType":"xs:string","status":"xs:string","subStatus":"xs:string","ownedBy":"xs:string","budgetOwner":"xs:string","businessOwner":"xs:string","workingTimeCalendar":"xs:string","targetMinutesPerEvent":1,"agreedComplianceTargetPercentage":1.23,"contactEmailAddress":"xs:string","penaltyDescription":"xs:string","notes":"xs:string","custom0":"xs:string","custom1":"xs:string","custom2":"xs:string","custom3":"xs:string","custom4":"xs:string","custom5":"xs:string","custom6":"xs:string","custom7":"xs:string","custom8":"xs:string","custom9":"xs:string","custom10":"xs:string","custom11":"xs:dateTime","custom12":"xs:dateTime","custom13":"xs:dateTime","custom14":"xs:dateTime","custom15":"xs:dateTime","custom16":1,"custom17":1,"custom18":1,"custom19":1,"custom20":1,"custom21":1.23,"custom22":1.23,"custom23":1.23,"custom24":1.23,"custom25":1.23}}'
package main
import (
"fmt"
apiLib "github.com/hornbill/goApiLib"
)
func main() {
hornbillAPI := apiLib.NewXmlmcInstance("yourinstanceid")
hornbillAPI.SetAPIKey("yourHornbillAPIKey")
hornbillAPI.SetJSONResponse(true)
hornbillAPI.SetParam("supplierId", "xs:integer")
hornbillAPI.SetParam("name", "xs:string")
hornbillAPI.SetParam("description", "xs:string")
hornbillAPI.SetParam("type", "xs:string")
hornbillAPI.SetParam("startDate", "xs:dateTime")
hornbillAPI.SetParam("endDate", "xs:dateTime")
hornbillAPI.SetParam("renewalStartDate", "xs:dateTime")
hornbillAPI.SetParam("renewalEndDate", "xs:dateTime")
hornbillAPI.SetParam("currency", "xs:string")
hornbillAPI.SetParam("value", "xs:decimal")
hornbillAPI.SetParam("acquisitionMethod", "xs:string")
hornbillAPI.SetParam("cancellationNoticePeriod", "xs:string")
hornbillAPI.SetParam("costCentre", "xs:string")
hornbillAPI.SetParam("invoiceNumber", "xs:string")
hornbillAPI.SetParam("orderNumber", "xs:string")
hornbillAPI.SetParam("paymentType", "xs:string")
hornbillAPI.SetParam("status", "xs:string")
hornbillAPI.SetParam("subStatus", "xs:string")
hornbillAPI.SetParam("ownedBy", "xs:string")
hornbillAPI.SetParam("budgetOwner", "xs:string")
hornbillAPI.SetParam("businessOwner", "xs:string")
hornbillAPI.SetParam("workingTimeCalendar", "xs:string")
hornbillAPI.SetParam("targetMinutesPerEvent", "xs:integer")
hornbillAPI.SetParam("agreedComplianceTargetPercentage", "xs:decimal")
hornbillAPI.SetParam("contactEmailAddress", "xs:string")
hornbillAPI.SetParam("penaltyDescription", "xs:string")
hornbillAPI.SetParam("notes", "xs:string")
hornbillAPI.SetParam("custom0", "xs:string")
hornbillAPI.SetParam("custom1", "xs:string")
hornbillAPI.SetParam("custom2", "xs:string")
hornbillAPI.SetParam("custom3", "xs:string")
hornbillAPI.SetParam("custom4", "xs:string")
hornbillAPI.SetParam("custom5", "xs:string")
hornbillAPI.SetParam("custom6", "xs:string")
hornbillAPI.SetParam("custom7", "xs:string")
hornbillAPI.SetParam("custom8", "xs:string")
hornbillAPI.SetParam("custom9", "xs:string")
hornbillAPI.SetParam("custom10", "xs:string")
hornbillAPI.SetParam("custom11", "xs:dateTime")
hornbillAPI.SetParam("custom12", "xs:dateTime")
hornbillAPI.SetParam("custom13", "xs:dateTime")
hornbillAPI.SetParam("custom14", "xs:dateTime")
hornbillAPI.SetParam("custom15", "xs:dateTime")
hornbillAPI.SetParam("custom16", "xs:integer")
hornbillAPI.SetParam("custom17", "xs:integer")
hornbillAPI.SetParam("custom18", "xs:integer")
hornbillAPI.SetParam("custom19", "xs:integer")
hornbillAPI.SetParam("custom20", "xs:integer")
hornbillAPI.SetParam("custom21", "xs:decimal")
hornbillAPI.SetParam("custom22", "xs:decimal")
hornbillAPI.SetParam("custom23", "xs:decimal")
hornbillAPI.SetParam("custom24", "xs:decimal")
hornbillAPI.SetParam("custom25", "xs:decimal")
responseBody, apiError := hornbillAPI.Invoke("apps/com.hornbill.suppliermanager/SupplierContracts", "addSupplierContract")
if apiError != nil {
fmt.Println(apiError)
return
}
fmt.Println(responseBody)
}
const endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts";
const payload = {
"@service": "apps/com.hornbill.suppliermanager/SupplierContracts",
"@method": "addSupplierContract",
"params": {
"supplierId": 1,
"name": "xs:string",
"description": "xs:string",
"type": "xs:string",
"startDate": "xs:dateTime",
"endDate": "xs:dateTime",
"renewalStartDate": "xs:dateTime",
"renewalEndDate": "xs:dateTime",
"currency": "xs:string",
"value": 1.23,
"acquisitionMethod": "xs:string",
"cancellationNoticePeriod": "xs:string",
"costCentre": "xs:string",
"invoiceNumber": "xs:string",
"orderNumber": "xs:string",
"paymentType": "xs:string",
"status": "xs:string",
"subStatus": "xs:string",
"ownedBy": "xs:string",
"budgetOwner": "xs:string",
"businessOwner": "xs:string",
"workingTimeCalendar": "xs:string",
"targetMinutesPerEvent": 1,
"agreedComplianceTargetPercentage": 1.23,
"contactEmailAddress": "xs:string",
"penaltyDescription": "xs:string",
"notes": "xs:string",
"custom0": "xs:string",
"custom1": "xs:string",
"custom2": "xs:string",
"custom3": "xs:string",
"custom4": "xs:string",
"custom5": "xs:string",
"custom6": "xs:string",
"custom7": "xs:string",
"custom8": "xs:string",
"custom9": "xs:string",
"custom10": "xs:string",
"custom11": "xs:dateTime",
"custom12": "xs:dateTime",
"custom13": "xs:dateTime",
"custom14": "xs:dateTime",
"custom15": "xs:dateTime",
"custom16": 1,
"custom17": 1,
"custom18": 1,
"custom19": 1,
"custom20": 1,
"custom21": 1.23,
"custom22": 1.23,
"custom23": 1.23,
"custom24": 1.23,
"custom25": 1.23
}
};
fetch(endpoint, {
method: 'POST',
headers: {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
},
body: JSON.stringify(payload)
}).then(res => res.json())
.then(res => console.log(res));
const axios = require('axios');
const endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts";
const payload = {
"@service": "apps/com.hornbill.suppliermanager/SupplierContracts",
"@method": "addSupplierContract",
"params": {
"supplierId": 1,
"name": "xs:string",
"description": "xs:string",
"type": "xs:string",
"startDate": "xs:dateTime",
"endDate": "xs:dateTime",
"renewalStartDate": "xs:dateTime",
"renewalEndDate": "xs:dateTime",
"currency": "xs:string",
"value": 1.23,
"acquisitionMethod": "xs:string",
"cancellationNoticePeriod": "xs:string",
"costCentre": "xs:string",
"invoiceNumber": "xs:string",
"orderNumber": "xs:string",
"paymentType": "xs:string",
"status": "xs:string",
"subStatus": "xs:string",
"ownedBy": "xs:string",
"budgetOwner": "xs:string",
"businessOwner": "xs:string",
"workingTimeCalendar": "xs:string",
"targetMinutesPerEvent": 1,
"agreedComplianceTargetPercentage": 1.23,
"contactEmailAddress": "xs:string",
"penaltyDescription": "xs:string",
"notes": "xs:string",
"custom0": "xs:string",
"custom1": "xs:string",
"custom2": "xs:string",
"custom3": "xs:string",
"custom4": "xs:string",
"custom5": "xs:string",
"custom6": "xs:string",
"custom7": "xs:string",
"custom8": "xs:string",
"custom9": "xs:string",
"custom10": "xs:string",
"custom11": "xs:dateTime",
"custom12": "xs:dateTime",
"custom13": "xs:dateTime",
"custom14": "xs:dateTime",
"custom15": "xs:dateTime",
"custom16": 1,
"custom17": 1,
"custom18": 1,
"custom19": 1,
"custom20": 1,
"custom21": 1.23,
"custom22": 1.23,
"custom23": 1.23,
"custom24": 1.23,
"custom25": 1.23
}
};
const axiosConfig = {
headers: {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
}
};
axios.post(endpoint, payload, axiosConfig)
.then((res) => {
console.log("RESPONSE RECEIVED: ", res);
})
.catch((err) => {
console.log("AXIOS ERROR: ", err);
})
$endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts";
$payload = (object) [
'@service' => 'apps/com.hornbill.suppliermanager/SupplierContracts',
'@method' => 'addSupplierContract',
'params' => (object) [
'supplierId' => 'xs:integer',
'name' => 'xs:string',
'description' => 'xs:string',
'type' => 'xs:string',
'startDate' => 'xs:dateTime',
'endDate' => 'xs:dateTime',
'renewalStartDate' => 'xs:dateTime',
'renewalEndDate' => 'xs:dateTime',
'currency' => 'xs:string',
'value' => 'xs:decimal',
'acquisitionMethod' => 'xs:string',
'cancellationNoticePeriod' => 'xs:string',
'costCentre' => 'xs:string',
'invoiceNumber' => 'xs:string',
'orderNumber' => 'xs:string',
'paymentType' => 'xs:string',
'status' => 'xs:string',
'subStatus' => 'xs:string',
'ownedBy' => 'xs:string',
'budgetOwner' => 'xs:string',
'businessOwner' => 'xs:string',
'workingTimeCalendar' => 'xs:string',
'targetMinutesPerEvent' => 'xs:integer',
'agreedComplianceTargetPercentage' => 'xs:decimal',
'contactEmailAddress' => 'xs:string',
'penaltyDescription' => 'xs:string',
'notes' => 'xs:string',
'custom0' => 'xs:string',
'custom1' => 'xs:string',
'custom2' => 'xs:string',
'custom3' => 'xs:string',
'custom4' => 'xs:string',
'custom5' => 'xs:string',
'custom6' => 'xs:string',
'custom7' => 'xs:string',
'custom8' => 'xs:string',
'custom9' => 'xs:string',
'custom10' => 'xs:string',
'custom11' => 'xs:dateTime',
'custom12' => 'xs:dateTime',
'custom13' => 'xs:dateTime',
'custom14' => 'xs:dateTime',
'custom15' => 'xs:dateTime',
'custom16' => 'xs:integer',
'custom17' => 'xs:integer',
'custom18' => 'xs:integer',
'custom19' => 'xs:integer',
'custom20' => 'xs:integer',
'custom21' => 'xs:decimal',
'custom22' => 'xs:decimal',
'custom23' => 'xs:decimal',
'custom24' => 'xs:decimal',
'custom25' => 'xs:decimal',
]
];
$headers = [
'Authorization: ESP-APIKEY yourHornbillAPIKey',
'Content-Type: application/json'
];
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $endpoint);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$resp = curl_exec($curl);
curl_close($curl);
echo $resp;
$Endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts"
$Body = @{
"@service" = "apps/com.hornbill.suppliermanager/SupplierContracts"
"@method" = "addSupplierContract"
params = @{
supplierId = "xs:integer"
name = "xs:string"
description = "xs:string"
type = "xs:string"
startDate = "xs:dateTime"
endDate = "xs:dateTime"
renewalStartDate = "xs:dateTime"
renewalEndDate = "xs:dateTime"
currency = "xs:string"
value = "xs:decimal"
acquisitionMethod = "xs:string"
cancellationNoticePeriod = "xs:string"
costCentre = "xs:string"
invoiceNumber = "xs:string"
orderNumber = "xs:string"
paymentType = "xs:string"
status = "xs:string"
subStatus = "xs:string"
ownedBy = "xs:string"
budgetOwner = "xs:string"
businessOwner = "xs:string"
workingTimeCalendar = "xs:string"
targetMinutesPerEvent = "xs:integer"
agreedComplianceTargetPercentage = "xs:decimal"
contactEmailAddress = "xs:string"
penaltyDescription = "xs:string"
notes = "xs:string"
custom0 = "xs:string"
custom1 = "xs:string"
custom2 = "xs:string"
custom3 = "xs:string"
custom4 = "xs:string"
custom5 = "xs:string"
custom6 = "xs:string"
custom7 = "xs:string"
custom8 = "xs:string"
custom9 = "xs:string"
custom10 = "xs:string"
custom11 = "xs:dateTime"
custom12 = "xs:dateTime"
custom13 = "xs:dateTime"
custom14 = "xs:dateTime"
custom15 = "xs:dateTime"
custom16 = "xs:integer"
custom17 = "xs:integer"
custom18 = "xs:integer"
custom19 = "xs:integer"
custom20 = "xs:integer"
custom21 = "xs:decimal"
custom22 = "xs:decimal"
custom23 = "xs:decimal"
custom24 = "xs:decimal"
custom25 = "xs:decimal"
}
}
$Header = @{
"Authorization" = "ESP-APIKEY yourHornbillAPIKey"
}
$Parameters = @{
Method = "POST"
Uri = $Endpoint
Headers = $Header
Body = ($Body | ConvertTo-Json)
ContentType = "application/json"
}
Invoke-RestMethod @Parameters
import requests
import json
endpoint = "https://api.hornbill.com/yourinstanceid/xmlmc/apps/com.hornbill.suppliermanager/SupplierContracts"
headers = {
"Authorization": "ESP-APIKEY yourHornbillAPIKey"
}
payload={
"@service":"apps/com.hornbill.suppliermanager/SupplierContracts",
"@method":"addSupplierContract",
"params":{
"supplierId":"xs:integer",
"name":"xs:string",
"description":"xs:string",
"type":"xs:string",
"startDate":"xs:dateTime",
"endDate":"xs:dateTime",
"renewalStartDate":"xs:dateTime",
"renewalEndDate":"xs:dateTime",
"currency":"xs:string",
"value":"xs:decimal",
"acquisitionMethod":"xs:string",
"cancellationNoticePeriod":"xs:string",
"costCentre":"xs:string",
"invoiceNumber":"xs:string",
"orderNumber":"xs:string",
"paymentType":"xs:string",
"status":"xs:string",
"subStatus":"xs:string",
"ownedBy":"xs:string",
"budgetOwner":"xs:string",
"businessOwner":"xs:string",
"workingTimeCalendar":"xs:string",
"targetMinutesPerEvent":"xs:integer",
"agreedComplianceTargetPercentage":"xs:decimal",
"contactEmailAddress":"xs:string",
"penaltyDescription":"xs:string",
"notes":"xs:string",
"custom0":"xs:string",
"custom1":"xs:string",
"custom2":"xs:string",
"custom3":"xs:string",
"custom4":"xs:string",
"custom5":"xs:string",
"custom6":"xs:string",
"custom7":"xs:string",
"custom8":"xs:string",
"custom9":"xs:string",
"custom10":"xs:string",
"custom11":"xs:dateTime",
"custom12":"xs:dateTime",
"custom13":"xs:dateTime",
"custom14":"xs:dateTime",
"custom15":"xs:dateTime",
"custom16":"xs:integer",
"custom17":"xs:integer",
"custom18":"xs:integer",
"custom19":"xs:integer",
"custom20":"xs:integer",
"custom21":"xs:decimal",
"custom22":"xs:decimal",
"custom23":"xs:decimal",
"custom24":"xs:decimal",
"custom25":"xs:decimal",
},
}
response = requests.request("POST", endpoint, json=payload, headers=headers)
print(response.text)
- Version {{docApp.book.version}}
- Node {{docApp.node}} / {{docApp.build}}