Appearance
Invoice Payment
This page outlines the workflow for creating an invoice and then paying it via the API. This guide will walk you through the complete process from invoice creation to payment processing.
1. Create Invoice
First, create an invoice using the Invoice API. This will generate an invoice with a unique ID that can be used for payment.
See Invoice API Reference for more details.
Request:
Response:
json
{
"status": "success",
"msg": "success",
"data": {
"id": "bhi9vado3hogrne0u4tg",
"public_hash": "e714efae-ecb6-45e1-a141-1d542efc3f26", // public hash for invoice payment - use this for payment //
"hosted_url": "https://sandbox.basysiqpro.com/invoice/d038ea94-3f4f-4703-9e94-74792605944e",
// all other invoice fields...
}
}2. Pay Invoice
Use the Pay Invoice endpoint to process payment for the invoice created in the previous step. You can pay using various payment methods including card, ACH, or a saved customer payment method.
See Pay Invoice API Reference for more details.
Request:
Alternative: Send Invoice for Customer Payment
Instead of paying the invoice directly via the API, you can send the invoice to your customer via email or text message using the hosted_url from the invoice creation response. The customer can then click the link to view and pay the invoice through the hosted payment page.
The invoice creation response includes a hosted_url field that provides a direct link to a payment page where customers can securely enter their payment information and pay the invoice.
Send via Email
You can include the hosted_url in an email to your customer. When they click the link, they'll be taken to a secure payment page where they can complete the payment:
html
Dear Customer,
Please click the link below to view and pay your invoice:
<a href="https://yourgateway.com/invoice/e714efae-ecb6-45e1-a141-1d542efc3f26">Pay Invoice</a>
Or copy and paste this URL into your browser:
https://yourgateway.com/invoice/e714efae-ecb6-45e1-a141-1d542efc3f26Send via Text Message
You can also send the hosted_url via SMS/text message to your customer:
Your invoice is ready for payment. Click here to pay: https://yourgateway.com/invoice/e714efae-ecb6-45e1-a141-1d542efc3f26