Repeat Payments

On this page:

Overview

A Repeat Payment enables you to process a first transaction and one or more additional transactions using the same customer and card details in your POST.

  • There is no restriction on the amount that you can charge.
  • Additional amounts do not need to match the first transaction.
  • Any authorised Opayo gateway transaction under two years of age can be used as the first in a series of Repeat Transactions.
  • We recommend you repeat only against the last successful authorised transaction.

Important: To use Repeat Transactions you must first apply for a Continuous Authority merchant number to be added to your account. Without it, you cannot repeat a transaction and you will receive the following response: 

{
  "description":"Transaction type not supported",
  "code":"1013"
}
Important: In order to use Repeat transactions, you must have supplied the Credential on File fields with the original transaction. If you don't supply these, you won't be able to repeat a payment.

Making a Repeat Payment

To perform a repeat transaction:

  1. Specify the transactionID of the first transaction you want to repeat in the referenceTransactionId field.
  2. Include the amount and currency for the Repeat Transaction.
Note: You can also update the shipping details for the transaction if they are different from the original transaction.
curl https://pi-test.sagepay.com/api/v1/transactions \ -H "Authorization: Basic ...cHVTRHNocktEU1dzQlkxT2lONmh3ZDlLYjEyejRqNVVzNXU="  \ -H "Content-type: application/json" \ -X POST  \ -d 
'{
  "transactionType":"Repeat",
  "referenceTransactionId":"CB567A8D-A3CF-6710-537E-C99088776D26",
  "vendorTxCode":"Repeatxx00001",
  "amount":2000,
  "currency":"GBP",
  "description":"Good product repeated",
  "shippingDetails":{
    "recipientFirstName":"Sam",
    "recipientLastName":"Jones",
    "shippingAddress1":"407 St John Street",
    "shippingAddress2":"",
    "shippingCity":"London",
    "shippingPostalCode":"EC1V 4AB",
    "shippingCountry":"GB"
 },
"credentialType": {
  "cofUsage": "Subsequent",
 "initiatedType": "MIT",
"mitType": "Unscheduled"}
}'

Example Response

A successful repeat transaction will receive a response similar to the following example:

{
  "statusCode":"0000",
  "statusDetail":"The Authorisation was Successful.",
  "transactionId":"215C9B22-08C6-DDD8-7151-E0140098EFE9",
  "transactionType":"Repeat",
  "retrievalReference":12257143,
  "bankAuthorisationCode":"999777",
  "paymentMethod":{
    "card":{
      "cardType":"Visa",
      "lastFourDigits":"0006",
      "expiryDate":"1120"
    }
  },
  "status":"Ok"
}