Bonaventure OgetoBy Bonaventure Ogeto|

Paystack with Retool for Internal Tools

In Retool: add a REST API resource with base URL https://api.paystack.co, add header Authorization: Bearer sk_live_your_key. Create queries: GET /transaction for transaction list, GET /transaction/verify/{{reference}} for lookup, POST /refund for refunds. Drag UI components (Table, TextInput, Button) onto the canvas and bind them to your queries.

Setting Up Paystack as a Retool Resource

  1. In Retool, go to Resources → Create New → REST API.
  2. Name it Paystack. Base URL: https://api.paystack.co.
  3. Under Headers, add: Authorization = Bearer {"{{"}secrets.PAYSTACK_SECRET_KEY{"}}"}. Store your key in Retool Secrets.
  4. Save the resource.

Now you can create queries in any Retool app that use this resource. Queries run on Retool's server — your Paystack secret key is never exposed to the browser.

Useful Paystack Queries in Retool

QueryMethodEndpointUse
List TransactionsGET/transaction?perPage=50&page={{pageNum.value}}Transaction table with pagination
Search by EmailGET/transaction?customer={{emailInput.value}}Find all payments for a customer
Verify PaymentGET/transaction/verify/{{referenceInput.value}}Look up a single transaction
Refund PaymentPOST/refundInitiate a refund with body {transaction: reference}
List TransfersGET/transfer?perPage=50Payout history

For the Refund query, set the HTTP body to {"{"}"transaction": "{{transactionRef}}", "amount": {{refundAmount}}{"}"}"}}. Add a Confirmation dialog before the query runs so finance team must confirm before submitting.

Learn More

See the Paystack integrations guide for all integration options.

Sign up for the McTaba newsletter

Key Takeaways

  • Add Paystack as a REST API resource in Retool with your secret key as the Authorization header.
  • Build transaction search, refund initiation, and transfer dashboards in hours.
  • Use Retool's Table component with pagination to display Paystack transaction lists.
  • Restrict the Retool app to finance team members using Retool's permission groups.
  • Never expose your Paystack live secret key to end users — keep it server-side in Retool's resource config.

Frequently Asked Questions

Is it safe to put my Paystack live secret key in Retool?
Yes, if you use Retool Secrets (or Environment Variables) rather than hardcoding in query text. Retool Secrets are encrypted at rest and injected server-side — the key never reaches the browser. Do not use a key that appears in query text or app source, as those can be leaked.
Can I use Retool to trigger Paystack bulk transfers?
Yes. Create a Retool query using POST /transfer/bulk with the transfers array. Use a Retool JSON editor component to allow your finance team to paste the recipient list. Add role-based permissions so only authorized users can trigger bulk transfers. Always add a confirmation step before execution.
How do I handle Paystack API pagination in Retool Tables?
Use a Number component (pageNum) connected to your transaction query's page parameter. The Retool Table has built-in pagination UI — connect it to the query's total count from the Paystack response (data.meta.total). Alternatively, use Retool's built-in infinite scroll with manual trigger.

Ready to build real-world apps?

Join the McTaba Labs full-stack marathon (4 months full-time · 6 months part-time). Learn M-Pesa, USSD, and WhatsApp engineering while shipping 8 production apps.

Apply to the McTaba Marathon