Skip to main content

Supplier Portal — Settlements

These endpoints let a supplier (prestador) manage their own settlements (liquidaciones): list them, open one for detail, build a draft from approved invoices, and submit it for payment. A settlement groups several invoices into a single payment batch. Every endpoint is scoped to the supplier behind the token — you only ever see and touch your own settlements.

Supplier account required

The authenticated user must be linked to a supplier (prestador). Requests from a non-supplier account are rejected with 403 FORBIDDEN. All endpoints require a valid JWT token, API key, and tenant header. See Authentication.


List Settlements​

Retrieve a paginated list of the supplier's settlements, with optional date range and status filters.

GET/apidev/v1/supplier-portal/settlements
PermissionAPICLI_PORTALPROVEEDOR_READ
Rate Limit30 req/min (sliding window)

Request Headers​

Every request to a protected endpoint requires these headers:

HeaderRequiredDescription
AuthorizationYesBearer token obtained from the Login endpoint. Format: Bearer <token>
X-API-KeyYesCompany integration key provided during onboarding. Format: gtk_xxx...
tenantYesYour assigned tenant domain (default: geotareas.com) — always send your assigned tenant
Content-TypeConditionalapplication/json — required for POST and PUT requests

Query Parameters​

ParameterTypeRequiredDescription
startdatestring (ISO 8601)NoStart of the date range
enddatestring (ISO 8601)NoEnd of the date range
statusstringNoFilter by settlement state code: BOR, LENV, LAPR, LREC, CER
limitintegerNoRecords per page. Min: 1, Max: 100, Default: 25
offsetintegerNoRecords to skip. Default: 0

Response Fields — data.rows[]​

FieldTypeDescription
settlement_idstringSettlement unique identifier
datestringSettlement creation date
close_datestring | nullWhen the settlement was closed
state_idnumberSettlement state ID
state_codestringSettlement state code (BOR, LENV, …)
state_namestringSettlement state name
totalnumberSettlement total amount
invoice_countnumberNumber of invoices included
receipts_totalnumberTotal of attached receipts
adjustments_totalnumberTotal of adjustments
differencenumberDifference between total and receipts
notesstring | nullFree-text notes
payment_datestring | nullPayment date
payment_referencestring | nullPayment reference

Code Example​

curl -s "https://$TENANT/apidev/v1/supplier-portal/settlements?startdate=2026-05-01&enddate=2026-05-31&status=BOR" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Example Response​

{
"success": true,
"data": {
"rows": [
{
"settlement_id": "9100000000001",
"date": "2026-05-31T10:00:00",
"close_date": null,
"state_id": 1,
"state_code": "BOR",
"state_name": "Borrador",
"total": 3294.00,
"invoice_count": 3,
"receipts_total": 0.00,
"adjustments_total": 0.00,
"difference": 3294.00,
"notes": "Liquidación mayo.",
"payment_date": null,
"payment_reference": null
}
]
},
"meta": {
"total": 1,
"limit": 25,
"offset": 0
}
}

Settlement Detail​

Retrieve a single settlement with its full breakdown: the same row fields as the list, plus the invoices it groups and the receipts attached to it. Returns 404 if the settlement does not belong to the supplier.

GET/apidev/v1/supplier-portal/settlements/{id}
PermissionAPICLI_PORTALPROVEEDOR_READ
Rate Limit30 req/min (sliding window)

Path Parameters​

ParameterTypeRequiredDescription
idstringYesSettlement unique identifier

Response Fields — data.invoices[]​

FieldTypeDescription
invoice_idstringInvoice unique identifier
service_numberstring | nullService display number
account_namestring | nullAccount the service belongs to
system_amountnumberAmount calculated by the system
declared_amountnumber | nullAmount declared by the supplier
provider_invoice_numberstring | nullSupplier's own invoice number
state_codestringInvoice state code
state_namestringInvoice state name
is_manualbooleanWhether the line was added manually
descriptionstring | nullLine description

Response Fields — data.receipts[]​

FieldTypeDescription
receipt_idstringReceipt unique identifier
numberstring | nullReceipt number
datestring | nullReceipt date
typestringReceipt type
amountnumberReceipt amount
notesstring | nullFree-text notes
attachment_urlstring | nullURL to the attached receipt file

The data object also includes every field listed for a list row.

Code Example​

curl -s "https://$TENANT/apidev/v1/supplier-portal/settlements/9100000000001" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Example Response​

{
"success": true,
"data": {
"settlement_id": "9100000000001",
"date": "2026-05-31T10:00:00",
"close_date": null,
"state_id": 1,
"state_code": "BOR",
"state_name": "Borrador",
"total": 3294.00,
"invoice_count": 3,
"receipts_total": 3300.00,
"adjustments_total": 0.00,
"difference": 6.00,
"notes": "Liquidación mayo.",
"payment_date": null,
"payment_reference": null,
"invoices": [
{
"invoice_id": "7234567890123456789",
"service_number": "SRV-2026-0042",
"account_name": "Supermercado Centro",
"system_amount": 1098.00,
"declared_amount": 1100.00,
"provider_invoice_number": "A-0001-0000123",
"state_code": "APR",
"state_name": "Aprobada",
"is_manual": false,
"description": null
}
],
"receipts": [
{
"receipt_id": "9200000000010",
"number": "REC-0001",
"date": "2026-05-31",
"type": "TRANSFER",
"amount": 3300.00,
"notes": "Transferencia bancaria.",
"attachment_url": "https://files.example.com/rec/10.pdf"
}
]
},
"meta": {}
}

Create Settlement​

Create a draft settlement from the supplier's approved invoices. Each invoice is validated: it must belong to the supplier, be in APR (approved) state, and not already be part of an active settlement. Returns 201 with the new settlement detail.

POST/apidev/v1/supplier-portal/settlements
PermissionAPICLI_PORTALPROVEEDOR_WRITE
Rate Limit10 req/min (sliding window)

Request Body​

FieldTypeRequiredDescription
invoice_idsarrayYesInvoices to group (numeric strings, 1–500 items)
notestringNoFree-text note for the settlement

Code Example​

curl -s -X POST "https://$TENANT/apidev/v1/supplier-portal/settlements" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT" \
-H "Content-Type: application/json" \
-d '{
"invoice_ids": ["7234567890123456789", "7234567890123456790"],
"note": "Liquidación mayo."
}'

Example Response — 201 Created​

{
"success": true,
"data": {
"settlement_id": "9100000000001",
"date": "2026-05-31T10:00:00",
"close_date": null,
"state_id": 1,
"state_code": "BOR",
"state_name": "Borrador",
"total": 1640.00,
"invoice_count": 2,
"receipts_total": 0.00,
"adjustments_total": 0.00,
"difference": 1640.00,
"notes": "Liquidación mayo.",
"payment_date": null,
"payment_reference": null,
"invoices": [
{
"invoice_id": "7234567890123456789",
"service_number": "SRV-2026-0042",
"account_name": "Supermercado Centro",
"system_amount": 1100.00,
"declared_amount": 1100.00,
"provider_invoice_number": "A-0001-0000123",
"state_code": "APR",
"state_name": "Aprobada",
"is_manual": false,
"description": null
}
],
"receipts": []
},
"meta": {}
}

Submit Settlement​

Submit a draft settlement for payment. It moves the settlement from BOR (draft) to LENV (submitted) and requires at least one receipt to be attached. Returns the updated settlement row, or 404 if the settlement does not belong to the supplier.

PUT/apidev/v1/supplier-portal/settlements/{id}/submit
PermissionAPICLI_PORTALPROVEEDOR_WRITE
Rate Limit10 req/min (sliding window)

Path Parameters​

ParameterTypeRequiredDescription
idstringYesSettlement unique identifier

Code Example​

curl -s -X PUT "https://$TENANT/apidev/v1/supplier-portal/settlements/9100000000001/submit" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT"

Example Response​

{
"success": true,
"data": {
"settlement_id": "9100000000001",
"date": "2026-05-31T10:00:00",
"close_date": null,
"state_id": 2,
"state_code": "LENV",
"state_name": "Enviada",
"total": 3294.00,
"invoice_count": 3,
"receipts_total": 3300.00,
"adjustments_total": 0.00,
"difference": 6.00,
"notes": "Liquidación mayo.",
"payment_date": null,
"payment_reference": null
},
"meta": {}
}

Errors​

CodeHTTPApplies toDescription
VALIDATION_ERROR400List, Create, SubmitInvalid params or body (e.g. empty invoice_ids, more than 500 items, an invoice that is not approved, or submitting without a receipt)
UNAUTHORIZED401AllMissing or invalid JWT token / API key
TOKEN_EXPIRED401AllThe JWT was valid but has expired (1 hour lifetime)
FORBIDDEN403AllThe account is not a supplier — "This endpoint requires a supplier account." — or lacks the required permission
NOT_FOUND404Detail, SubmitSettlement (or a referenced invoice) does not exist or does not belong to your supplier account
RATE_LIMITED429AllExceeded the endpoint rate limit