Welcome to the Widgets API documentation. This API allows you to integrate and interact with various payment widgets seamlessly. You can embed buttons for payments, request payments, and display transaction tables.Documentation Index
Fetch the complete documentation index at: https://docs.fractalpay.com/llms.txt
Use this file to discover all available pages before exploring further.
Widget Usage
Pay Link
Pay Button HTML implementation8.00.
Parameters:
amount(number): The amount of the widget to open the payment page for.
Request Link
Request Payment Button HTML implementation8.00.
Parameters:
amount(number): The value of the widget to send the payment request for.recipient_phone(string): The phone number of the recipient.
Transactions Table
Transactions Table HTML implementationid(string): The ID of the table element. In this case, it isfractal_complete_transactions.
Installing JS & NPM Package
To use these widgets, include the following script tag in your HTML:{{merchant_public_key}} with your actual merchant public key.
To use these widgets in a react/Vue.js app, install the following npm package:
Error Handling and FAQs
Error Handling
Error Codes:- 400 Bad Request: The request was invalid or cannot be otherwise served.
- 401 Unauthorized: Authentication is required and has failed or has not yet been provided.
- 404 Not Found: The requested resource could not be found.
- 500 Internal Server Error: An error occurred on the server.
FAQs and Troubleshooting
- Q: What should I do if I receive a 401 Unauthorized error? A: Ensure that your API key is correct and included in the request header.
- Q: How do I update the settings of a widget? A: Use the PUT /widgets/ endpoint with the new settings in the request body.