Refund a contract
POSThttps://app.shuttleglobal.com/c/api/instances/{instance_key}/contracts/{contract_id}/refund
You can refund a contract, which allows you to refund multiple transactions at once for recurring payments / subscriptions.
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
object
"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.
(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
The code of the legal entity.
(Optional) The amount to refund. If omitted, all transactions for this entity will be refunded.
"Subscription cancelled"(Optional) The reason for the refund (free text)
(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.
(Optional) Set to true if you do not want to perform the refund, just check to see what would be refunded.
Responses
Section titled “Responses”Refund processed
object
A list of candidate refunds to be taken if instructed.
object
"tr_11842_11072"The transaction to be refunded.
10The amount to be refunded from this transaction.
object
SUCCESS if all refunds completed successfully, PENDING if any of the refunds is in progress, DECLINED if any of the refunds failed
A list of refunds taken.
object
"ref_11842_11073"The unique ID of the refund
"pay_11842_11072"The original payment this refund relates to
"10"The amount refunded
"2020-11-27T15:17:15.000Z"When the refund was created/instructed
"2020-11-27T15:17:18.000Z"When the refund completed processing
"Customer requested cancellation"The reason for the refund
"BOLT-00011073"A unique customer facing reference for the refund
"tr_11842_11072"The original transaction that is being refunded - may be a payment or a capture
The status of the refund transaction
The gateway status of the refund transaction
The message from the gateway (if pending or declined)
False if the refund was instructed, or true if it was only recorded (in which case the onus is on the user to perform the refund via an offline method)
"USD"The currency of the refund (always the same as source transaction)
The ID of the person this refund is for
An array of parts objects for which charge(s) the refund was applied to
object
True if this is just a record to indicate a refund was performed offline
The date the record was last updated
The version of the record
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.