Skip to content

Simulate card merchant refund using card id

Request

Simulate card merchant refunds by Card ID. Provide card id and transaction amount and the transaction will be processed through the system.

Security
API_Secret_Key
Path
card_idinteger, (int64)required
Headers
call-refstring

A call reference generated by the caller and unique to the caller to provide correlation between the caller and system with a maximum length of 255

Bodyapplication/jsonrequired
merchantNamestring, [ 1 .. 50 ] charactersrequired

The merchant name

merchantIdstring, [ 1 .. 15 ] characters

The merchant id (MID). If not specified, a random value will be used

merchantCategoryCodestring, [ 1 .. 4 ] characters

The merchant category code (MCC). If unspecified or an invalid MCC is specified, the Merchant Code 5399 (Misc. General Merchandise) will be used instead

transactionAmountobject(CurrencyAmount)required

A message representing a monetary amount in a particular currency.

transactionCountrystring, = 3 characters^[A-Z]*$

The transaction country in ISO 3166 - alpha-3 format

atmWithdrawalboolean

If set to true, this purchase simulates and ATM Withdrawal transaction. MCC will automatically be set to 6011

additionalMerchantDataobject(AdditionalMerchantData)

Additional merchant data

cardHolderPresentstring(CardHolderPresent)

Optional detail indicating if the card holder was present when the authorisation occurred.

Enum:"PRESENT""NOT_PRESENT""PRESENCE_UNKNOWN"
cardPresentboolean

Optional detail indicating if the card was present when the authorisation occurred.

initiateBiometricThreeDSecureboolean

If the card is enrolled for Biometric Authentication, a 3DS Flow is initiated before the Purchase can resume.

transactionTimestampinteger, (int64)

Epoch timestamp using millisecond precision.

forexFeeinteger, (int64)deprecated

If this is a cross-currency transaction, the forex fee amount in the card currency. Deprecated; the forex fee percentage configured at the card profile will be applied if this field is not provided

forexPaddinginteger, (int64)deprecated

If this is a cross-currency transaction, the forex padding amount in the card currency. Deprecated; a 2% forex padding will be applied if this field is not provided

curl -i -X POST \
  'https://sandbox.weavr.io/simulate/api/cards/{card_id}/merchant_refund' \
  -H 'Content-Type: application/json' \
  -H 'call-ref: string' \
  -H 'programme-key: YOUR_API_KEY_HERE' \
  -d '{
    "merchantName": "string",
    "merchantId": "string",
    "merchantCategoryCode": "stri",
    "transactionAmount": {
      "currency": "str",
      "amount": 0
    },
    "transactionCountry": "str",
    "forexFee": 0,
    "forexPadding": 0,
    "atmWithdrawal": true,
    "additionalMerchantData": {
      "merchantStreet": "string",
      "merchantCity": "string",
      "merchantState": "string",
      "merchantPostalCode": "string",
      "merchantCountry": "str",
      "merchantTelephone": "string",
      "merchantURL": "string",
      "merchantNameOther": "string",
      "merchantNetworkId": "string",
      "merchantContact": "string"
    },
    "cardHolderPresent": "PRESENT",
    "cardPresent": true,
    "initiateBiometricThreeDSecure": true,
    "transactionTimestamp": 0
  }'

Responses

Success

Bodyapplication/json
codestring(PurchaseResponsePurchaseResponseCode)
Enum:"APPROVED""DENIED_NOT_ENOUGH_FUNDS""DENIED_CARD_NOT_FOUND""DENIED_INCORRECT_CVV""DENIED_CARD_EXPIRY""DENIED_AMOUNT_NOT_POSITIVE""DENIED_CARD_INACTIVE""DENIED_OTHER""DENIED_SPEND_CONTROL""PENDING_BIOMETRIC_THREEDS_VERIFICATION"
threeDSecureChallengeIdobject(NullableInt64)
Response
{ "code": "APPROVED", "threeDSecureChallengeId": { "value": 0, "hasValue": true } }