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 & Pay or Server-to-Server API. The Copy & Pay flow can be found in the article Copy + Pay Recurring Payment Flow.



Below you find the way to construct the initial POST request for a Server-to-Server flow:


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



Request: 


*Adding the parameter createRegistration=true in the request tokenizes the card.

*There are other COF parameters that will need to be included - read more on COF here


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

standingInstruction.source=CIT

standingInstruction.mode=INITIAL 

standingInstruction.type=UNSCHEDULED

shopperResultUrl=https://www.google.com



You will then need to handle the 3DS2 method data that gets sent back to you by the customer's Issuing Bank's ACS system - see the documentation link listed about for more information on how to do this.



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 Payments with the registration token generated:


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


Recurring API: