Close Payment Batch Insertion
After inserting all desired settlements into the batch, use this endpoint to signal that insertion is complete and processing can begin. You can also discard the entire batch.
Available on
| Profile | Host | Required permission |
|---|---|---|
| Manager | manager-api | Write |
| Consultant | consultant-api | Create Batches |
| Assignor | assignor-api | Write |
Base URL for each host: Environments (Hosts).
Where am I in the flow?
This is the 3rd step of the settlement flow. Before this step, you must have:
Request
ENDPOINT
/settlement/fund_class/{fund_class_key}/payment_batch/{external_id}METHOD
PUTPath params
| Parameter | Type | Description |
|---|---|---|
external_id | string | The external_id provided when creating the batch. |
Request Body
{
"batch_status": "pending_payment"
}
Body attributes
| Field | Type | Required | Description |
|---|---|---|---|
batch_status | string | required | Status to which the batch will be updated. See the enumerators below. |
batch_status enumerators
| Value | Description |
|---|---|
pending_payment | Closes insertion and starts batch processing. Accepted only with the batch in pending_settlements_insertion and at least one settlement in validated or pending_validation. |
discarded | Discards the entire batch. No settlement will be processed. Accepted with the batch in pending_settlements_insertion, pending_validation or pending_payment. |
Response
STATUS
200Response Body
{
"external_id": "41d6ff41-1dac-4df7-9e50-d15210ec57f3",
"status": "pending_payment"
}
Response attributes
| Field | Type | Description |
|---|---|---|
external_id | string | External batch key provided by the partner. |
status | string | New batch status. See below. |
Returned status:
| You sent | Returned status | What it means |
|---|---|---|
pending_payment | pending_payment | Batch closed; awaiting payment confirmation. |
pending_payment | pending_validation | There are settlements under review by QI Tech. When the review ends, the batch moves on to pending_payment by itself. |
discarded | pending_discard or pending_discard_on_cash_account | Discard in progress. The final status discarded arrives through the batch webhook. |
Next steps
After closing the batch, processing starts automatically. Track the result through webhooks or the batch retrieval:
- Payment batch webhooks — notification when the batch is paid, completed or discarded.
- Settlement webhooks — individual notification for each processed settlement.
Errors
| Status | Code | When it happens |
|---|---|---|
| 404 | SET000005 | The fund_class_key does not exist. |
| 403 | SET000028 | The fund does not belong to your profile (the fund's manager, a linked consultant or an associated assignor). |
| 404 | SET000010 | The batch given in the URL does not exist in this fund. |
| 400 | SET000026 | batch_status other than pending_payment or discarded. |
| 400 | SET000049 | Closure request for a batch already in pending_payment, paid or completed. |
| 400 | SET000016 | Closure request for a batch outside pending_settlements_insertion (for example, in pending_validation or being discarded). |
| 400 | SET000017 | The batch has no settlement in validated or pending_validation. |
| 400 | SET000069 | Discard request for a batch already in a final status (paid, completed or discarded). |
Authentication, permission and host errors: see API errors.