Token Payments

Charge returning customers without re-requesting their billing details! Token Payments allows you to save the details of your customers securely on eWAY’s servers and bill them whenever they make new purchases. Capturing and updating a customer’s details can be done through any of eWAY’s payment APIs, making integration simpler once you are taking payments.

CREATE A TOKEN

To create a Token Customer, set the “Method” to “CreateTokenCustomer” and the “TotalAmount” to 0.

Simple Direct Connection JSON REST Create Token Example

Endpoint: https://api.sandbox.ewaypayments.com/Transaction
Headers:
Authorization: Basic (see Authentication in the API reference)
Content-Type: application/json

1
{ "Customer": { "Title": "Mr.", "FirstName": "John", "LastName": "Smith", "Country": "au", "CardDetails": { "Name": "John Smith", "Number": "4444333322221111", "ExpiryMonth": "12", "ExpiryYear": "25", "CVN": "123" } }, "Payment": { "TotalAmount": 0 }, "Method": "CreateTokenCustomer", "TransactionType": "Purchase" }

CHARGE A TOKEN

To charge a customer, simply use their TokenCustomerID when submitting the request and set the “Method” to “TokenPayment”. Note that if the customer is completing the transaction, a CVN is still required.

Simple Direct Connection JSON REST Charge Token Example

Endpoint: https://api.sandbox.ewaypayments.com/Transaction

1
2
3
4
5
6
7
8
9
10
{
"Customer": {
   "TokenCustomerID": 917758625852
},
"Payment": {
   "TotalAmount": 1000
},
"Method": "ProcessPayment",
"TransactionType": "Recurring"
}

UPDATE A TOKEN

To update a token customer, just provide the updated details in the request, and set the “Method” to “UpdateTokenCustomer”.

Simple Direct Connection JSON REST Update Token Example

Endpoint: https://api.sandbox.ewaypayments.com/Transaction

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"Customer": {
   "TokenCustomerID": 917758625852,
   "Title": "Ms.",
   "FirstName": "Jane",
   "LastName": "Smith",
   "Country": "au",
   "CardDetails": {
     "Name": "Jane Smith",
     "Number": "4444333322221111",
     "ExpiryMonth": "12",
     "ExpiryYear": "25",
     "CVN": "123"
   }
},
"Payment": {
   "TotalAmount": 0
},
"Method": "UpdateTokenCustomer",
"TransactionType": "Purchase"
}

QUERY A TOKEN

To get the details stored for a Token Customer, simple make a request with the Token Customer ID

Simple Query Token Example

Endpoint: https://api.sandbox.ewaypayments.com/Customer/987654321

For more details, check out the Rapid 3.1 API Token documentation

Become an eWAY merchant today.

With 24/7 support, over 250 integrations and 20+ years experience – the team at eWAY are here to provide you with the leading all-in-one payments solution.