API reference · tag loans
Loans
The life of a disbursed credit: payment plan, installments, collections, extraordinary partial payments, payoff and certificates.
This page is generated from the contract (data/gateway-v1.json): each operation shows its verb,
path, parameters, body, responses, whether it carries an Idempotency-Key, and the equivalent method in all five SDKs.
For the end-to-end flow with complete examples, see the implementation guide.
Operations in tag loans #
Contract description: Loan portfolio: the affiliate’s already-disbursed loans (balance, next installment, arrears), payment plan and installment breakdown, collections reported by the entity (counter, payroll deduction/libranza, bank file), extra payment, full payoff and debt certificate / paid-in-full certificate (paz y salvo). The affiliate is identified by document; loan_id accepts the loan’s UUID or number.
| Method | Path | Operation | Scope | Idem. |
|---|---|---|---|---|
| GET | /v1/gateway/loans/ | Affiliate's loans | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/ | Loan detail | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/certificate/ | Debt certificate / paid-in-full certificate (paz y salvo) | loans:read | — |
| POST | /v1/gateway/loans/{loan_id}/extra-payment/ | Register a principal prepayment | loans:collect | recommended |
| GET | /v1/gateway/loans/{loan_id}/extra-payment/quote/ | Simulate an extra payment | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/installments/ | Payment plan | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/installments/{number}/ | Installment detail | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/installments/{number}/breakdown/ | Installment breakdown (how a payment would be applied) | loans:read | — |
| GET | /v1/gateway/loans/{loan_id}/payments/ | Payment history | loans:read | — |
| POST | /v1/gateway/loans/{loan_id}/payments/ | Register a payment received by the entity | loans:collect | recommended |
| POST | /v1/gateway/loans/{loan_id}/payoff/ | Register an early full payoff | loans:collect | recommended |
| GET | /v1/gateway/loans/{loan_id}/payoff/quote/ | Quote today's full payoff | loans:read | — |
Affiliate's loans #
GET/v1/gateway/loans/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
document required | query | string | Affiliate document. E.g.: 1032456789 |
status | query | string | ACTIVE (live loan portfolio) or a specific status (PAID_OFF, IN_ARREARS…). |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Loans with balance, next installment and arrears. | LoanList
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.list()client.loans.list()$client->loans->list()await client.Loans.ListAsync()client.Loans.List(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/?document=1032456789" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Loan detail #
GET/v1/gateway/loans/{loan_id}/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Summary + today’s full payoff + paid-in-full (paz y salvo) status. | LoanSummary
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.get()client.loans.get()$client->loans->get()await client.Loans.GetAsync()client.Loans.Get(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Debt certificate / paid-in-full certificate (paz y salvo) #
GET/v1/gateway/loans/{loan_id}/certificate/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
as_of | query | string | Cut-off date YYYY-MM-DD (today by default). |
pdf | query | boolean | true → generates the PDF and returns a signed pdf_url. |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Balance as of the date and paid-in-full (paz y salvo) status. | LoanCertificate
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.certificate()client.loans.certificate()$client->loans->certificate()await client.Loans.CertificateAsync()client.Loans.Certificate(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/certificate/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Register a principal prepayment #
POST/v1/gateway/loans/{loan_id}/extra-payment/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
Idempotency-Key | header | string | Client-generated key that makes a write safely retryable. Replaying the same key returns the original result with idempotent_replay: true; a replay while the original is still in flight returns 409. E.g.: horizonte-2026-06-26-credit-000123 |
Request body
Content type: application/json · required
Schema LoanCollectionIn — Collection reported by the entity. The reference is the receipt’s natural key (loan + channel + reference): resending it returns the same receipt; with a different amount → 409.
| Field | Type | Description |
|---|---|---|
amount | string | number | Amount in COP. Optional for payoff. E.g.: "195000" |
channel | string | Values: CASH, ACH_LIBRANZA, BANK_FILE, MANUAL. E.g.: "CASH" |
document | string | Optional: if sent, the loan must belong to that affiliate. E.g.: "1032456789" |
installment_number | integer | Payments only: installment to pay first. |
mode | string | Extra-payment only. Values: reduce_term, reduce_installment. |
reference required | string | E.g.: "REC-2026-001" Max. 100 characters. |
value_date | string (date) | Value date (not in the future). |
Accepts additional fields (additionalProperties): they're forwarded to the engine unchanged.
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Collection applied (or a resend of the same reference). | TransactionEnvelope
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.register_extra_payment()client.loans.registerExtraPayment()$client->loans->registerExtraPayment()await client.Loans.RegisterExtraPaymentAsync()client.Loans.RegisterExtraPayment(ctx, …)curl -X POST "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/extra-payment/" \
-H "X-API-Key: $COMPENSE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"document": "1032456789",
"amount": "195000",
"channel": "CASH",
"reference": "REC-2026-001"
}'Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Simulate an extra payment #
GET/v1/gateway/loans/{loan_id}/extra-payment/quote/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
amount required | query | string | Prepayment amount (COP). |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Prepayment allocation and scenarios (shorten the term / lower the installment). | LoanQuote
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.quote_extra_payment()client.loans.quoteExtraPayment()$client->loans->quoteExtraPayment()await client.Loans.QuoteExtraPaymentAsync()client.Loans.QuoteExtraPayment(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/extra-payment/quote/?amount=<amount>" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Payment plan #
GET/v1/gateway/loans/{loan_id}/installments/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
status | query | string | PENDING | PARTIAL | OVERDUE | PAID |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Installments of the plan’s active version. | LoanInstallmentList
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.installments()client.loans.installments()$client->loans->installments()await client.Loans.InstallmentsAsync()client.Loans.Installments(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/installments/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Installment detail #
GET/v1/gateway/loans/{loan_id}/installments/{number}/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
number required | path | integer | Installment number. E.g.: 4 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Installment with its components and the outstanding amount. | LoanInstallment
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.get_installment()client.loans.getInstallment()$client->loans->getInstallment()await client.Loans.GetInstallmentAsync()client.Loans.GetInstallment(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/installments/4/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Installment breakdown (how a payment would be applied) #
GET/v1/gateway/loans/{loan_id}/installments/{number}/breakdown/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
number required | path | integer | Installment number. E.g.: 4 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
amount | query | string | Amount to simulate; without it, the installment’s outstanding amount. |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Allocation order applied to the amount. | LoanQuote
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.installment_breakdown()client.loans.installmentBreakdown()$client->loans->installmentBreakdown()await client.Loans.InstallmentBreakdownAsync()client.Loans.InstallmentBreakdown(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/installments/4/breakdown/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Payment history #
GET/v1/gateway/loans/{loan_id}/payments/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Loan receipts. | LoanQuote
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.payments()client.loans.payments()$client->loans->payments()await client.Loans.PaymentsAsync()client.Loans.Payments(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/payments/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Register a payment received by the entity #
POST/v1/gateway/loans/{loan_id}/payments/
reference (and by Idempotency-Key at the edge). Emits payment.received and payment.applied (and loan.paid_off if it pays off the loan).Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
Idempotency-Key | header | string | Client-generated key that makes a write safely retryable. Replaying the same key returns the original result with idempotent_replay: true; a replay while the original is still in flight returns 409. E.g.: horizonte-2026-06-26-credit-000123 |
Request body
Content type: application/json · required
Schema LoanCollectionIn — Collection reported by the entity. The reference is the receipt’s natural key (loan + channel + reference): resending it returns the same receipt; with a different amount → 409.
| Field | Type | Description |
|---|---|---|
amount | string | number | Amount in COP. Optional for payoff. E.g.: "195000" |
channel | string | Values: CASH, ACH_LIBRANZA, BANK_FILE, MANUAL. E.g.: "CASH" |
document | string | Optional: if sent, the loan must belong to that affiliate. E.g.: "1032456789" |
installment_number | integer | Payments only: installment to pay first. |
mode | string | Extra-payment only. Values: reduce_term, reduce_installment. |
reference required | string | E.g.: "REC-2026-001" Max. 100 characters. |
value_date | string (date) | Value date (not in the future). |
Accepts additional fields (additionalProperties): they're forwarded to the engine unchanged.
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Collection applied (or a resend of the same reference). | TransactionEnvelope
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.register_payment()client.loans.registerPayment()$client->loans->registerPayment()await client.Loans.RegisterPaymentAsync()client.Loans.RegisterPayment(ctx, …)curl -X POST "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/payments/" \
-H "X-API-Key: $COMPENSE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"document": "1032456789",
"amount": "195000",
"channel": "CASH",
"reference": "REC-2026-001"
}'Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Register an early full payoff #
POST/v1/gateway/loans/{loan_id}/payoff/
amount is sent, it must match payoff/quote (otherwise 422).Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
Idempotency-Key | header | string | Client-generated key that makes a write safely retryable. Replaying the same key returns the original result with idempotent_replay: true; a replay while the original is still in flight returns 409. E.g.: horizonte-2026-06-26-credit-000123 |
Request body
Content type: application/json · required
Schema LoanCollectionIn — Collection reported by the entity. The reference is the receipt’s natural key (loan + channel + reference): resending it returns the same receipt; with a different amount → 409.
| Field | Type | Description |
|---|---|---|
amount | string | number | Amount in COP. Optional for payoff. E.g.: "195000" |
channel | string | Values: CASH, ACH_LIBRANZA, BANK_FILE, MANUAL. E.g.: "CASH" |
document | string | Optional: if sent, the loan must belong to that affiliate. E.g.: "1032456789" |
installment_number | integer | Payments only: installment to pay first. |
mode | string | Extra-payment only. Values: reduce_term, reduce_installment. |
reference required | string | E.g.: "REC-2026-001" Max. 100 characters. |
value_date | string (date) | Value date (not in the future). |
Accepts additional fields (additionalProperties): they're forwarded to the engine unchanged.
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Collection applied (or a resend of the same reference). | TransactionEnvelope
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.register_payoff()client.loans.registerPayoff()$client->loans->registerPayoff()await client.Loans.RegisterPayoffAsync()client.Loans.RegisterPayoff(ctx, …)curl -X POST "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/payoff/" \
-H "X-API-Key: $COMPENSE_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"document": "1032456789",
"amount": "195000",
"channel": "CASH",
"reference": "REC-2026-001"
}'Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.
Quote today's full payoff #
GET/v1/gateway/loans/{loan_id}/payoff/quote/
Parameters
| Name | In | Type | Description |
|---|---|---|---|
loan_id required | path | string | Loan UUID or its number (loan_number). E.g.: 3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7 |
document | query | string | Affiliate document. Optional: if sent, the loan must belong to that affiliate. E.g.: 1032456789 |
Responses
| Code | Description | Body |
|---|---|---|
| 200 | Exact amount that payoff charges today. | LoanQuote
application/json |
Possible errors (400, 401, 403, 404, 409, 422, 429, 500, 502, 504) — application/problem+json
| 400 | Malformed request. | about:blank |
| 401 | Missing or invalid API key. | about:blank |
| 403 | The key is valid but lacks the required scope, or the source IP is not allow-listed. | about:blank |
| 404 | The requested resource does not exist. | about:blank |
| 409 | Idempotency conflict — same key, original still processing. | https://errors.compense.co/gateway/idempotency-conflict |
| 422 | Request body failed validation. | https://errors.compense.co/gateway/validation |
| 429 | Per-key rate limit or monthly quota exceeded; see Retry-After. | https://errors.compense.co/gateway/rate-limited |
| 500 | Unexpected gateway error; quote the trace_id to support. | about:blank |
| 502 | The processing engine returned an error. | https://errors.compense.co/gateway/upstream-error |
| 504 | The processing engine did not respond in time. | https://errors.compense.co/gateway/upstream-error |
See problem+json errors for the equivalent exception in each SDK.
Example
client.loans.quote_payoff()client.loans.quotePayoff()$client->loans->quotePayoff()await client.Loans.QuotePayoffAsync()client.Loans.QuotePayoff(ctx, …)curl "https://sandbox.dev.compense.co/gw/v1/gateway/loans/3f1c2e7a-4b8d-4e6f-a1c0-d2e3f4a5b6c7/payoff/quote/" \
-H "X-API-Key: $COMPENSE_API_KEY"Each SDK's methods come from its contract parity suite. The cURL runs against the sandbox; <field> values are placeholders.