Update a contract
curl --request PATCH \
--url https://api.spacebring.com/contracts/v1/{contractId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract": {
"actionable": true,
"expirationDate": "2023-11-07T05:31:56Z",
"items": [
{
"quantity": 2,
"title": "<string>",
"couponRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneOff": true,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"templateRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endDate": "2023-11-07T05:31:56Z",
"signers": [
{
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phoneNumber": "<string>",
"surname": "<string>"
}
],
"startDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.spacebring.com/contracts/v1/{contractId}"
payload = { "contract": {
"actionable": True,
"expirationDate": "2023-11-07T05:31:56Z",
"items": [
{
"quantity": 2,
"title": "<string>",
"couponRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneOff": True,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"templateRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endDate": "2023-11-07T05:31:56Z",
"signers": [
{
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phoneNumber": "<string>",
"surname": "<string>"
}
],
"startDate": "2023-11-07T05:31:56Z"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contract: {
actionable: true,
expirationDate: '2023-11-07T05:31:56Z',
items: [
{
quantity: 2,
title: '<string>',
couponRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
oneOff: true,
optionRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
planRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 123,
productRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
resourceRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tierRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
templateRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
endDate: '2023-11-07T05:31:56Z',
signers: [
{
email: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
phoneNumber: '<string>',
surname: '<string>'
}
],
startDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.spacebring.com/contracts/v1/{contractId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spacebring.com/contracts/v1/{contractId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'contract' => [
'actionable' => true,
'expirationDate' => '2023-11-07T05:31:56Z',
'items' => [
[
'quantity' => 2,
'title' => '<string>',
'couponRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'oneOff' => true,
'optionRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'planRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 123,
'productRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'resourceRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tierRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'templateRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'endDate' => '2023-11-07T05:31:56Z',
'signers' => [
[
'email' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'phoneNumber' => '<string>',
'surname' => '<string>'
]
],
'startDate' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spacebring.com/contracts/v1/{contractId}"
payload := strings.NewReader("{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.spacebring.com/contracts/v1/{contractId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/contracts/v1/{contractId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"type": "<string>"
}Contracts
Update a contract
Update a contract.
OAuth
Required scopes:invoicesPATCH
/
contracts
/
v1
/
{contractId}
Update a contract
curl --request PATCH \
--url https://api.spacebring.com/contracts/v1/{contractId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"contract": {
"actionable": true,
"expirationDate": "2023-11-07T05:31:56Z",
"items": [
{
"quantity": 2,
"title": "<string>",
"couponRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneOff": true,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"templateRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endDate": "2023-11-07T05:31:56Z",
"signers": [
{
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phoneNumber": "<string>",
"surname": "<string>"
}
],
"startDate": "2023-11-07T05:31:56Z"
}
}
'import requests
url = "https://api.spacebring.com/contracts/v1/{contractId}"
payload = { "contract": {
"actionable": True,
"expirationDate": "2023-11-07T05:31:56Z",
"items": [
{
"quantity": 2,
"title": "<string>",
"couponRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"oneOff": True,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"templateRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"endDate": "2023-11-07T05:31:56Z",
"signers": [
{
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"phoneNumber": "<string>",
"surname": "<string>"
}
],
"startDate": "2023-11-07T05:31:56Z"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contract: {
actionable: true,
expirationDate: '2023-11-07T05:31:56Z',
items: [
{
quantity: 2,
title: '<string>',
couponRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
oneOff: true,
optionRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
planRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 123,
productRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
resourceRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
tierRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
templateRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
endDate: '2023-11-07T05:31:56Z',
signers: [
{
email: '<string>',
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
phoneNumber: '<string>',
surname: '<string>'
}
],
startDate: '2023-11-07T05:31:56Z'
}
})
};
fetch('https://api.spacebring.com/contracts/v1/{contractId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.spacebring.com/contracts/v1/{contractId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'contract' => [
'actionable' => true,
'expirationDate' => '2023-11-07T05:31:56Z',
'items' => [
[
'quantity' => 2,
'title' => '<string>',
'couponRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'oneOff' => true,
'optionRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'planRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 123,
'productRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'resourceRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'tierRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'templateRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'endDate' => '2023-11-07T05:31:56Z',
'signers' => [
[
'email' => '<string>',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'phoneNumber' => '<string>',
'surname' => '<string>'
]
],
'startDate' => '2023-11-07T05:31:56Z'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.spacebring.com/contracts/v1/{contractId}"
payload := strings.NewReader("{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.spacebring.com/contracts/v1/{contractId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/contracts/v1/{contractId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contract\": {\n \"actionable\": true,\n \"expirationDate\": \"2023-11-07T05:31:56Z\",\n \"items\": [\n {\n \"quantity\": 2,\n \"title\": \"<string>\",\n \"couponRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"oneOff\": true,\n \"optionRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"templateRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"signers\": [\n {\n \"email\": \"<string>\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"phoneNumber\": \"<string>\",\n \"surname\": \"<string>\"\n }\n ],\n \"startDate\": \"2023-11-07T05:31:56Z\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"type": "<string>"
}Authorizations
See our authentication documentation for how to authorize your requests
Headers
The id of the network. Required when using bearer token authentication
Path Parameters
The id of the contract.
Body
application/json
Contract fields to update.
Show child attributes
Show child attributes
Response
No Content
Was this page helpful?
⌘I