/v1/leases/{lease_id}/autopayAuthentication
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>/autopay' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"consent_version": "string",
"payment_method_id": "00000000-0000-4000-8000-000000000001",
"charge_day_offset": 0,
"max_amount": 0
}'Parameters
lease_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
charge_day_offsetintegerDays after the due date to charge. 0 charges on the due date.
Default: 0 · Minimum: 0 · Maximum: 28
consent_versionstringrequiredIdentifier of the autopay disclosure text the tenant agreed to, e.g. autopay-2026-09.
Min length: 1 · Max length: 50
max_amountnumber | string | nullOptional per-attempt cap. Must be at least the lease's rent; null means no cap.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d{0,2}0*$
Show max_amount schema
number | string | nullOptional per-attempt cap. Must be at least the lease's rent; null means no cap.
Variant 1: number
numberVariant 2: string
stringVariant 3: null
nullpayment_method_idstringrequiredStored method to charge. Must belong to this lease's tenant and be chargeable.
Format: uuid
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"charge_day_offset": 0,
"consecutive_failures": 0,
"enrolled_at": "2026-10-29T12:00:00Z",
"id": "00000000-0000-4000-8000-000000000001",
"is_active": false,
"lease_id": "00000000-0000-4000-8000-000000000001",
"payment_method_id": "00000000-0000-4000-8000-000000000001",
"tenant_id": "00000000-0000-4000-8000-000000000001",
"consent_version": "string",
"consented_at": "2026-10-29T12:00:00Z",
"last_charge_at": "2026-10-29T12:00:00Z",
"last_charge_status": "string"
},
"meta": {
"request_id": "string"
}
}application/json
dataAutopayEnrollmentResponserequiredShow data schema
charge_day_offsetintegerrequiredconsecutive_failuresintegerrequiredconsent_versionstring | nullShow consent_version schema
string | nullVariant 1: string
stringVariant 2: null
nullconsented_atstring | nullFormat: date-time
Show consented_at schema
string | nullVariant 1: string
stringVariant 2: null
nullenrolled_atstringrequiredFormat: date-time
idstringrequiredFormat: uuid
is_activebooleanrequiredlast_charge_atstring | nullFormat: date-time
Show last_charge_at schema
string | nullVariant 1: string
stringVariant 2: null
nulllast_charge_statusstring | nullShow last_charge_status schema
string | nullVariant 1: string
stringVariant 2: null
nulllease_idstringrequiredFormat: uuid
max_amountstring | nullPattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show max_amount schema
string | nullVariant 1: string
stringVariant 2: null
nullnext_attempt_onstring | nullFormat: date
Show next_attempt_on schema
string | nullVariant 1: string
stringVariant 2: null
nullpayment_method_idstringrequiredFormat: uuid
suspended_atstring | nullFormat: date-time
Show suspended_at schema
string | nullVariant 1: string
stringVariant 2: null
nullsuspension_reasonstring | nullShow suspension_reason schema
string | nullVariant 1: string
stringVariant 2: null
nulltenant_idstringrequiredFormat: uuid
metaMetarequiredEnvelope 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