Skip to content
Status

Refund a contract

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

POST
/contracts/{contract_id}/refund

You can refund a contract, which allows you to refund multiple transactions at once for recurring payments / subscriptions.

contract_id
required
string

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

Media typeapplication/json
object
refund
object
object
amount
string
e.g. "15.00"

(Optional) The amount of the refund as a string e.g., “10”. The amount should not have commas and use a . as a decimal separator. If omitted, the entire unrefunded amount of the contract will be refunded.

legal_entities
Array<object>

(Optional - enterprise) This field is an ALTERNATIVE to amount. For contracts splitting payments into multiple entities, this allows you to specify which legal_entities are refunded.

object
code
required
string

The code of the legal entity.

amount
string

(Optional) The amount to refund. If omitted, all transactions for this entity will be refunded.

reason
string
e.g. "Subscription cancelled"

(Optional) The reason for the refund (free text)

manual
boolean

(Optional) Set to true if you do not want to process the refund via the gateway, but simply record that a refund was performed offline.

validate_only
boolean

(Optional) Set to true if you do not want to perform the refund, just check to see what would be refunded.

Refund processed

Media typeapplication/json
One of:
object
refund_candidates
Array<object>

A list of candidate refunds to be taken if instructed.

object
source_transaction
string
e.g. "tr_11842_11072"

The transaction to be refunded.

amount
number
e.g. 10

The amount to be refunded from this transaction.

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?