Add a split to a payment
Send the split object when you create an invoice or a card charge through the AgentSnap card API (see Card charge status and refunds). To add, change, or remove the split on an unpaid invoice, use the endpoint at the end.
Split object
| Name | Type | Description | Required |
|---|---|---|---|
| payoutMode | string | managed (we pay each leg) or instructions (you pay each payee). Defaults to managed | no |
| releaseMode | string | automatic (we release each leg when the payment settles) or manual (each leg waits until you release it). Ignored in instructions mode. Defaults to automatic | no |
| parts | array | The amounts to split, each with its own rule set (see Part object) | yes |
Part object
| Name | Type | Description | Required |
|---|---|---|---|
| ruleSetId | number | ID of the rule set that splits this part | yes |
| amountCents | integer | Amount in cents. Omit to split the whole payment. Required with more than one part | no |
| reference | string | Your label for the part, such as a policy number (max 255 characters) | no |
| payoutMethod | string | direct or pending. Overrides every share's payoutMethod for this payment | no |
Parts can total less than the split amount. We pay the rest to your Trust Account.
Amount
Split amounts are in cents. Invoice amounts are in dollars, so a $1,000.00 invoice is 100000 cents.
For an invoice, the split amount is grossPremium + taxes + serviceFee. commission is already in grossPremium. A card fee the policyholder pays on top is not split. For a premium finance invoice, only the downPayment is split.
For a card charge, the split amount is the charge before any surcharge.
Example
Split the whole payment with one rule set:
{
"split": {
"releaseMode": "automatic",
"parts": [
{ "ruleSetId": 12 }
]
}
}Split a $100,000.00 payment across two policies:
{
"split": {
"releaseMode": "manual",
"parts": [
{ "reference": "POL-1001", "amountCents": 4000000, "ruleSetId": 12 },
{ "reference": "POL-1002", "amountCents": 6000000, "ruleSetId": 14 }
]
}
}Split $850.00 of a $1,000.00 invoice. We pay the other $150.00 to your Trust Account:
{
"split": {
"parts": [
{ "ruleSetId": 12, "amountCents": 85000 }
]
}
}Update the split on an unpaid invoice
PUT /api/public/invoices/{invoiceId}/split
URI Parameters
| Name | Type | Description | Required |
|---|---|---|---|
| invoiceId | number | ID of the unpaid invoice | yes |
Request body
Send { "split": { ... } }. To remove the split, send { "split": null }.
Response
A successful request returns a 200 OK status code with no response body.
Error Responses
- 400 Bad Request: No Trust Account on file, parts exceed the split amount, fixed shares exceed their part, a part lacks
amountCentswith several parts, or the invoice is already paid - 404 Not Found: A rule set or the invoice does not exist, or it belongs to another account
NoteAfter you add a split, Remit premium and Remit commission return an error for that invoice.
Updated 9 days ago