/v1/leases/{lease_id}/settlementAuthentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request POST \
--url 'https://api.staging.facily.ai/v1/leases/<LEASE_ID>/settlement' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Idempotency-Key: <IDEMPOTENCY_KEY>' \
--header 'Content-Type: application/json' \
--data '{
"method": "card",
"check_number": "string",
"confirm_pre_cutover": false
}'Parameters
lease_idpath · stringrequiredFormat: uuid
Idempotency-Keyheader · stringrequiredMin length: 1 · Max length: 60
Request body
application/json · Required
check_numberstring | nullRequired for check.
Min length: 1 · Max length: 50
Show check_number schema
string | nullRequired for check.
Variant 1: string
stringVariant 2: null
nullconfirm_pre_cutoverbooleanStaff checked the credit from before cutover against the previous system's records. A check refund that reaches it needs this (409 pre_cutover_unconfirmed); it never goes to a card.
Default: false
methodstringrequiredcard: refund the credit to the newest Facily card payments since go-live; check: refund it by check against the ledger's payments, migrated ones included; keep: leave the balance on the ledger.
Values: "card", "check", "keep"
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"amount": "<VALUE_MATCHING_PATTERN>",
"lease_id": "00000000-0000-4000-8000-000000000001",
"method": "card",
"refunds": [
{
"amount": "<VALUE_MATCHING_PATTERN>",
"payment_id": "00000000-0000-4000-8000-000000000001",
"refund_to": "original_method",
"status": "string"
}
],
"remaining_credit": "<VALUE_MATCHING_PATTERN>",
"replayed": false
},
"meta": {
"request_id": "string"
}
}application/json
dataMoveOutSettlementResponserequiredShow data schema
amountstringrequiredkeep: the balance left on the ledger; card, check: the total of the refunds listed (on a replay, what was started, and what is still to start up to the credit left).
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
lease_idstringrequiredFormat: uuid
methodstringrequiredValues: "card", "check", "keep"
refundsMoveOutRefundResponse[]requiredShow refunds schema
amountstringrequiredPattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
payment_idstringrequiredFormat: uuid
refund_tostringrequiredValues: "original_method", "check"
statusstring | nullcompleted, pending (the processor has not answered yet) or failed. Null on a replay.
Show status schema
string | nullcompleted, pending (the processor has not answered yet) or failed. Null on a replay.
Variant 1: string
stringVariant 2: null
nullremaining_creditstringrequiredCredit still on the ledger that this settlement could not refund: credit from before cutover (card), or credit no payment carries. Settle it by check or keep it.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
replayedbooleanrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired