Create invoice

📘

API Refs

This endpoint creates a new invoice for a policyholder.

Request body

NameTypeDescriptionRequired
policyholderIdnumberID of the policyholderyes
carrierIdnumberID of the insurance carrieryes
grossPremiumnumberGross premium amountyes
effectiveDatestringEffective date of the invoice (ISO 8601)yes
expirationDatestringExpiration date of the invoice (ISO 8601)yes
mgaIdnumberID of the MGAno
commissionnumberCommission amountno
taxesnumberTax amountno
serviceFeenumberService fee amountno
policyIdstringExternal policy ID (max 50 chars)no
brokerCodestringBroker code associated with this invoice (max 50 chars)no
memostringMemo for the invoice (max 256 chars)no
downPaymentnumberDown payment amountno
financeAmountnumberFinance amountno
shouldBeSignedbooleanWhether the invoice should be signedno
paymentMethodstringDesired payment method ("card", "us_bank_account", or "affirm")no

Example request

{
  "policyholderId": 123,
  "carrierId": 456,
  "grossPremium": 1200.50,
  "effectiveDate": "2024-01-01T00:00:00Z",
  "expirationDate": "2025-01-01T00:00:00Z",
  "commission": 120.05,
  "taxes": 50.00,
  "policyId": "POL-98765",
  "brokerCode": "BRK-001",
  "paymentMethod": "us_bank_account"
}

Example with Affirm

{
  "policyholderId": 123,
  "carrierId": 456,
  "grossPremium": 2500.0,
  "effectiveDate": "2024-01-01T00:00:00Z",
  "expirationDate": "2025-01-01T00:00:00Z",
  "commission": 250.0,
  "taxes": 100.0,
  "policyId": "POL-98766",
  "brokerCode": "BRK-001",
  "paymentMethod": "affirm"
}

Response

A successful request returns a 201 Created status code with the created invoice ID and a payment URL:

NameTypeDescription
invoiceIdnumberID of the created invoice (also returned in the location header)
paymentUrlstring | nullLink the policyholder can use to pay the invoice (see below)

paymentUrl depends on how the invoice was created:

  • No paymentMethod provided — the payment link that is emailed to the policyholder. The invoice is finalized and the same link is returned in the response.
  • paymentMethod provided — the checkout URL for that payment method.
  • Draft invoice (amounts/dates not yet set) — null. A payment link does not exist until the invoice is finalized.
{
  "invoiceId": 789,
  "paymentUrl": "https://agent.snaprefund.io/invoice-payment-method?token=..."
}

Payment Method Notes

Affirm Payment Method

When using "affirm" as the payment method, the following validation rules apply:

  • Amount Requirements: The total invoice amount (grossPremium + taxes + serviceFee) must be between $35 and $30,000
  • Account Configuration: Affirm must be enabled for your account by an administrator
  • Validation Errors:
    • If the amount is outside the allowed range, you'll receive a 400 Bad Request error
    • If Affirm is not enabled for your account, you'll receive a 403 Forbidden error
📘

Important

The Affirm validation occurs before invoice creation. Ensure your invoice total meets the minimum requirement of $35 to use Affirm financing.


Did this page help you?