Update a contract
PUThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/contracts/{contract_id}
Update specific properties of a contract. The following fields can be modified:
- next_charge: Next charge date or ‘now’. Not accepted on a scheduled-charges contract or together with
charges(move a charge’sdueinstead), nor once every occurrence has been charged - occurrences: Total number of charges. Send
0to remove the cap (until cancelled). Raising or removing the cap is refused once every occurrence has been charged - next_payment: Next payment attempt date, no more than 24 hours in the past, or ‘now’. Send an empty string to clear it (not on a scheduled-charges contract)
- payment_method: New payment method ID. It must belong to the contract’s account and be active. On a scheduled single payment it changes the card the payment will be taken with. Cannot be combined with
status: SUSPENDED - amount: New charge amount (creates new contract)
- resume: Resume cancelled contract
- scheduled_date: New schedule date
- status: SUSPENDED/ACTIVE
- metadata: Custom key-value pairs stored on the contract
- alt_key: Your reference for the contract
- description: Payment description
- event_date: Event date
- keep_active_until: Optional date that keeps the contract active past its final scheduled payment, so late amendments can still be applied. Send an empty string to clear it, or ‘now’ to end it now
- charges: Add, update, or remove scheduled charges on a scheduled-charges contract
- modify_in_place: Edit the existing contract and its charges directly instead of cancelling and cloning (only relevant when
chargesis supplied)
Resume restriction: when resuming a cancelled or suspended contract (by setting resume: true or status: ACTIVE), you cannot change amount, frequency, charges, event_date or payment_method in the same request.
Legal entities: a contract’s legal_entity / legal_entities split cannot be changed after it is created. Sending the current value back is accepted and ignored; any other value is refused. Each charge’s own legal_entities can be changed, and must add up to the charge amount.
Dates: next_charge, next_payment, keep_active_until and each charge’s due must be ISO 8601 dates (e.g. 2026-12-31T12:00:00+01:00). A date with an offset is honoured; a date without one is read as UTC. An invalid date, such as 30 February, is refused.
A value equal to the one already stored (for example a contract sent back unchanged) is not re-checked.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The contract’s ID (co_...).
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Your reference for the contract
Payment description
Event date associated with the payment
Optional. When set to a future date, the contract stays active until this date even after its final scheduled payment is collected, so mid-term amendments can still be applied. Setting a past date, or an empty string to clear it, lets the contract complete normally once no balance is outstanding.
{ "order_id": "12345", "customer_reference": "CUS-001"}Custom key-value pairs to store on the contract
object
Next payment attempt date, no more than 24 hours in the past, or ‘now’. An empty string clears it (not on a scheduled-charges contract).
Total number of charges. 0 removes the cap, so the contract continues until cancelled.
Payment method ID of the contract’s account, active or failing. Cannot be combined with status: SUSPENDED.
Example
[ { "id": "cg_11842_10005", "amount": "75.00" }, { "alt_key": "INSTALMENT_4", "amount": "50.00", "due": "2026-08-01T09:00:00Z" }, { "id": "cg_11842_10006", "delete": true }]Change the scheduled charges on a scheduled-charges contract. Two modes
are available, controlled by modify_in_place.
Replacement mode (default)
The existing contract is cancelled and a new one is created. The array must list every charge from the existing contract — this is how you acknowledge its current state. What each entry does depends on the state of the charge it refers to:
- Already-processed charges (paid, in-flight, or written off) — pass
{ id }or{ alt_key }with no other fields. Listing them is purely about acknowledging the prior state of the existing contract; they remain on the cancelled original as historical record and are not recreated on the new contract. Passing additional fields on these entries is rejected. - Unpaid existing charges are transferred across to the new
contract. Pass
{ id }or{ alt_key }to carry the charge over unchanged, or includeamount,due, or other fields in the same entry to modify it during the transfer. - Create a new charge on the new contract — pass
{ amount, due }(and optionallyalt_key) with noidoralt_keymatching an existing charge.
In-place mode (modify_in_place: true)
Edits the existing contract and its charges directly. No new contract is created and existing charge IDs are retained. Each entry takes one of three shapes:
- Add a new charge — omit
id.amountanddueare required. - Update an existing charge — include its
idplus the fields to change (e.g.,amountordue). Omitted fields are left unchanged. - Remove an existing charge — include its
idoralt_keywithdelete: true.
Validation
The same rules apply as on create: a new or moved due cannot be more than
7 days in the past (an existing charge whose due is unchanged is not
checked), amounts must be greater than zero, and a charge’s
legal_entities must add up to its amount - changing the amount of a split
charge means sending a matching split.
Not permitted on a resume operation — see the resume restriction above.
A single entry in the charges array on a contract update. The valid combinations
depend on whether modify_in_place is set — see the charges description on the
update endpoint for the full rules.
object
"cg_11842_10005"Existing charge ID. In replacement mode (default), id (interchangeable with
alt_key) identifies a charge from the existing contract: processed charges
stay on the cancelled original, while unpaid charges are transferred to the
new contract and may be modified by passing additional fields. In
modify_in_place mode, include id to update or delete an existing charge.
"INSTALMENT_4"Your reference for this charge. When updating, can be used in place of id
to identify an existing charge on the contract.
"50.00"The charge amount. Required when creating a charge.
"2026-08-01T09:00:00Z"When the charge is due. Required when creating a charge. Accepts an ISO 8601
timestamp or the literal string "now". Cannot be more than 24 hours in the
past.
Only valid in modify_in_place mode. Set to true together with id or
alt_key to remove the charge from the contract.
Only relevant when charges is supplied. When true, edits the existing
contract and its charges in place rather than cancelling the contract and
creating a new one. See the charges description for the entry shapes
each mode accepts. Defaults to false.
Responses
Section titled “Responses”Updated contract
object
A contract representing a one-time or recurring payment agreement
object
Associated account ID
Your reference for the contract
Contract amount
Channel ID
When the contract was completed
When the contract was created
Currency code
Description passed to the payment API
Designation ID
Payment frequency for recurring contracts
Payment gateway ID
Contract ID
When the contract was initiated
Initiative ID
Optional. When set to a future date, the contract stays active until this date even after its final scheduled payment is collected, so mid-term amendments can still be applied. Once the date has passed and no balance is outstanding, the contract completes normally. Omitted when not set.
ID of the last charge
ID of the last transaction
Legal entity ID
{ "order_id": "12345", "customer_reference": "CUS-001"}Custom key-value pairs stored on the contract
object
ID of the successor contract (created when amount or frequency is changed)
When the next payment will be attempted
Unique identifier for duplicate payment prevention. If the same nonce is submitted within 24 hours:
- No new contract will be created
- The success status of the previous contract will be returned
Your identifier for the account on this contract
Number of charges raised on this contract
Event date associated with the payment
Amount remaining to be paid
Payment method ID
Whether this is a recurring contract
Whether retry attempts are exhausted
Number of retry attempts made
Current contract status
When the contract was last modified
Bad request
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Unauthorised: the API key is missing or not valid
Every error has a code and a message. Some add more fields alongside them, with detail about the error.
object
The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.
What went wrong, in words, for logs and support.
Example
{ "code": "UNAUTHORIZED", "message": "Unauthorised"}Was this page helpful?
What went wrong?
Thanks for telling us.