Modify Recurring Payments for an AMEX Card

Resource: _payment

This section describes how to use the _payment API to update an existing recurring payment for American Express (AMEX) cards.

📘

Note:

As per RBI guidelines while modifying the recurring payment, taking consent from the customer and doing an additional factor of authentication is mandatory. You must ensure this is done before using this API. You need to pass authPayuId and action fields to modify the billing details as part of JSON using this API as described in this section.

HTTP Method: POST

Request parameters

The following table describes the parameters for modifying the recurring payment details for an AMEX card.

Parameter Description
mihpayid It is a unique reference number created for each transaction at PayU's end which is used to identify a transaction in case of a refund.
mode This parameter describes the payment category by which the transaction was completed/attempted by the customer. The values are:
• Credit Card – CC
• Debit Card – DC
bankcode This parameter contains the code indicating the payment option used for the transaction. For AMEX, use AMEX.
status This parameter returns the status of the transaction and must be used to map the order status. Possible values are success, failure, or pending. The significance of the values for these values are:
Success: If the value of status parameter is 'success', the transaction is successful.
Failed: If the value of status parameter is 'failure' or 'pending', must only be treated as a failed transaction.
unmappedstatus This parameter holds the status of a transaction in PayU's internal database, which can include intermediate states. Possible values include: dropped, bounced, captured, auth, failed, usercancelled, or pending. For information on status description, refer to Payment State Explanations.
key This parameter contains the merchant key.
error For the failed transactions, this parameter provides the reason for failure.
error_message This parameter contains the error message. For the list of error message, refer to Error Codes.
bank_ref_num For each successful transaction – this parameter contains the bank reference number generated by the bank.
txnid This parameter contains the transaction ID value posted by the merchant during the transaction request.
amount This parameter contains the original amount which was sent in the transaction request by the merchant.
cardCategory This parameter contains the card category to indicate whether it is domestic or international.
discount This parameter contains the discount amount by the merchant.
net_amount_debit This parameter contains the net amount debited.
addedon The transaction date and time of the transaction.
productinfo This parameter contains the same value of product information which was sent in the transaction request from the merchant's end to PayU.
firstname This parameter contains the same value of first name which was sent in the transaction request from the merchant's end to PayU.
lastname This parameter contains the same value of last name which was sent in the transaction request from the merchant's end to PayU.
email This parameter contains the same value of email which was sent in the transaction request from the merchant's end to PayU.
phone This parameter contains the same value of phone which was sent in the transaction request from the merchant's end to PayU.
hash This parameter is crucial and is similar to the hash parameter used in the transaction request. For more information, refer to Generate Hash.
PG_TYPE This parameter gives information on the payment gateway used for the transaction.
udf1 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf2 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf3 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5 which was sent in the transaction request from the merchant's end to PayU.
udf4 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf5 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf6 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf7 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf8 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
udf9 This parameter contains the same value of udf1, udf2, udf3, udf4, or udf5, which was sent in the transaction request from the merchant's end to PayU.
success_at This parameter contains the date and timestamp when the transaction was successful.
cardnum The parameter contains the card number masked and only last 4 digits are returned.
issuing_bank The parameters contains the card issuing bank.
si_consent_action This parameter will be returned only if a modify subscription request has been received. In other cases, this field will not be returned.
Values can be
modify
cancel
If, in billing details, the action was to modify, then to validate whether the subscription was modified, this fields need to be validated in response. If this field is not sent in response of modify request, then even if transaction is success, then money would have got deducted but the subscription would not have been modified.

For network tokens

This is applicable for the following scenarios:

  • Merchant has the card token, TAVV(Cryptogram), and the last four digits of the card
  • The token could be created by the merchant or through another partner

📘

Note:

This scenario is applicable if you are PCI compliant and got the network token and TAVV from any other aggregator or schemes and then sent the card transaction request in the form of authentication.


Parameter

Description

Value

store_card_token mandatory for store card transactions

String This must include the Network token generated at your end.

1234 4567 2456 3566

storecard_token_type mandatory

integer This parameter is used to specify the store card token type. For this scenario, you must include 1.

1

additional_info mandatory

String This parameter will contain the additional information in the following JSON format: {"last4Digits": "1234", "tavv": "ABCDEFGH","trid":"1234567890", "tokenRefNo":"abcde123456"}

{"last4Digits": "1234", "tavv": "ABCDEFGH","trid":"1234567890", "tokenRefNo":"abcde123456"}

📘

Notes for additional_info parameter:

The JSON format contains the following fields:

  • trid (Token Requestor ID) is the identity given by the networks for creating the tokens. You should be able to get the same from your token provider.
  • tokenRefNo (Token Reference Number) is generated along with the network token. . You should be able to get the same from your token provider.
  • TAVV is a token authentication verification value given by schemes or interchange. Also, known as cryptogram.

Additional notes:

  • The last 4 digits of cards is mandatory for all transactions.
  • Some payment gateways require the Token Requester ID (trid) and Token Reference Number (tokenRefNo) to be passed for processing the transaction. Not passing these values will restrict the number of payment gateways available for processing the transaction.
  • Token Requester ID (trid) and Token Reference Number (tokenRefNo) are mandatory for Diners token transactions.

si_details Parameter – JSON Details

The description for the si_details parameter (JSON format):

📘

Notes:

  • One or more fields (marked optional) in the following table must be posted to modify the subscription:
    • billingCycle
    • billingInterval
    • billingAmount
  • If the request was to modify a subscription, si_consent_action parameter needs to be validated in the response. The field must return values modify based on the action sent in billing details JSON. Also, the payment source returned in such cases will be payu.

JSON Field

Description

Example

billingCycle optional

Billing Cycle defines whether the customer needs to be charged over Daily, Weekly basis, Monthly or Yearly basis or one time.

ONCE

billingInterval optional

Billing Interval is closely coupled with the billingCycle field and denotes at what frequency, the subscription plan needs to be executed. For monthly subscriptions, parameter values need to be sent in the request are:

  • billingCycle = MONTHLY
  • billingInterval = 1

Similarly, by keeping the following values, customer will be charged once in every 3 days:

  • billingCycle = DAILY
  • billingInterval = 3
  • billingCycle = MONTHLY
  • billingInterval = 1

billingAmount
optional

The billing amount is passed in XX. XX format.
In use cases where billingCycle = ADHOC, amount passed is treated as maximum amount since billing amount and billing cycle varies as per the usage of the subscription service. In this case, the merchant is free to charge any amount for customer up to the amount specified in the defined subscription call. For UPI, billingAmount should not be more than INR 15000 as it is the maximum limit allowed for UPI currently.

INR 2000

billingCurrency
optional

This field must be passed as "INR" .

INR

paymentEndDate
mandatory

The end date of the billing plan is specified in this field with the YYYY-MM-DD format.

Note: Pass the correct end date to PayU. Depending upon start date and end date, number of payment iterations are internally calculated and same information is passed to acquirers or banks.

2023-01-14

siTokenRequestor
mandatory for saved cards

This is optional and is only needed before 30th September, 2022 to activate new mandate setups in a controlled manner than activating it completely on all users. This involves creating token at the time of susbcription set. You can include any of the following values::

  • 1 : PayU will tokenise the card and share it in same subscription setup call with issuers for subscription setup.
  • 2: PayU will do the authorization on plain card. Later, the same response will be shared to merchant.

1

remarks
mandatory

This field is used to provide remarks on PSP applications during the registration transaction of UPI. For cards and Net Banking, this parameter has no significance. Character limit = 50.

Note: This field is applicable only for UPI.

Subscription for a year

authpayuid
mandatory for modifying subscription with cards

This field is used only to modify an existing subscription/consent. Modification means modifying billing details like startDate, endDate, billing cycle, billing interval, billing amount.

action
mandatory for cards

This field is used to modify an existing subscription. Include modify to modify a subscription.

modify

si_details JSON example

For a yearly plan starting from 1st January 2019, having a monthly billing amount of INR 100, the plan details:

{
  "billingAmount": "10.00",
  "billingCurrency": "INR",
  "billingCycle": "MONTHLY",
  "billingInterval": 1,
  "paymentStartDate": "2022-02-04",
  "paymentEndDate": "2022-12-12",
  "action": "modify",
  "authPayuId": "123"
}

Sample request

curl 'https://test.payu.in/_payment' \
 --data-raw 'key=JP***g&txnid=d5e7e5e6324a7860fbc6&amount=1&firstname=Payu-Admin&email=test%40example.com&phone=1234567890&productinfo=Product+Info&api_version=1&si=3&pg=CC&bankcode=AMEX&surl=https%3A%2F%2Fpp58admin.payu.in%2Ftest_response&furl=https%3A%2F%2Fpp58admin.payu.in%2Ftest_response&ccnum=&ccname=Test+User&ccexpmon=05&ccexpyr=2025&ccvv=123&si_details={"billingAmount":"10.00","billingCurrency": "INR","billingCycle": "MONTHLY","billingInterval": 1,
 "paymentStartDate": "2022-02-04","paymentEndDate": "2022-12-12","action": "modify","authPayuId": "123"}&hash=3b0eec9b39c5866af2d6b1346df434efe800ea3ad7ea1d59ce22bf935178434383aa3316a0151ea9a6248c5785996d19a25f9aa819b8097af612c9ac76d55689'

Sample response

Array
(
    [mihpayid] => 23500009465
    [mode] => CC
    [status] => success
    [unmappedstatus] => auth
    [key] => BmTY3G
    [txnid] => 8811cf2b9b1c03bda765
    [amount] => 1.00
    [cardCategory] => domestic
    [discount] => 0.00
    [net_amount_debit] => 1
    [addedon] => 2025-05-12 17:17:18
    [productinfo] => Product Info
    [firstname] => Payu-Admin
    [lastname] =>
    [address1] =>
    [address2] =>
    [city] =>
    [state] =>
    [country] =>
    [zipcode] =>
    [email] => [email protected]
    [phone] => 1234567890
    [udf1] =>
    [udf2] =>
    [udf3] =>
    [udf4] =>
    [udf5] =>
    [udf6] =>
    [udf7] =>
    [udf8] =>
    [udf9] =>
    [udf10] =>
    [hash] => fe86a209fba815567f5972f18592f5b92c4419a3b4ebe4c91a05ae8fba9bfb91e367836e7fee3335cb778c4fdde39201e3eb91b6162ff55d45e278fc48cff57b
    [field1] =>
    [field2] => 10VBS0CUP9FLYD
    [field3] =>
    [field4] => 23500009465auth
    [field5] =>
    [field6] =>
    [field7] => 3DS_CHALLENGE_POSITIVE
    [field8] =>
    [field9] => Authorization done using Billdesk-AmexSiHub
    [payment_source] => payu
    [meCode] => {"MID":"8366132637","Key":"2a9a271f513eb63778a4ffc31b52bf91"}
    [PG_TYPE] => CC-PG
    [bank_ref_num] => 000061868902422
    [bankcode] => AMEX
    [error] => E000
    [error_Message] => No Error
    [cardnum] => XXXXXXXXXXXX1005
    [cardhash] => This field is no longer supported in postback params.
)