Skip to content

Quickstart

Flashpi is a REST API for Ecuador’s electronic tax documents (comprobantes electrónicos). You send plain JSON with English field names; Flashpi numbers the document, builds the SRI XML and checks it against the official schema, signs it, submits it to the SRI, tracks its authorization, renders the RIDE (the printable PDF) and emails it to your customer. That email delivery is being enabled: until then, you deliver the RIDE and the XML yourself (see RIDE and email).

In this guide you create a test API key, issue an invoice with the shared demo issuer in the SRI test environment, wait for the SRI’s answer in the same request, and download the RIDE. You do not need a signing certificate of your own yet.

  • A Flashpi account. Sign up in the console with Google or your email and a password. Verify your email with the link we send when required (Gmail and Google Workspace sign-ups are already verified): the sandbox turns on once the account owner’s email is verified. When you first sign in, the console asks you, as the account owner, to set up two-factor authentication with an authenticator app before anything else.
  • curl (or any HTTP client) on a server or your computer. The API lives at https://api.flashpi.com.ec.
  1. Create a test API key. In the console, choose Test in the environment switch (in the left menu, under your account; on a phone, at the top right). Open API keys and create a key with access to every issuer (scope account) and read and write access: the dialog says Create test API key. Copy it right away: Flashpi only keeps a hash of it and shows it once. Keep it in an environment variable:

    Terminal window
    export FLASHPI_API_KEY="fp_test_..."

    Test keys (fp_test_) issue in the SRI test environment, where documents have no tax effect. See Authentication and API keys.

  2. Copy the demo issuer’s ID. The console’s Overview shows the demo issuer (Signia Digital S.A., the company that operates Flashpi), its ID, its establishment and emission point (001 and 001) and today’s test quota (50 documents per account and day). It also appears under Issuers, marked as the demo issuer. GET /v1/issuers lists only your own issuers, so take the ID from the console. See Sandbox and demo issuer.

  3. Send the invoice in sync mode. Replace <demo issuer id> with the ID and <your email> with your own address, so the email that a real customer would get reaches you once email delivery is enabled. With options.waitForAuthorization, the request waits for the SRI’s answer (up to 15 seconds by default).

    Terminal window
    curl https://api.flashpi.com.ec/v1/invoices \
    -H "Authorization: Bearer $FLASHPI_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -H "Content-Type: application/json" \
    -d '{
    "issuerId": "<demo issuer id>",
    "establishment": "001",
    "emissionPoint": "001",
    "customer": {
    "idType": "ruc",
    "id": "1790000000001",
    "name": "Supermercados La Pradera S.A.",
    "email": "<your email>"
    },
    "items": [
    {
    "code": "SRV-001",
    "description": "Monthly accounting services",
    "quantity": "1",
    "unitPrice": "450.00",
    "taxes": [{ "type": "vat", "rate": "15" }]
    }
    ],
    "payments": [{ "method": "other_financial_system", "amount": "517.50" }],
    "options": { "waitForAuthorization": true }
    }'

    Amounts and quantities are decimal strings. You send the price and the VAT rate; Flashpi computes the subtotal, the VAT (67.50) and the total (517.50). The payments must add up to that total. The Idempotency-Key makes the request safe to retry (see Idempotency).

  4. Read the answer. When the SRI answers within the wait, the response is 200 OK with the document in its final status, here authorized:

    {
    "id": "01a14116-1c50-73e7-8aab-349c93e541da",
    "type": "invoice",
    "environment": "test",
    "status": "authorized",
    "issuerId": "01a0f7fa-bd80-7d58-8d62-73a4adc597cb",
    "establishment": "001",
    "emissionPoint": "001",
    "sequential": 4821,
    "number": "001-001-000004821",
    "accessKey": "1510202601099341137200110010010000048217014625315",
    "issueDate": "2026-10-15",
    "xmlVersion": "2.1.0",
    "counterparty": { "id": "1790000000001", "name": "Supermercados La Pradera S.A." },
    "totals": {
    "subtotal": "450.00",
    "discount": "0.00",
    "taxes": [{ "type": "vat", "rate": "15", "taxableBase": "450.00", "amount": "67.50" }],
    "tip": "0.00",
    "total": "517.50"
    },
    "authorization": {
    "number": "1510202601099341137200110010010000048217014625315",
    "authorizedAt": "2026-10-15T19:42:13.000Z"
    },
    "ride": { "status": "pending", "template": null, "generatedAt": null },
    "email": { "requested": true, "status": "queued", "deliveries": [], "warnings": [] },
    "sriMessages": [
    {
    "code": "test_environment",
    "message": "The document was processed in the SRI test environment and has no tax validity.",
    "severity": "warning"
    }
    ],
    "failure": null,
    "voidedAt": null,
    "createdAt": "2026-10-15T19:42:10.512Z",
    "updatedAt": "2026-10-15T19:42:13.204Z"
    }

    In the test environment the SRI adds the warning test_environment to every document it authorizes; it does not change the authorization. The Location header points at the document (/v1/documents/{id}), and x-request-id identifies the request if you ever contact support.

    If the SRI takes longer than the wait, the answer is 202 Accepted with the document in pending_sri. Nothing is lost: Flashpi keeps going and the document settles on its own. Read it again with GET /v1/documents/{id}, or receive the invoice.authorized and invoice.rejected webhooks. A rejected document carries the SRI’s reasons in sriMessages.

  5. Download the RIDE. Flashpi renders the RIDE right after the authorization, so it usually takes a few seconds more than the authorization itself:

    Terminal window
    curl https://api.flashpi.com.ec/v1/documents/01a14116-1c50-73e7-8aab-349c93e541da/pdf \
    -H "Authorization: Bearer $FLASHPI_API_KEY" \
    -o factura-001-001-000004821.pdf

    While ride.status is still pending, this answers 409 with the code ride_not_available: wait a moment and try again, or wait for the document.ride.generated webhook. GET /v1/documents/{id}/xml returns the authorized XML.

  • Flashpi validated the request, assigned the next sequential of the demo issuer’s numbering (it is shared by every sandbox account, so do not expect consecutive numbers), generated the 49-digit access key, built the XML (factura 2.1.0) and checked it against the SRI schema.
  • It signed the XML with the demo issuer’s test certificate, submitted it to the SRI test environment and polled its authorization. The request waited for that answer because of the sync mode.
  • After the authorization, it rendered the RIDE in your account’s template and queued the email with the RIDE and the XML to customer.email.
  • Follow documents with webhooks instead of waiting in the request: Webhooks and Sync and async modes.
  • Issue other documents: credit notes, withholding receipts, waybills and more, all in Issuing documents.
  • Use your own RUC: create your issuer from its signing certificate (.p12): Flashpi reads the RUC and the holder, you review and complete its tax profile, and the same certificate serves test and live. Your own issuers work with test keys too, without the demo issuer’s daily quota.
  • Go live: live keys (fp_live_) issue documents with tax effect in the SRI production environment. An account owner creates them in the console, with two-factor authentication, once the account has an issuer of its own with an accepted certificate. A certificate uploaded through the onboarding from the certificate already signs live documents; one uploaded to an issuer with a key signs only the documents of that key’s environment (Certificates). The requests stay the same: only the key and the issuerId change.