This project serves as a backend API for a gig economy payment application. It leverages the Rapyd Disburse API to handle various payment-related functionalities such as creating beneficiaries, initiating payouts, and more. The API is designed to be robust, secure, and easily extendable.
git clone https://github.com/officialsamtech/gig-economy-payment-app.git
npm install
Create a .env
file and populate it with the necessary environment variables (see .env.example
for reference).
Run the application:
npm run dev
To interact with the API, you can use tools like Postman or CURL. The API is hosted at http://localhost:5000/api
.
- Create Beneficiary:
POST /api/beneficiaries
- Get Beneficiary:
GET /api/beneficiaries/:id
- Create Payout:
POST /api/payouts
- Get Payout:
GET /api/payouts/:id
- Complete Payout:
POST /api/payouts/complete/:id/:amount
- List Payout Method Types:
GET /api/payoutMethods?payout_currency
- List Payout Method Required Fields:
GET /api/payouts/:payout_method_type/details
... (list all the endpoints)
The API documentation is generated using OpenAPI and Swagger UI. It can be accessed at http://localhost:5000/api-docs
.
- Webhook Listener:
POST /api/webhook
- Get Webhook Events:
GET /api/webhook/events
- Download and install ngrok.
- Run ngrok to expose your local server:
ngrok http 5000
- Copy the HTTPS URL provided by ngrok.
- Go to the Rapyd dashboard and set the webhook URL to the ngrok HTTPS URL.
- Select these events under Rapyd Disburse:
For more details, follow the instructions in the Rapyd documentation on defining a Webhook endpoint.
If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.