Skip to content
Status

Cancel a contract

POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/contracts/{contract_id}/cancel

POST
/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.

contract_id
required
string

The contract’s ID (co_...), or the alt_key you gave it.

Media typeapplication/json
object
write_off
boolean

If any outstanding amount should be written off. If not and there’s an outstanding amount, the contract will transition to CANCELLING status

cancel_retries
boolean

If automatic retries should be stopped for any outstanding amount. This will set next_payment to blank

strict
boolean

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.

Updated contract

Media typeapplication/json
object
contract
object

A contract representing a one-time or recurring payment agreement

object
account
string

Associated account ID

alt_key
string

Your reference for the contract

amount
string

Contract amount

channel
string

Channel ID

completed
string · date-time

When the contract was completed

created
string · date-time

When the contract was created

currency
string

Currency code

description
string

Description passed to the payment API

designation
string

Designation ID

frequency
string · enum

Payment frequency for recurring contracts

Allowed values: WEEKLY FORTNIGHTLY BIMONTHLY MONTHLY QUARTERLY BIANNUALLY ANNUALLY
gateway
string

Payment gateway ID

id
string

Contract ID

initiated
string · date-time

When the contract was initiated

initiative
string

Initiative ID

keep_active_until
string · date-time

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.

last_charge
string

ID of the last charge

last_transaction
string

ID of the last transaction

legal_entity
string

Legal entity ID

metadata
object
e.g. { "order_id": "12345", "customer_reference": "CUS-001"}

Custom key-value pairs stored on the contract

object
key
additional properties
string
next_contract
string

ID of the successor contract (created when amount or frequency is changed)

next_payment
string · date-time

When the next payment will be attempted

nonce
string

Unique identifier for duplicate payment prevention. If the same nonce is submitted within 24 hours:

  1. No new contract will be created
  2. The success status of the previous contract will be returned
account_alt_key
string

Your identifier for the account on this contract

charge_count
integer

Number of charges raised on this contract

event_date
string · date-time

Event date associated with the payment

outstanding_amount
string

Amount remaining to be paid

payment_method
string

Payment method ID

recurring
boolean

Whether this is a recurring contract

retry_complete
boolean

Whether retry attempts are exhausted

retry_count
integer

Number of retry attempts made

status
string · enum

Current contract status

Allowed values: SETUP ACTIVE FAILING PENDING SUSPENDED UNRESOLVED COMPLETED CANCELLED CANCELLING
updated
string · date-time

When the contract was last modified

Bad request

Media typeapplication/json

Every error has a code and a message. Some add more fields alongside them, with detail about the error.

object
code
string

The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.

message
string

What went wrong, in words, for logs and support.

Unauthorised: the API key is missing or not valid

Media typeapplication/json

Every error has a code and a message. Some add more fields alongside them, with detail about the error.

object
code
string

The error code, for example VALIDATION_ERROR, INVALID, INVALID_REQUEST, UNAUTHORIZED, FORBIDDEN or NOT_FOUND. Program against this, not the message.

message
string

What went wrong, in words, for logs and support.

Example
{
"code": "UNAUTHORIZED",
"message": "Unauthorised"
}

Was this page helpful?