Create an atomic repay-and-close facility closure
Reads fresh contract-backed obligations, creates a durable idempotent closure, blocks new drawdowns, and returns the first unsigned action in the same response. A prior closure-dues preview is optional. Partners do not supply closure_dues_id, amount, wallet, chain, contract, or allocation. The eventual borrower transaction repays every outstanding drawdown and closes the LOC atomically.
- : Create and prepare facility closures.
Stable Qiro identifier for one approved LOC facility.
fac_01J5T4K8D7X2Pattern: ^fac_[A-Za-z0-9]+$Optional end-to-end request identifier. The SDK supplies one automatically; Qiro generates and echoes one when absent.
cor_repayment_123UUID protecting a money-sensitive operation from duplicate execution. Qiro SDK methods generate and reuse it automatically.
4c61128a-25c1-4f5f-9490-65e09bc93633Facility closure resource and first unsigned action created.
Invalid schema, field format, or correlation identifier.
The bearer token is missing, invalid, or expired.
The authenticated partner does not own the resource or lacks the required scope.
The facility was not found for the authenticated partner.
Idempotency, workflow state, or verified facility identity conflicts with the request.
The request is valid but rejected by facility, policy, liquidity, or contract rules.
Contract, RPC, subgraph, or reconciliation infrastructure is temporarily unavailable.
POST /v1/facilities/{facility_id}/closures HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
X-Idempotency-Key: 123e4567-e89b-12d3-a456-426614174000
Accept: */*
{
"closure": {
"closure_id": "text",
"facility_id": "text",
"status": "READY_FOR_SUBMISSION",
"repayment_asset": "USDC",
"loc_address": "text",
"token_address": "text",
"token_decimals": 1,
"active_drawdown_ids": [
"text"
],
"outstanding_drawdown_count": 1,
"designated_wallet": {
"wallet_id": "text",
"wallet_version": 1
},
"latest_quoted_total": {
"amount": "text",
"amount_base_units": "text"
},
"latest_maximum_closure": {
"amount": "text",
"amount_base_units": "text"
},
"verified_allocation": {
"total_paid_base_units": "text",
"principal_paid_base_units": "text",
"interest_paid_base_units": "text",
"late_fees_paid_base_units": "text"
},
"correlation_id": "text",
"failure": {
"code": "text"
},
"blockchain_evidence": [
{
"event_name": "RepaymentMade",
"chain_id": 1,
"contract_address": "text",
"transaction_hash": "text",
"log_index": 1,
"block_number": "text",
"block_hash": "text",
"observed_at": "2026-01-01T00:00:00.000Z",
"total_amount_base_units": "text",
"principal_paid_base_units": "text",
"interest_paid_base_units": "text",
"late_fees_paid_base_units": "text"
}
],
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z",
"resource_version": 1
},
"preparation": {
"closure_id": "text",
"status": "READY_FOR_SUBMISSION",
"action": "TOKEN_APPROVAL",
"sequence": 1,
"amount_base_units": "text",
"maximum_closure_base_units": "text",
"expires_at": "2026-01-01T00:00:00.000Z",
"transaction": {
"chain_id": 1,
"to": "text",
"data": "text",
"value": "text"
}
}
}Last updated