Allows adding contract frequencies to be attached to a bundle
1 min
POST
https://api.fictive.com/REST/api/bundles/{bundleReference}/contracts
Path Parameters
- bundleReferencestringrequiredDescription
Header Parameters
- X-TokenIdstringDescription
- X-SessionIdstringDescription
- X-VersionstringrequiredDescription
- OriginstringDescription
Body Parameters
- contractReferencesFictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleContractInforequiredDescription
- contractsstring[]ExampleDescription
Responses
200
- FictiveGlobal.Api.Rest.Dtos.v1.Bundle.BundleDescription
- namestringDescription
- descriptionstringDescription
- tagstringDescription
- statusstring<Active | Inactive | Archived>Description
404
409
412
curl
curl --request POST \
--url https://api.fictive.com/REST/api/bundles/{bundleReference}/contracts \
--header 'accept: application/json' \
--header 'x-version: string'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-version", "string");
var requestOptions = {
method: 'POST',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.fictive.com/REST/api/bundles/{bundleReference}/contracts", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.fictive.com/REST/api/bundles/{bundleReference}/contracts")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-version"] = "string"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.fictive.com/REST/api/bundles/{bundleReference}/contracts"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-version': 'string'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
200
{
"bundleReference": "001PB4PI6KTXCYR8R4",
"carts": [
{
"cartReference": "0010K4PI6KTXCYFT82",
"active": true,
"contractReference": "0010C4PI6KTXCYB8R9",
"lineItems": [
{
"lineItemReference": "0010I4PI6KTEVRY8R2",
"description": "The first line item in the cart",
"pricing": {
"grossAmount": 2.5,
"netAmount": 2.08,
"taxAmount": 0.42,
"currency": "GBP"
},
"quantity": 1,
"productInfo": {
"title": "Example Product",
"productReference": "0010B4PI6KTXCYR8R4"
},
"customLineItemParameters": {}
}
]
}
],
"name": "Fifth Bundle (With Tag & Cart)",
"description": "The fifth bundle, featuring a tag & single cart",
"tag": "A005",
"status": "Active"
}404
// Not found
• Bundle cannot be found.
• Contract cannot be found.
409
// Conflict
• A contract cannot be assigned to a bundle more than once.
412
// Precondition Failed
• A minimum of one product is required in a bundle before a contract can be assigned.
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.