Webhooks
Card payments
6min
p2c uses webhooks to update you on the status of your cards and to report transaction changes webhooks report to your system with real time notifications when an event happens in p2c, a single registration registers the callback url for all webhook events every time an event occurs, p2c reports the webhook data to your endpoint in json format this eliminates the need to poll the api to discover changes the full event details are included and sent to your system typically, p2c aggregates event objects every 30 120 seconds register for webhook event reports use post /api/webhookregistrations to register to poll for event status webhook reports call description cardauthorized reports when a card authorization attempt is completed and the status of the card when a card was signed up via an iframe cardstatuschanged reports if a card changed status to active or inactive transactionstatuschanged reports the changed status of a transaction transactioncompleted reports the completion of a transaction request this webhook is sent only 1 time if a transaction has changed after the initial execution, the transactionstatuschanged webhook will be sent webhook responses cardauthorized sample response { "eventid" "53e0d945 4f04 477c 901c 010ee5df73c3", "eventname" "cardauthorized", "data" { "requestid" "101f1ed0 501b 4e69 a081 36a06064bcac", "cardtoken" "w5axtosk4auovrz4f9m1g9x5jgzuf4sumtqbtc", "authorized"\ true, "responsereceived"\ true, "responsecode" "ok", "responsedescription" "ok", "error"\ null, "addressverified"\ true, "rail" 1, "customerreferencenumber" "1" } } transactioncompleted sample response { "eventid" "35ad28ca b10c 4ce9 8427 0177c9e33759", "eventname" "transactioncompleted", "data" { "transactionid" "7cj39sa3dc fa3b 4462 5hc9 fjl532aslgf0", "amount" 333 0, "transactionrequestedat" "2022 03 11t10 37 59 4", "transactionstatus" 2, "errordescription" "{\r\n \\"pushcardid\\" \\"7cj39sa3dc fa3b 4462 5hc9 fjl532aslgf0\\",\r\n \\"paymentsent\\" false,\r\n \\"responsereceived\\" false,\r\n \\"responsecode\\" null,\r\n \\"responsedescription\\" null,\r\n \\"network\\" null,\r\n \\"transactiondate\\" null,\r\n \\"error\\" \\"card token not found\\",\r\n \\"tracenumber\\" null\r\n}", "creditcardid" "\<card token>", "rail"\ null } } cardstatuschanged sample response { "eventid" "ce1dbd4f 6830 4c20 ab64 000a946a2cfc", "eventname" "cardstatuschanged", "data" { "statuschangedat" "2022 02 04t15 32 28 7632522z", "creditcardid" "\<card token>", "oldstatus" "active", "newstatus" "inactive" } } transactionstatuschanged sample response { "eventid" "dc51a5f9 581b 4de9 b5fb 050994f02716", "eventname" "transactionstatuschanged", "data" { "transactionid" "7fi8756bsf53b fhl5 65sd ghcw555d7100", "amount" 300, "transactionrequestedat" "2022 17t06 34 26 95", "oldtransactionstatus" "succeeded", "newtransactionstatus" "pending", "statuschangedat" "2022 01 09t13 13 35 4068128z", "creditcardid" "\<card token>", "rail" "mcsend" } }