curl --request POST \
--url https://api.stigg.io/api/v1/contracts/{id}/subscriptions \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"subscriptions": [
{
"existingSubscriptionId": "<string>"
}
],
"subscriptionIds": [
"<string>"
]
}
'import requests
url = "https://api.stigg.io/api/v1/contracts/{id}/subscriptions"
payload = {
"subscriptions": [{ "existingSubscriptionId": "<string>" }],
"subscriptionIds": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptions: [{existingSubscriptionId: '<string>'}],
subscriptionIds: ['<string>']
})
};
fetch('https://api.stigg.io/api/v1/contracts/{id}/subscriptions', 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.stigg.io/api/v1/contracts/{id}/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subscriptions' => [
[
'existingSubscriptionId' => '<string>'
]
],
'subscriptionIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.stigg.io/api/v1/contracts/{id}/subscriptions"
payload := strings.NewReader("{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.post("https://api.stigg.io/api/v1/contracts/{id}/subscriptions")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/contracts/{id}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"contractId": "contract-acme-2026",
"billingId": "ct_1a2b3c4d",
"id": "3452155b-deca-4d7f-91e5-82d486dc8bb0",
"refId": "contract-acme-2026",
"poNumber": "PO-4821",
"externalId": "contract-acme-2026",
"customerExternalId": "customer-acme",
"name": "PO-4821",
"state": "ACTIVE",
"billingState": "ACTIVE",
"activationStartDate": "2026-01-01T00:00:00.000Z",
"activationEndDate": "2026-12-31T00:00:00.000Z",
"createdAt": "2025-12-15T09:30:00.000Z",
"nextInvoice": {
"invoiceId": "a3f1c2de-5b47-4c8e-9f10-2d6b8e4a7c31",
"amount": {
"amount": 4900,
"currency": "usd"
},
"dueDate": "2026-08-01T00:00:00.000Z",
"periodStart": "2026-07-01T00:00:00.000Z",
"periodEnd": "2026-08-01T00:00:00.000Z"
},
"latestInvoice": {
"billingId": "inv_abc123",
"status": "OPEN",
"createdAt": "2026-07-01T00:00:00.000Z",
"total": 4900,
"amountDue": 4900,
"currency": "usd",
"pdfUrl": null,
"requiresAction": false,
"billingReason": null
},
"subscriptions": [
{
"subscriptionId": "subscription-acme-platform",
"planDisplayName": "Enterprise Platform",
"productDisplayName": "Revvenu"
}
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Attach subscriptions to contract
Adds subscriptions to the contract, alongside the ones already attached. Each entry either references an existing custom subscription or carries a newSubscription body, which is provisioned and attached in the same call — so a contract can be created first and its subscriptions added after, without a subscription ever existing unattached. subscriptionIds is shorthand for a list of existing references. Every subscription must belong to the contract’s customer and be custom-priced. A subscription joining the contract must cover a product no other subscription on it already covers; re-sending one that is already attached is accepted unchanged, so the duplicate-product rule never fires on a repeat. Use this instead of updating the contract with the full subscription set, which replaces it.
curl --request POST \
--url https://api.stigg.io/api/v1/contracts/{id}/subscriptions \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"subscriptions": [
{
"existingSubscriptionId": "<string>"
}
],
"subscriptionIds": [
"<string>"
]
}
'import requests
url = "https://api.stigg.io/api/v1/contracts/{id}/subscriptions"
payload = {
"subscriptions": [{ "existingSubscriptionId": "<string>" }],
"subscriptionIds": ["<string>"]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptions: [{existingSubscriptionId: '<string>'}],
subscriptionIds: ['<string>']
})
};
fetch('https://api.stigg.io/api/v1/contracts/{id}/subscriptions', 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.stigg.io/api/v1/contracts/{id}/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'subscriptions' => [
[
'existingSubscriptionId' => '<string>'
]
],
'subscriptionIds' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.stigg.io/api/v1/contracts/{id}/subscriptions"
payload := strings.NewReader("{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.post("https://api.stigg.io/api/v1/contracts/{id}/subscriptions")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.stigg.io/api/v1/contracts/{id}/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptions\": [\n {\n \"existingSubscriptionId\": \"<string>\"\n }\n ],\n \"subscriptionIds\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"contractId": "contract-acme-2026",
"billingId": "ct_1a2b3c4d",
"id": "3452155b-deca-4d7f-91e5-82d486dc8bb0",
"refId": "contract-acme-2026",
"poNumber": "PO-4821",
"externalId": "contract-acme-2026",
"customerExternalId": "customer-acme",
"name": "PO-4821",
"state": "ACTIVE",
"billingState": "ACTIVE",
"activationStartDate": "2026-01-01T00:00:00.000Z",
"activationEndDate": "2026-12-31T00:00:00.000Z",
"createdAt": "2025-12-15T09:30:00.000Z",
"nextInvoice": {
"invoiceId": "a3f1c2de-5b47-4c8e-9f10-2d6b8e4a7c31",
"amount": {
"amount": 4900,
"currency": "usd"
},
"dueDate": "2026-08-01T00:00:00.000Z",
"periodStart": "2026-07-01T00:00:00.000Z",
"periodEnd": "2026-08-01T00:00:00.000Z"
},
"latestInvoice": {
"billingId": "inv_abc123",
"status": "OPEN",
"createdAt": "2026-07-01T00:00:00.000Z",
"total": 4900,
"amountDue": 4900,
"currency": "usd",
"pdfUrl": null,
"requiresAction": false,
"billingReason": null
},
"subscriptions": [
{
"subscriptionId": "subscription-acme-platform",
"planDisplayName": "Enterprise Platform",
"productDisplayName": "Revvenu"
}
]
}
}{
"message": "<string>",
"code": "BadUserInput",
"reason": "<string>"
}{
"message": "<string>",
"code": "Unauthenticated"
}{
"message": "<string>",
"code": "IdentityForbidden"
}{
"message": "<string>",
"code": "CustomerNotFound"
}{
"message": "<string>",
"code": "DuplicatedEntityNotAllowed"
}{
"message": "<string>",
"code": "RateLimitExceeded"
}Authorizations
Server API Key
Headers
Account ID — optional when authenticating with a user JWT (Bearer token); falls back to the user's first membership. Ignored for API-key auth.
Environment ID — required when authenticating with a user JWT (Bearer token) on environment-scoped endpoints. Ignored for API-key auth (env is intrinsic to the key).
Path Parameters
The unique identifier of the entity
1 - 255Body
Input for attaching existing custom subscriptions to a contract.
Show child attributes
Show child attributes
Shorthand for attaching existing custom subscriptions by ref ID. Added to what the contract already carries — the set is never replaced. To provision a new subscription into the contract, send it in subscriptions as a newSubscription entry instead.
Shorthand for attaching existing custom subscriptions by ref ID. Added to what the contract already carries — the set is never replaced. To provision a new subscription into the contract, send it in subscriptions as a newSubscription entry instead.
1 - 255^[a-zA-Z0-9][a-zA-Z0-9_|.-]*$Response
The contract, including its full set of attached subscriptions.
Response object
A billing contract as reported by the connected billing provider.
Show child attributes
Show child attributes
