With the peach payments restful API, a developer can tokenize cards and use the stored token for subscription or one-click payments.


This can be done using our copy and pay or server to server API.


Documentation here: https://peachpayments.docs.oppwa.com/ 


1) Using Server to Server:


Request: Adding the parameter createRegistration=true in the request tokenizes the card.


entityId=8a8294174e735d0c014e78cf26461790

amount=92.00

currency=ZAR

paymentBrand=MASTER

paymentType=DB

card.number=5454545454545454

card.holder=Jane Jones

card.expiryMonth=05

card.expiryYear=2020

card.cvv=123

createRegistration=true

shopperResultUrl=https://www.google.com


Response: The registration id in the final GET status response is the token.


{
  "id":"8ac7a4a2708062d70170856fe76e4e29",
  "registrationId":"8ac7a4a17085444d0170856fe61d33cf",
  "paymentType":"DB",
  "paymentBrand":"MASTER",
  "amount":"92.00",
  "currency":"ZAR",
  "descriptor":"5924.8723.1747 OPP_Channel ",
  "result":{
    "code":"000.100.110",
    "description":"Request successfully processed in 'Merchant in Integrator Test Mode'"
  },
  "card":{
    "bin":"545454",
    "last4Digits":"5454",
    "holder":"Jane Jones",
    "expiryMonth":"05",
    "expiryYear":"2020"
  },
  "customParameters":{
    "OPP_card.bin":"545454"
  },
  "risk":{
    "score":"100"
  },
  "buildNumber":"88f50db9d2065c23a84dea4c9e6a6a81dc205921@2020-02-25 17:06:59 +0000",
  "timestamp":"2020-02-27 06:57:48+0000",
  "ndc":"8a8294174e735d0c014e78cf26461790_a40178a5c32f4d3086bb73cd26d9e7f8"
}


Making Recurring Payment with Token:


Here is our recurring payment documentation: https://peachpayments.docs.oppwa.com/tutorials/manage-payments/recurring 


Recurring API: 



Here is how the stored token can be used with Copy and Pay: https://peachpayments.docs.oppwa.com/tutorials/integration-guide/one-click