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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"Customer": {
   "CardDetails": {
    "Name": "Card Holder Name",
    "Number": "4444333322221111",
    "ExpiryMonth": "12",
    "ExpiryYear": "16",
    "CVN": "123"
   }
},
"Payment": {
   "TotalAmount": 0
},
"Method": "CreateTokenCustomer"
}

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": "987654321"
},
"Payment": {
   "TotalAmount": 100
},
"TransactionType": "MOTO",
"Method": "TokenPayment"
}

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
{
"Customer": {
   "CardDetails": {
    "Name": "New Card Holder Name",
    "Number": "5454545454545454",
    "ExpiryMonth": "12",
    "ExpiryYear": "19",
    "CVN": "321"
   }
},
"Payment": {
   "TotalAmount": 0
},
"Method": "UpdateTokenCustomer"
}

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.