Retrieve Agreement

Request to retrieve the details stored in the gateway of an agreement between the merchant and a cardholder.

URL https://credimax.gateway.mastercard.com/api/rest/version/79/merchant/{merchantId}/agreement/{agreementId}
HTTP Method GET
Authentication This operation requires authentication via one of the following methods:
  • Certificate authentication.
  • Basic HTTP authentication as described at w3.org. Provide 'merchant.<your gateway merchant ID>' in the userid portion and your API password in the password portion.

Request Parameters

correlationId  String = OPTIONAL

The value provided is not validated, does not persist in the gateway, and is returned as provided in the response to the request.
Existence
OPTIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

{merchantId}  Alphanumeric + additional characters COMPULSORY

Existence
COMPULSORY
Validation Rules
Data may consist of the characters 0-9, a-z, A-Z, '-', '_'
XSD type
string
minimum length
1
maximum length
40

{agreementId}  String COMPULSORY

Existence
COMPULSORY
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

Response Parameters

agreement.status  Enumeration = Always Provided

The gateway obtains/refreshes the status of the agreement when.

You submit a request to the gateway to authorize or cancel an agreement (the gateway passes this information to the regulator/third-party provider)
OR

Your acquirer updates the gateway when the payer has directly cancelled the agreement with their issuing bank.
For all other integrations, the value will be set to UNKNOWN_IN_VERSION.
Existence
Always Provided
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
ACTIVE
The agreement has been registered and is active.
CANCELLED
The agreement is no longer active. It has been cancelled by either you or the payer.
UNKNOWN_IN_VERSION
The status of the agreement is UNKNOWN_IN_VERSION.

result  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
FAILURE
The operation was declined or rejected by the gateway, acquirer or issuer
PENDING
The operation is currently in progress or pending processing
SUCCESS
The operation was successfully processed
UNKNOWN
The result of the operation is unknown

agreement   = CONDITIONAL

For example, an agreement to a series of recurring payments (a mobile phone subscription), an agreement to take payment for a purchase by a series of installments (hire purchase), an agreement to make additional payments when required (account top up), or to fulfil a standard industry practice (no show penalty charge).

Do not provide this parameter group if you are storing the payment details for subsequent payer-initiated payments only.

See Credential on File, Cardholder, and Merchant Initiated Transactions for details.
Fixed value

agreement.amountVariability  Enumeration = CONDITIONAL

The field must be provided for recurring payment agreements.
Existence
CONDITIONAL
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
FIXED
All payments in the recurring payment agreement have the same amount. Examples include magazine subscriptions or gym memberships.
VARIABLE
The amount for the payments within the recurring payment agreement differs between payments. Examples include usage-based charges like utility or phone bills.

agreement.customData  String = CONDITIONAL

This field must not contain sensitive data.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters, but sensitive data will be rejected
JSON type
String
minimum length
1
maximum length
2048

agreement.expiryDate  Date = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data must comply with ISO 8601 extended date format, yyyy-mm-dd
JSON type
String

agreement.id  String = CONDITIONAL

When you collect cards from your payers and store them for later use, you must provide an agreement ID when you use the stored values for:

  • Recurring payments: you have an agreement with the payer that authorizes you to automatically debit their account at agreed intervals for fixed or variable amounts. For example, gym membership, phone bills, or magazine subscriptions.
  • Installment payments: you have an agreement with the payer that authorizes you to process multiple payments over an agreed period of time for a single purchase. For example, the payer purchases an item for $1000 and pays for it in four monthly installments.
  • Unscheduled: you have an agreement with the payer that authorizes you to process future payments when required. For example, the payer authorizes you to process an account top-up transaction for a transit card when the account balance drops below a certain threshold.
  • Industry Practice: you have an agreement with the payer that authorizes you to initiate additional transactions to fulfil a standard business practice related to an original payment initiated by the payer. For example, a delayed charge for use of the hotel mini bar after the payer has checked out or a no show penalty charge when the payer fails to show for a booking.
When you first establish an agreement with the payer you should also specify the type of agreement in agreement.type.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
100

agreement.maximumAmountPerPayment  Decimal = CONDITIONAL

The amount must be provided in the currency of the order.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data is a decimal number.
JSON type
Number
maximum value
99999999999999
minimum value
0
maximum post-decimal digits
3

agreement.minimumAmountPerPayment  Decimal = CONDITIONAL

The amount must be provided in the currency of the order.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data is a decimal number.
JSON type
Number
maximum value
99999999999999
minimum value
0
maximum post-decimal digits
3

agreement.minimumDaysBetweenPayments  Integer = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
JSON number data type, restricted to being positive or zero. In addition, the represented number may have no fractional part.
JSON type
Number
minimum value
1
maximum value
9999

agreement.numberOfPayments  Integer = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
JSON number data type, restricted to being positive or zero. In addition, the represented number may have no fractional part.
JSON type
Number
minimum value
1
maximum value
999

agreement.paymentFrequency  Enumeration = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
AD_HOC
The agreement if for payments on an ah-hoc basis.
DAILY
The agreement if for a daily payment.
FORTNIGHTLY
The agreement if for a fortnightly payment.
MONTHLY
The agreement if for a monthly payment.
OTHER
The agreement is for payments according to a schedule other than the ones listed in the other enumeration values for this field.
QUARTERLY
The agreement if for a quarterly payment.
TWICE_YEARLY
The agreement if for a payment twice a year.
WEEKLY
The agreement if for a weekly payment.
YEARLY
The agreement if for a yearly payment.

agreement.retailer   = CONDITIONAL

For an installment agreement where the payer purchased goods and/or services from a retailer but entered an installment agreement to pay for this purchase with you, you must provide details about the retailer.
Fixed value

agreement.retailer.abbreviatedTradingName  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
10

agreement.retailer.merchantCategoryCode  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
4

agreement.retailer.tradingName  String = CONDITIONAL

Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
100

agreement.startDate  Date = CONDITIONAL

Cannot be in the past.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data must comply with ISO 8601 extended date format, yyyy-mm-dd
JSON type
String

agreement.type  Enumeration = CONDITIONAL

Specify the agreement type when you have provided a value for agreement.id and this payment is the first in a series of payments. The default value is OTHER.

The gateway will use the value you specify for subsequent payments in the series.
Existence
CONDITIONAL
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
INSTALLMENT
An agreement where the payer authorizes the payment for a single purchase to be split into a number of payments processed at agreed intervals. For example, pay for a purchase in six monthly installments.
OTHER
An agreement where you want to link related payments for any purpose other than processing recurring, installment, or unscheduled payments. For example, split tender payments.
RECURRING
An agreement where the payer authorizes you to process repeat payments for bills or invoices at agreed intervals (for example, weekly, monthly). The amount might be fixed or variable.
UNSCHEDULED
An agreement where the payer authorizes you to automatically deduct funds for a payment for an agreed purchase when required (unscheduled). For example, auto top-ups when the account value falls below a threshold.

agreement.status  Enumeration = Always Provided

The gateway obtains/refreshes the status of the agreement when.

You submit a request to the gateway to authorize or cancel an agreement (the gateway passes this information to the regulator/third-party provider)
OR

Your acquirer updates the gateway when the payer has directly cancelled the agreement with their issuing bank.
For all other integrations, the value will be set to UNKNOWN_IN_VERSION.
Existence
Always Provided
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
ACTIVE
The agreement has been registered and is active.
CANCELLED
The agreement is no longer active. It has been cancelled by either you or the payer.
UNKNOWN_IN_VERSION
The status of the agreement is UNKNOWN_IN_VERSION.

correlationId  String = CONDITIONAL

The value provided is not validated, does not persist in the gateway, and is returned as provided in the response to the request.
Existence
CONDITIONAL
Fixed value
Validation Rules
Data can consist of any characters
XSD type
string
minimum length
1
maximum length
100

result  Enumeration = Always Provided

Existence
Always Provided
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
FAILURE
The operation was declined or rejected by the gateway, acquirer or issuer
PENDING
The operation is currently in progress or pending processing
SUCCESS
The operation was successfully processed
UNKNOWN
The result of the operation is unknown

error   = CONDITIONAL

Information on possible error conditions that may occur while processing an operation using the API.
Fixed value

error.cause  Enumeration = CONDITIONAL

For example, errors may occur due to invalid requests or internal system failures.
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
INVALID_REQUEST
The request was rejected because it did not conform to the API protocol.
REQUEST_REJECTED
The request was rejected due to security reasons such as firewall rules, expired certificate, etc.
SERVER_BUSY
The server did not have enough resources to process the request at the moment.
SERVER_FAILED
There was an internal system failure.

error.explanation  String = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST or SERVER_BUSY.
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
1000

error.field  String = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST and a field level validation error was encountered.
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
100

error.supportCode  String = CONDITIONAL

This field is returned only if the cause is SERVER_FAILED or REQUEST_REJECTED.
Fixed value
Validation Rules
Data can consist of any characters
JSON type
String
minimum length
1
maximum length
100

error.validationType  Enumeration = CONDITIONAL

This field is returned only if the cause is INVALID_REQUEST and a field level validation error was encountered.
Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
INVALID
The request contained a field with a value that did not pass validation.
MISSING
The request was missing a mandatory field.
UNSUPPORTED
The request contained a field that is unsupported.

result  Enumeration = CONDITIONAL

Fixed value
Validation Rules
JSON type
String
Value must be a member of the following list. The values are case sensitive.
ERROR
The operation resulted in an error and hence cannot be processed.

Copyright © 2023 Mastercard