Update a transaction card expiry date

Update the card expiry date associated with an existing card-based transaction via API.


Introduction

For each transaction that has a recorded card expiry date, including reference-based transactions such as captures, refunds, and chargebacks, you can update that date using the Transaction Card Expiry Date Update API.

This endpoint is useful for Recurring payments when a customer’s card has been renewed, and the same card account now has a new expiry date. Updating the expiry date helps you keep the stored transaction details current for future recurring payment activity.

A request to this endpoint updates the expiry date stored for an existing transaction. It does not process a new payment.


Prerequisites

Use this endpoint when:

  • The customer’s card has been renewed;
  • The card expiry date has changed;
  • You need to update the expiry date stored against an existing card transaction;
  • You use recurring payments and need to keep the transaction expiry details up to date.

Update an expiry date

Endpoint

PUT /v1/transaction/expiry_date/:transaction_unique_id

Replace :transaction_unique_id with the unique ID of the transaction you want to update.

Request parameters

You must use the following request parameters:

Parameter Required Format Description
expiration_month Required MM Expiry month as printed on the card.
expiration_year Required YYYY Expiry year as printed on the card.

Request example

The following is an example request:

curl https://gate.emerchantpay.net/v1/transaction/expiry_date/:transaction_unique_id \
  -X PUT \
  -H “Content-Type: text/xml” \
  -d ‘<?xml version=”1.0″ encoding=”UTF-8″?>
  <update_card_expiration_request>
   <expiration_month>12</expiration_month>
   <expiration_year>2027</expiration_year>
  </update_card_expiration_request>’

Handle the response

Response parameters

The following are the successful response parameters:

Parameter Type Description
status string Status of the response.
code integer Successful response code.
message string Result message.

Response example

The following is a successful response example:

<update_card_expiration_response>
  <status>success</status>
  <code>200</code>
  <message>Card expiry date updated successfully!</message>
</update_card_expiration_response>

Error response parameters

The following are the error response parameters:

Parameter Type Description
status string Status of the response.
code integer Error code. See the Error Code Table for details.
technical_message string Technical error message intended for troubleshooting. Do not display this message to customers.
message string Human-readable message that you can display to customers.

Error response example

The following is an example of an error response:

<update_card_expiration_response>
  <status>error</status>
  <code>300</code>
  <technical_message>The provided expiration date must be in the future and after the current one.</technical_message>
  <message>Please check input data for errors!</message>
</update_card_expiration_response>