How to add and save card Server-to-server


If your workflow is :

1. Customer adds card
2. Your systems store card token 
3. When amount is due, stored card is billed

Then please see sample code below - please refer to our technical documentation for conclusive instructions:


1.  Customer adds card

curl \
 -d "authentication.userId=XXXXXXX" \
 -d "authentication.password=XXXXXX" \
 -d "authentication.entityId=XXXXXXXXX" \
 -d "amount=1.00" \
 -d "currency=ZAR" \
 -d "paymentBrand=VISA" \
 -d "paymentType=PA" \
 -d "card.number=4200000000000000" \
 -d "createRegistration=true\
 -d "card.holder=Jane Jones" \
 -d "card.expiryMonth=05" \
 -d "card.expiryYear=2018" \
 -d "card.cvv=123" \

 -d "recurringType=INITIAL" \

 -d "shopperResultUrl="

This will validate the card and once validated, store the card details and return a payload.


This R1.00 PA is done to check that the card being added is valid, before you store the card for future billing.

This R1.00 amount should return to the customer's account after a period ; i.e, their balance will increase by R1.00 when the PA falls away (period differs from bank to bank).

If this R1.00 PA is not done, first of all the card storage transaction cannot be 3DSecure authenticated and secondly, you may store cards that later cannot be billed at a later stage. This does not ensure that you can charge the full amount (since most likely the basket value would be greater than R1.00), but it at least checks with the bank that the card is valid.


2. Your systems store card token


The payload (response from our systems) will include a registrationID, which you can save as the token of the card. You can then make payments on this stored card by referencing its token. Please only store the token in your database if the PA transaction is successful


3. When amount is due, stored card is billed

curl{id}/payments \
 -d "authentication.userId=XXXXXXXXX" \
 -d "authentication.password=XXXXXXXx" \
 -d "authentication.entityId=XXXXXXX" \
 -d "amount=92.00" \
 -d "currency=ZAR" \
 -d "paymentType=DB"
 -d "recurringType=REPEATED"

Please note that the entity ID here should be the recurring entityID -d "authentication.entityId=XXXXXXXX" \

Please see how to handle the 3DSecure redirect here

Also, please find recommended parameters to include at this link :

Have more questions? Submit a request


Powered by Zendesk