RapidCents Developer Documentation
Invoices Integration Guide
v1.0 · REST API

Invoices

Professional invoicing · Line items & tax · PDF generation · One-time & recurring payments

Summary

Invoices allow merchants to send itemized bills to customers with automatic payment link or subscription creation. When an invoice is created, RapidCents generates a PDF, sends it to the customer via email, and creates a Payment Link (one-time) or Subscription (recurring) for the customer to complete payment.

📄

Invoices support line items, tax, discounts (percentage or fixed), due dates, auto-expiry, and recurring billing via linked subscriptions. The invoice status automatically updates to PAID when the linked payment is completed.

Invoice Lifecycle

  1. Create — Merchant creates an invoice with line items, customer, total, tax, discount, and payment type. A Payment Link or Subscription is automatically created.
  2. Send — RapidCents sends the invoice email to the customer with a PDF attachment and a “Pay Now” button.
  3. Pay — Customer clicks the payment link and completes payment through the hosted payment page. The invoice status automatically updates to PAID.
  4. Resend — Merchant can resend the invoice email at any time.

Invoice Statuses

PENDING

Invoice created and sent. Awaiting customer payment.

REFUNDED

Payment has been refunded to the customer.

PARTIALLY_PAID

Partial payment received (applicable for installment plans).

Processing Flow

One-Time Payment

MerchantCreates Invoice
RapidCentsGenerates PDF & Payment Link
CustomerReceives Email & Pays
Visa · Mastercard · Discover · Amex

Recurring Payment (Subscription / Installment)

MerchantCreates Invoice + Subscription
RapidCentsGenerates PDF & Sends Email
CustomerActivates Subscription
Billing EngineScheduled Charges
Visa · MastercardDiscover · Amex

Authentication

All invoice endpoints require a valid Bearer token and are scoped to a business:

Authorization: Bearer {access_token}
Content-Type: application/json

Base URL pattern: /api/{business_id}/invoices

Create Invoice

POST /api/{business}/invoices

Request Body

FieldTypeRequiredDescription
customerIdstring (UUID)YesCustomer to receive the invoice
itemsarrayYesLine items (see Line Items)
totalnumberYesTotal invoice amount (min: 0.01)
subTotalnumberYesSubtotal before tax and discount
dueDatedateYesInvoice due date
notesstringNoAdditional notes (max 1000 characters)
taxnumberNoTax percentage (e.g. 13 for 13%)
discountnumberNoDiscount value (percentage or fixed amount)
isDiscountPercentagebooleanNotrue = discount is a percentage, false = fixed dollar amount. Default: true
expireOnDuebooleanNoExpire the payment link when the due date passes
customInvoiceNumberstringNoCustom invoice number
threeDSecurebooleanNoEnable 3D Secure. Default: true
paymentInfoobjectYesPayment configuration (see below)

Payment Info Object

FieldTypeRequiredDescription
paymentTypestringNo1 = One-time Payment Link (default), 2 = Subscription, 3 = Installment
merchant_descriptionstringYesPayment description
sequenceintegerIf type 2Billing frequency (1–6)
startDatedateIf type 2 or 3First charge date
numberOfBillsintegerIf type 3Number of installments (min: 1)
endDatedateNoSubscription end date
Request
POST /api/{business}/invoices
Content-Type: application/json
Authorization: Bearer {token}

{
  "customerId": "customer-uuid",
  "items": [
    {
      "name": "Web Development",
      "description": "Frontend implementation",
      "quantity": 10,
      "price": 150.00
    },
    {
      "name": "SSL Certificate",
      "quantity": 1,
      "price": 49.99
    }
  ],
  "subTotal": 1549.99,
  "tax": 13,
  "discount": 10,
  "isDiscountPercentage": true,
  "total": 1574.49,
  "dueDate": "2026-03-15",
  "expireOnDue": true,
  "notes": "Thank you for your business!",
  "paymentInfo": {
    "paymentType": "1",
    "merchant_description": "Invoice for web development services"
  }
}
Response — 200 OK
{
  "ok": true,
  "message": "Invoice created successfully",
  "invoice": {
    "id": "invoice-uuid",
    "invoice_number": "INV-20260219-0001",
    "status": "PENDING",
    "total": 1574.49,
    "payment_link_id": "payment-link-uuid",
    "created_at": "2026-02-19T12:00:00.000000Z"
  }
}

List Invoices

GET /api/{business}/invoices

Returns a paginated list of invoices with optional date filters.

Response — 200 OK
{
  "ok": true,
  "invoices": {
    "data": [ /* array of invoice objects */ ],
    "current_page": 1,
    "per_page": 10,
    "total": 25
  },
  "filters": { "fromDate": null, "toDate": null }
}

Get Invoice

GET /api/{business}/invoices/{invoice}

Returns the full details of a single invoice.

Update Invoice

PUT /api/{business}/invoices/{invoice}

Updates an existing invoice. Only editable if the linked payment has not been completed and no active subscription exists.

Delete Invoice

DELETE /api/{business}/invoices/{invoice}

Deletes an invoice along with its linked Payment Link or Subscription. Only deletable if the linked payment has not been completed.

Response — 200 OK
{
  "ok": true,
  "message": "Invoice deleted successfully"
}

Resend Invoice

POST /api/{business}/invoices/{invoice}/resend

Re-sends the invoice email to the customer with the PDF attachment and payment link.

Response — 200 OK
{
  "ok": true,
  "message": "Invoice resent successfully"
}

Export Invoices

GET /api/{business}/invoices/export

Returns all invoices matching the filter criteria in a JSON format suitable for spreadsheet export.

Line Items

Each invoice must contain at least one line item. Items are stored as JSON within the invoice.

FieldTypeRequiredDescription
namestringYesItem name (max 255 characters)
descriptionstringNoItem description (max 1000 characters)
quantitynumberYesQuantity (min: 1)
pricenumberYesUnit price (min: 0)

The PDF invoice displays line items in a table with columns: Name, Quantity, Unit Price, and Total (quantity × price).

Tax & Discount

Tax

The tax field represents a percentage applied to the subtotal. For example, a tax value of 13 means 13% tax.

// Tax calculation
tax_amount = sub_total × (tax / 100)

Discount

Discounts can be either percentage-based or a fixed dollar amount, controlled by the isDiscountPercentage field:

isDiscountPercentageDiscount ValueCalculation
true (default)1010% off the subtotal
false50$50 off the subtotal

Payment Types

TypeValueDescriptionLinked Entity
One-time1 (default)Customer pays the full amount at once via Payment LinkPayment Link
Subscription2Recurring charges at the specified frequencySubscription
Installment3Fixed number of equal paymentsSubscription (with installment count)

For subscription and installment types, the invoice is linked to a Subscription. The customer receives an email directing them to the subscription activation page where they enter card details.

Due Dates & Expiry

  • dueDate — Required. The date by which payment is expected.
  • expireOnDue — Optional. When set to true, the linked Payment Link will automatically expire when the due date passes, preventing further payment.

There is no automatic “overdue” status. Overdue invoices remain in PENDING status. Use the expireOnDue flag to enforce payment deadlines.

PDF Generation

When an invoice is created, RapidCents automatically generates a PDF document containing:

  • Business logo and legal name
  • Invoice number and date
  • Customer details
  • Line items table (Name, Quantity, Unit Price, Total)
  • Subtotal, tax, discount, and grand total
  • Due date
  • Notes (if provided)

The PDF is attached to the customer notification email and can be downloaded from the merchant dashboard.

All Endpoints

MethodEndpointDescription
GET/api/{business}/invoicesList invoices
POST/api/{business}/invoicesCreate invoice
GET/api/{business}/invoices/{id}Get invoice details
PUT/api/{business}/invoices/{id}Update invoice
DELETE/api/{business}/invoices/{id}Delete invoice
POST/api/{business}/invoices/{id}/resendResend invoice
GET/api/{business}/invoices/exportExport invoices

Notifications

EventRecipientSubjectContent
Invoice created / resentCustomerYour invoice detailsPDF invoice attachment with a “Pay Now” button linking to the Payment Link or Subscription page

The “Pay Now” link in the email directs to:

  • One-time: /customer/payment_links/{payment_link_id}
  • Subscription/Installment: /customer/recurring_payments/{subscription_id}

Error Handling

HTTP CodeScenarioDescription
422Validation errorMissing required fields, invalid data, or total below 0.01
404Not foundInvoice does not exist
409Cannot deleteInvoice cannot be deleted because the linked payment has been completed
500Server errorUnexpected processing error