API Reference

Create a purchase with a token

POST/purchases/ ​​​

Body Parameters

amountinteger (int32)

A positive integer representing how much to charge, in the smallest currency unit (eg., 100 to charge $1.00, or 100 to Charge ¥100, a zero decimal currency)

referencestring

Reference of the transaction. Max length 255 characters.

customer_ipstring

RFC791-compliant IP address

currencystring· Defaults to AUD

Three letter ISO currency code, in UPPERCASE

card_tokenstring

Card token

testboolean(optional)· Defaults to false

Indicates if this is a test transaction

metadataobject(optional)
addendum_datastring(optional)
billing_addressobject(optional)
billing_address.addressstring(optional)
billing_address.postcodestring(optional)
billing_address.emailstring(optional)
extraobject(optional)
extra.ecmstring(optional)· Defaults to 31

Specifies the transaction source and type for processing. This value is two digits, the first indicating the source (1 = Mail Order, 2 = Telephone Order, 3 = Internet) and the second indicating the payment type (1 = Single, 2 = Recurring, 3 = Instalment - not commonly supported)

extra.slistring(optional)

The Security Level Indicator for 3DS transactions (from the MPI)

extra.xidstring(optional)

The transaction ID (XID) value of a 3D Secure authenticated transaction (from the MPI)

extra.cavvstring(optional)

The transaction ID (XID) value of a 3D Secure authenticated transaction (from the MPI)

extra.parstring(optional)

The Payer Request result for a 3D Secure transaction (from the MPI)

extra.verstring(optional)

The Verification Request result for a 3D Secure transaction (from the MPI)

extra.threeds_versionstring(optional)

This presents the 3D Secure version used for this transaction. Examples are: '1.0.0', '2.0.0' etc. (from the MPI)

extra.directory_server_txn_idstring(optional)

This is the unique identifier for a 3D Secure version 2 transaction. (from the MPI)

extra.card_on_fileboolean(optional)· Defaults to false

Indicate if this is a card on file transaction or not. Merchant initiated transactions (eg. recurring or any transaction with auth_reason) will automatically be considered as card on file transaction.

extra.auth_reasonstring(optional)

Indicate what type of merchant initiated transaction it is. Valid values are: 'cardholder_initiated', 'resubmission', 'delayed_charges', 'reauthorization', 'no_show', 'account_topup', 'unscheduled'. For recurring and installment, please use extra.ecm instead. For incremental auth, please check 'Update an authorization'.

extra.stored_credential_indicatorstring(optional)

For card on file transaction, indicate if it is the initial transaction to put card on file (tokenize card), or the subsequent transactions to use card that is on file already. Possible values are, "I" for initial and "S" for subsequent.

extra.authorization_tracking_idstring(optional)

This is required for all subsequent recurring or instalment transactions. This value can be found from the response from the first recurring / instalment transaction. If not provided for wallet transactions, they will be rejected. Note that not all schemes (namely China UnionPay) return this value, in that case this value is not needed.

Request

curl
curl https://gateway.pmnts-sandbox.io/v1.0/purchases -u TEST:TEST -d' 
  { 
    "amount": 1000, 
    "reference": "oiuwiouwxmnx23", 
    "customer_ip": "111.222.111.123", 
    "currency": "USD", 
    "card_token": "syupxv5b1tqv4bqdsazr" 
  }'

Response

200Result
json
{
  "successful":true,
  "response":{
  "authorization":"468422",
  "id":"071-P-97AG1LA1",
  "card_number":"424242XXXXXX4242",
  "card_holder":"Client Name",
  "card_expiry":"2022-12-31",
  "card_token":"syupxv5b1tqv4bqdsazr",
  "card_type":"VISA",
  "card_category":"Credit",
  "card_subcategory":"Credit",
  "amount":1000,
  "decimal_amount":10.0,
  "successful":true,
  "message":"Approved",
  "reference":"oiuwiouwxmnx23",
  "currency":"USD",
  "transaction_id":"071-P-97AG1LA1",
  "settlement_date":"2018-11-22",
  "transaction_date":"2018-11-22T14:10:44+11:00",
  "response_code":"00",
  "captured":true,
  "captured_amount":1000,
  "rrn":"071P97AG1LA1",
  "cvv_match":"M",
  "metadata":{},
  "addendum_data":{}
  },
  "errors":[],
  "test":true
}