Accept Payment
Invoice
Create Invoice

Create Invoice

BudPay's Invoice API allows you to create and send professional invoices to your customers. Customers can pay the invoice using various payment methods supported by BudPay.

Quick Overview

  1. Create Invoice: Call the create invoice API with customer and invoice details.
  2. Share Payment Link: Send the generated redirect link to your customer.
  3. Customer Pays: Customer uses the link to view and pay the invoice.
  4. Receive Notification: Get webhook notification when payment is completed.

Step 1: Creating a New Invoice

Use the create_invoice endpoint to generate a new invoice with customer details and line items.

Sample Request
curl https://api.budpay.com/api/v2/create_invoice \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
    "title": "Test Invoice",
    "duedate": "2023-12-30",
    "currency": "NGN",
    "invoicenumber": "",
    "reminder": "",
    "email": "customer@email.com",
    "first_name": "John",
    "last_name": "Doe",
    "billing_address": "Carlton Gate estate, Akobo",
    "billing_city": "Ibadan",
    "billing_state": "Oyo",
    "billing_country": "Nigeria",
    "billing_zipcode": "234",
    "items": [
        {
            "description": "Professional Services",
            "quantity": "1",
            "unit_price": "1000",
            "meta_data": ""
        }
    ]
}' \
-X POST
Sample Response
{
    "success": true,
    "message": "Invoice created successfully",
    "data": [
        {
            "invoice_id": 1,
            "ref_id": "ovgsfdsfvsd",
            "paycode": "2542jkdhdsioewewew",
            "redirect_link": "https://budpay.com/invoice/payment/2542jkdhdsioewewew"
        }
    ]
}

Try it out

Parameters

This section details the header and request parameters required for creating an invoice.

Header Parameters

Field NameDescription
URLhttps://api.budpay.com/api/v2/create_invoice
MethodPOST
AuthorizationBearer YOUR_SECRET_KEY (Replace with your actual BudPay secret key)
Content-Typeapplication/json

Request Parameters

ParameterDescriptionRequired
titleInvoice title/subjectYes
duedateInvoice due date (YYYY-MM-DD format)Yes
currencyCurrency code (NGN, USD, GHS, KES)Yes
emailCustomer's email addressYes
first_nameCustomer's first nameOptional (but recommended)
last_nameCustomer's last nameOptional (but recommended)
billing_addressCustomer's billing addressYes
billing_cityCustomer's cityYes
billing_stateCustomer's state/provinceYes
billing_countryCustomer's countryYes
billing_zipcodeCustomer's zip/postal codeYes
invoicenumberCustom invoice numberOptional
reminderReminder settingsOptional
itemsArray of invoice line itemsYes

Items Array Parameters

ParameterDescriptionRequired
descriptionItem descriptionYes
quantityItem quantityYes
unit_pricePrice per unitYes
meta_dataAdditional metadataOptional
ℹ️

You can add multiple items to an invoice by including additional objects in the items array.


Step 2: Share Payment Link

After creating the invoice, share the redirect_link from the response with your customer. The customer can use this link to view the invoice details and make payment.

Response Data

FieldDescription
invoice_idUnique invoice identifier in the BudPay system
ref_idInvoice reference ID
paycodeUnique payment code for the invoice
redirect_linkPayment link to share with customer

Step 3: Customer Makes Payment

When the customer visits the redirect link, they will see the invoice details and can pay using any of BudPay's supported payment methods:

  • Card payments
  • Bank transfer
  • Mobile money (where available)

Step 4: Receive Notifications

Once the customer completes payment:

  • Webhook Notification: BudPay will send a webhook notification to your configured webhook URL with the invoice payment details.
  • Email Notification: Both you and your customer will receive email confirmations.
⚠️

Always verify invoice payment status using the transaction verification API before giving value to ensure the payment was successful.


Best Practices

  1. Invoice Numbers: Use the invoicenumber field to maintain your own invoice numbering system for better tracking.
  2. Due Dates: Set realistic due dates to give customers adequate time to pay.
  3. Item Details: Provide clear, detailed descriptions in the items array for better transparency.
  4. Customer Information: Include complete customer details (first_name, last_name) for professional invoices.
  5. Currency: Ensure the currency matches your business location and customer preference.