Cancel a contract
POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/contracts/{contract_id}/cancel
Cancelling a contract will prevent future charges being created on a contract and stop all automated payments. A contract may still have an outstanding balance at time of cancellation.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The contract’s ID (co_...), or the alt_key you gave it.
Request Bodyrequired
Section titled “Request Bodyrequired”object
If any outstanding amount should be written off. If not and there’s an outstanding amount, the contract will transition to CANCELLING status
If automatic retries should be stopped for any outstanding amount. This will set next_payment to blank
If true, reject the cancellation when a transaction is in progress on the contract. Use when you need certainty that no further payment will be allocated after cancellation. Defaults to false, in which case the cancellation proceeds and any in-progress transaction resolves independently.
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.