Purchase settlements
POST /v1/purchase-settlements issues a purchase settlement (liquidación de compra de bienes y prestación de servicios, XML 1.1.0). The buyer issues it, to document a purchase from a supplier who has no RUC or cannot issue invoices, such as a farmer or an individual providing a service.
Request
Section titled “Request”curl https://api.flashpi.com.ec/v1/purchase-settlements \ -H "Authorization: Bearer $FLASHPI_API_KEY" \ -H "Idempotency-Key: purchase-CACAO-2026-10-15" \ -H "Content-Type: application/json" \ -d '{ "issuerId": "01a0fd6a-d098-76ca-b492-1bcb6505a7bd", "establishment": "001", "emissionPoint": "001", "issueDate": "2026-10-15", "supplier": { "idType": "cedula", "id": "1700000001", "name": "María Fernanda Quishpe", "address": "Recinto La Esperanza, Balzar" }, "items": [ { "code": "CACAO", "description": "Dried cocoa beans", "unit": "KILOGRAM", "quantity": "150.5", "unitPrice": "2.35", "taxes": [{ "type": "vat", "rate": "0" }] } ], "payments": [{ "method": "cash", "amount": "353.68", "term": "0", "termUnit": "days" }], "expectedTotal": "353.68" }'| Field | Required | Notes |
|---|---|---|
supplier |
Yes | Who sells: idType (cedula, passport, foreign_id or ruc, never final_consumer), id, name, and optionally address and email. With an email, Flashpi emails them the authorized settlement. |
items |
Yes | As in an invoice, code included. Lines take VAT only, no ICE. |
payments |
Yes | They must add up to the total, and each one needs a term with its termUnit (days or months); "0" for a payment on the spot. |
expectedTotal |
No | The total you expect. |
Purchase settlements have no tip. The fields every request shares work as everywhere.
What Flashpi computes
Section titled “What Flashpi computes”150.5 kg × 2.35 = 353.675, rounded half up to 353.68. The VAT rate is 0 %, so the total is 353.68, which the payment must match.
Response
Section titled “Response”202 Accepted. Without a supplier email, email.status is skipped:
{ "id": "01a14197-e1d2-7d80-9450-c74268f341f2", "type": "purchase_settlement", "environment": "test", "status": "processing", "issuerId": "01a0fd6a-d098-76ca-b492-1bcb6505a7bd", "establishment": "001", "emissionPoint": "001", "sequential": 9, "number": "001-001-000000009", "accessKey": "1510202603179000000000110010010000000092647509116", "issueDate": "2026-10-15", "xmlVersion": "1.1.0", "counterparty": { "id": "1700000001", "name": "María Fernanda Quishpe" }, "totals": { "subtotal": "353.68", "discount": "0.00", "taxes": [{ "type": "vat", "rate": "0", "taxableBase": "353.68", "amount": "0.00" }], "total": "353.68" }, "authorization": { "number": null, "authorizedAt": null }, "ride": { "status": "pending", "template": null, "generatedAt": null }, "email": { "requested": true, "status": "skipped", "deliveries": [], "warnings": [] }, "sriMessages": [], "failure": null, "voidedAt": null, "createdAt": "2026-10-15T22:03:55.218Z", "updatedAt": "2026-10-15T22:03:55.218Z"}With options.waitForAuthorization the answer can be 200 OK with the final status (Sync and async modes). The purchase_settlement.authorized and purchase_settlement.rejected webhooks report the SRI’s decision.
Errors
Section titled “Errors”| Answer | When |
|---|---|
422 validation_failed |
For example payments[0].term required, supplier.id invalid_check_digit, an ICE tax (unsupported_tax) or a final consumer as the supplier. |
422 total_mismatch |
expectedTotal differs from the computed total. |
409 sequential_already_used, sequentials_exhausted |
See Sequentials. |