mutation CreateContract($input: CreateContractInput!) {
createContract(input: $input) {
activationEndDate
activationStartDate
billingId
billingState
contractId
createdAt
}
}{
"input": {
"customerId": "string",
"subscriptions": [
{}
]
}
}{
"data": {
"createContract": {
"activationEndDate": "value",
"activationStartDate": "value",
"billingId": "string",
"billingState": "ACTIVE",
"contractId": "string",
"createdAt": "value"
}
}
}createContract
Create a contract for a customer together with all of its (custom) subscriptions in a single atomic operation. Every subscription is created inside one transaction — any validation or creation failure rolls the whole contract back. Returns the customer’s contract from the connected billing provider (Received).
createContract(input: CreateContractInput!): ContractDTO!Arguments
Input for creating a contract and its subscriptions atomically.
Returns
Activation end date (ISO 8601)
Activation start date (ISO 8601)
The billing provider (Received) contract ID; null until the contract has synced to the billing provider
Contract state
The Stigg contract ref ID (the key used to fetch/update/delete this contract)
Timestamp of creation (ISO 8601)
External ID of the customer the contract belongs to (the Stigg customer ref ID)
External ID for the contract: the metering provider externalId when one is mapped, otherwise the contract ID.
The persisted Stigg contract id (matches Subscription.contractId; present for Stigg-managed contracts)
The most recent non-draft invoice for this contract (open, paid, or canceled), when one exists
Contract name
Preview of the contract's next (upcoming) invoice, when the contract has one
Purchase-order number, when set on the contract
The Stigg contract ref ID (present for Stigg-managed contracts; the key used to update/delete)
Contract state
Custom subscriptions attached to this contract (empty when none)
mutation CreateContract($input: CreateContractInput!) {
createContract(input: $input) {
activationEndDate
activationStartDate
billingId
billingState
contractId
createdAt
}
}{
"input": {
"customerId": "string",
"subscriptions": [
{}
]
}
}{
"data": {
"createContract": {
"activationEndDate": "value",
"activationStartDate": "value",
"billingId": "string",
"billingState": "ACTIVE",
"contractId": "string",
"createdAt": "value"
}
}
}