Tutorials

Originate a pull transaction

8min
how to originate an account funding transaction (aft) in this tutorial, you'll learn how to ✅ register the relevant webhooks ✅ sign up a card ✅ start a pull transaction this tutorial assumes you have a knowledge of apis and how they work refer to the api basics docid\ hjr4y6ml96zuyj6trytom for more details an account funding transaction (aft) lets you pull funds from a debit card for specific purposes you can use an aft to fund a wallet or a prepaid card or, you can use it to initiate a person to person (p2p) transfer through the card network rails afts are not allowed for buying goods and services the tutorial uses these api endpoints api description card management docid\ m1 fwo7rozkip1glx3cdo signs up a card transaction management docid\ wboa2sa1cfmr2woynicv8 starts a pull payment the tutorial uses these webhooks webhook description cardauthorized reports when a card authorization attempt is completed shows you the status of the card transaction reports a transaction before you begin make sure you have api credentials successfully register for webhook events docid\ tb06o1ygmh0xc xxwqy4m to receive webhook event notifications card management docid\ m1 fwo7rozkip1glx3cdo you are pushing funds to requestid your unique reference id cardtoken the token you received when you signed up the card the dollar amount to send register the relevant webhook events use this endpoint, post /api/webhookregistrations , to sign up to receive the webhooks available for p2c these webhooks report relevant events back to your system in real time this keeps you up to date on each transaction sign up a card to start a transaction you must first register a card we use different endpoints to be able to secure your customer's debit card numbers to register a card, send cross river the card number the card number is instantly converted into a token cross river doesn't save any card number information doing this asynchronously allows cross river to store your customer's card information this ensures that you don't need to retrieve the card information again it also keeps your customer's data secure call card management docid\ m1 fwo7rozkip1glx3cdo when a card is registered, cross river validates the card with the relevant card network this makes sure the card is a valid card and that it is allowed to receive payments the cardauthorized webhook is triggered sample request post /api/card { "requestid" "49af65c0 f815 4f49 ba8d b67bf1b125f4", "firstname" "joseph", "lastname" "roll", "ownerexternalid" "4444", "address1" "123 main street", "city" "venice", "state" "ca", "zipcode" "10989", "countrycode" "us", "phonenumber" "5555559275", "email" "{youremail}", "creditcardnumber" "full card number", "expirationmonth" "06", "expirationyear" "20", "ccv" "420" } start a pull transaction when you start a transfer, you are requesting funds (as the recipient) from a payor authenticate into the cross river system this returns a token to you use the token to call post /api/pulltransaction cross river sends this request to the card networks the networks route the transaction to the appropriate bank the issuing bank (of the registered debit card) receives the transaction the issuing bank either authorizes or declines the transaction if the transaction is authorized, cross river responds to your api call as shown below sample request post /api/pulltransaction curl x post header 'content type application/json' \ header 'accept application/json' \ header 'authorization bearer 12aab60c01ed32a0c18d44111a753bf3ce180bc716fec06d30fc4447c2eae6b3' d '{ \ "requestid" "89gva07c fj8x 42nv5 9a00c9 6ms5aq3d7100", "cardtoken" "kr7d47mnjil2r39oznrvpc0dis82es8je6j7vu", "amount" 400 } sample response post /api/pulltransaction { "version" "1 0 0 0", "result" { "transactionrequestid" "7ce5a0dc 253b 4ab5 9cc9 6e9be63d7100", "amount" 400, "transactionrequestedat" "2022 08 03t21 09 13 5882004z", "transactionstatus" "succeeded", "errordescription" null, "creditcardid" "kr7d47mnjil2r39oznrvpc0dis82es8je6j7vu", "railid" "tabapay", "network" "mastercard", "retrievalreferenceid" "8abcb1fa 51f1 4b2d 9998 5948877bdcc0", "actualtransactiondoneat" "2022 08 03t21 09 13 937108z", "requestapproved" true, "responsereceived" true, "responsecode" "00", "responsedescription" "approved", "tracenumber" "xxx", "error" null, "requestername" null, "requestermcc" null }, "issuccessfull" true, "issuccessful" true }