Integration Guide
This guide provides instructions for developing an integration to Push Cash.
Examples in this guide call the sandbox API hosted at https://sandbox.pushcash.com
and do not trigger real money-movement.
Overview
An integration to Push Cash entails changes to both your frontend and backend systems. At a high level, the steps are:
interaction sequence diagram
Before you begin
Before starting your integration, please note the following requirement: Users must first deposit funds before they are allowed to withdraw using Push. Please hide or disable the Push button for withdrawals until the user deposits funds.
Steps to integrate
Install the button
First, add an entry point to the payment flow. The quickest way is to use the PushJS package to render a button on your cashier page.
Start by adding a script tag to load the package on your website.
Then, implement a function rendering the button onto the page. Provide a selector identifying where to render the button and optional styling parameters to control its appearance
You should now see the Push Cash button rendered on your cashier page.
For more on how to style and configure the button, see the button reference guide.
Call the API
Update your backend to call the Push Cash API, using the API key created during the quickstart to authenticate API requests. Store the key securely, for example as an encrypted secret in your cloud environment.
Register user
Each user must be registered with the API before they can perform a payment. Register a user by submitting details verified as part of your KYC process, such as name, email, and phone number. For a full list of required fields, see the create user endpoint.
You must store the id
for the user returned from the endpoint in your database and provide it each time the user performs a payment using Push.
Create intent
After the user has been registered, call the create intent endpoint to initiate a payment session. Submit basic details about the transaction such as the amount, currency, and direction.
Set the redirect_url
parameter to control where the user will be redirected after the payment session.
example create-intent request body
Return the url
field from the response to the frontend to redirect the user to the payment session.
Define callback
Set up a callback function on the button to handle clicks. The callback should invoke your backend and return the payment session URL.
Receive webhook
The final step for the integration is enabling webhooks. Whenever a payment intent is approved, Push will submit a webhook (http POST request) to your backend notifying your system of the event.
Configure URL
Specify where Push delivers notifications via the webhook_url
parameter passed to create-intent.
example create-intent request body
Process payload
Match webhook events to your internal records by populating the X-Idempotency-Key
header with your internal transaction identifier.
The key will be included in the webhook payload for the payment intent.
example webhook payload
Next steps
Once you have completed an integration in sandbox, you can move into production and start performing live money-movement. Contact us via Slack or email to receive your production API key.