Create an authorization
/purchases/ Limited Acquirer Support
Functionality such as marking an authorization as Final or Partial are currently only supported by a handful of Australian acquirers, including Westpac and FDMS (First Data Merchant Services (also known as Fiserv)). If these methods are used where support is not yet available the transactions may be declined or return errors.
Body Parameters
amountinteger (int32)Amount of the purchase in cent. Required on create
referencestringReference of the transaction, required on create. Max length 255 characters.
customer_ipstringRFC791-compliant IP address
currencystring· Defaults to AUDThree letter ISO currency code, in UPPERCASE
card_numberstring(optional)Required on create, unless you provide a card_token or a wallet object
card_holderstring(optional)Name of the card holder
card_expirystring(optional)Format: MM/YYYY Required on create, unless you provide a card_token or a wallet object
card_tokenstring(optional)Required on create, unless you provide a card_number or a wallet object
cvvstring(optional)CVV card number. (3/4 characters)
testboolean(optional)· Defaults to falseIndicates if this is a test transaction
walletobject(optional)wallet.typestringName of the wallet ('ApplePay', 'GooglePay')
wallet.encPaymentDatastring(optional)required for type: VISA
wallet.encKeystring(optional)required for type: VISA
wallet.callidstring(optional)required for type: VISA
wallet.tokenstring(optional)required for type: APPLE, GOOGLE
wallet.user_idstring(optional)required for type: MASTERPASSEXPRESS
wallet.origin_urlstring(optional)required for type: MASTERPASSEXPRESS
wallet.card_idstring(optional)required for type: MASTERPASSEXPRESS
wallet.address_idstring(optional)required for type: MASTERPASSEXPRESS
wallet.checkout_resource_urlstring(optional)required for type: MASTERPASS
wallet.oauth_tokenstring(optional)required for type: MASTERPASS
wallet.oauth_verifierstring(optional)required for type: MASTERPASS
wallet.checkout_idstring(optional)required for type: ZIP_MONEY
wallet.account_idstring(optional)required for type: ZIP_MONEY
metadataobject(optional)addendum_datastring(optional)captureboolean· Defaults to trueIndicates if this purchase should be captured (true), or authorized only (false)
finalboolean(optional)· Defaults to falseIndicates if the amount presented for the authorization is the final amount, or may be topped up or cancelled. Note: final authorizations cannot be cancelled, they will either be captured like a normal authorization, or will need to expire naturally.
Request
curl https://gateway.pmnts-sandbox.io/v1.0/purchases -u TEST:TEST -d'
{
"card_holder": "Jim Smith",
"card_number": "5123456789012346",
"card_expiry": "05/2023",
"cvv": "987",
"amount": 1000,
"reference": "ORD98976",
"customer_ip": "111.222.111.123",
"currency": "USD",
"capture": false,
"final": false
}'Response
{
"successful": false,
"response": {
"authorization": null,
"id": "071-P-QE2I2PCW",
"card_number": "512345XXXXXX2346",
"card_holder": "Jim Smith",
"card_expiry": "2030-02-28",
"card_token": "fke86c5u",
"card_type": "MasterCard",
"card_category": "Credit",
"card_subcategory": "Standard",
"amount": 1000,
"decimal_amount": 10.0,
"successful": false,
"message": null,
"reference": "da5d16122b831b468090a7adaf68758e",
"currency": "XXX",
"transaction_id": "071-P-QE2I2PCW",
"settlement_date": null,
"transaction_date": null,
"response_code": "99",
"captured": false,
"captured_amount": null,
"rrn": null,
"cvv_match": "U",
"metadata": {},
"addendum_data": null
},
"errors": ["Currency XXX is not valid for this merchant. Permitted currencies: USD,AUD,NZD,GBP"]
}