Getting Started
1. Authentication
Get your API token at app.gigstack.pro/settings?tab=api2. Base URL
livemode value cannot change an API key’s mode. See authentication.
3. Authentication Header
Nearly every API request requires the Authorization header:
Internal partner provisioning is separate from this public account API. A tenant bearer credential does not grant partner signup authority.
Authentication errors
Credential problems are answered by the authentication layer, before the endpoint runs. These bodies are not the standardized envelope — there is nosuccess and no timestamp:
The plan-gate
403 message is Spanish and contains HTML (La API se encuentra disponible para un plan más grande, …). Branch on the status code; do not show the text to end users or match on it. gigstack Connect adds its own 401 / 403 / 404 cases, listed below.
Client identification (optional)
Documents the API creates for a team are stored withfrom: 'api'. Send X-Gigstack-Client: mcp to store them with from: 'mcp' instead — this is what the gigstack MCP server does. mcp is the only recognised value; anything else is treated as api. The header changes attribution only: mcp documents behave exactly like api documents.
4. Existing-account and partner onboarding
Use the authenticated gigstack application for ordinary account onboarding. Creating API or personal MCP credentials uses the credential approval handoff, with human review in the browser. Restricted partner provisioning has a separate internal contract and credential. It is not an ordinary account API or agent operation. Authorized partners must use the current internal guide: initial credentials are delivered once, and subsequent reads/replays return safe metadata only. After an uncertain provisioning attempt, preserve its operation reference and reconcile the existing account; do not provision another account just to recover credentials. Removing partner routes from this public reference does not replace their server-side authentication.OAuth for apps
An app that acts for a merchant’s team without holding their API key uses gigstack OAuth: an authorization code flow with PKCE. The code is only delivered to a registered redirect URI. Contact gigstack support to register your callback URL. Loopback callbacks (localhost, 127.0.0.1, [::1]) are accepted for local development.
1. Send the merchant to the consent page. Open GET https://api.gigstack.io/v2/oauth2/authorize in their browser:
The merchant signs in (or signs up), chooses a team and approves. Their browser is then sent to your
redirect_uri with a code query parameter. The code is single-use and expires 10 minutes after approval, whatever request_ttl_minutes was. Invalid parameters are answered with 400 and a plain-text body: Missing required <parameter> parameter, Invalid response_type, Invalid code_challenge_method or Invalid request_ttl_minutes.
2. Exchange the code. token, refresh and revoke take their parameters in a POST body, as application/x-www-form-urlencoded or JSON. Use POST: codes, verifiers and refresh tokens then stay out of URLs and request logs. GET with the same parameters in the query string still works. When both are sent, the body wins.
access_token on live data, access_token_test on test data. They last one hour (expires_in is in seconds). Send them as Authorization: Bearer <token>. Errors are 400 with { "error": "unsupported_grant_type" } (grant_type is not authorization_code), invalid_code (missing, unknown, used or expired code) or invalid_grant (code_verifier does not match the challenge).
3. Refresh. POST https://api.gigstack.io/v2/oauth2/refresh with refresh_token returns the same shape: a new live access token, a new test access token and a new refresh token. Store the new refresh token; the one you sent stops working. A refresh token expires 30 days after it was issued. Errors are 400 with error: invalid_request (no refresh_token) or invalid_grant (unknown, revoked or expired), each with an error_description.
4. Revoke. POST https://api.gigstack.io/v2/oauth2/revoke with token (an access or refresh token; token_type_hint is optional). It answers 200 with an empty body, even when the token was unknown or already revoked, and 400 invalid_request when token is missing. Revoking one token revokes its pair (the access and refresh token issued together). The live and test tokens are separate pairs.
The tokens’ client tag (the request’s from) identifies your connection. The Shopify app uses it to link a store with PUT /teams/{id}/integrations/shopify-app and to revoke every token of its connection at once with DELETE /teams/{id}/integrations/shopify-app. Other OAuth clients of the team are not affected.
Key Features
- Mexican Tax Compliance - Full SAT, RFC, and CFDI 4.0 support
- Invoice Lifecycle - Create, stamp, and cancel invoices
- Payment Processing - Multiple processors with refund support
- Client Management - Fiscal validation and EFOS checking
- Service Catalog - Products with tax configurations
- gigstack Connect - Multi-team resource management
gigstack Connect
A master team can act on other teams that share its billing account by adding theteam query parameter to a request:
- Your API key’s team must be a master team (gigstack Connect enabled)
- The target team must exist and share the same billing account
- Your plan must include the
multipleIssuerAccountsfeature - Use an API key: OAuth access tokens are bound to one team, and any other
teamvalue is rejected with403 Team mismatch with OAuth token
{ "message": … } bodies from the authentication layer):
See the gigstack Connect guide for details.
Response Format
Most endpoints return the standardized envelope.timestamp is epoch milliseconds; message is present only when the endpoint sets one.
Success Response
Error Response
error.code is a stable, machine-readable value (validation_failed, invalid_request_body, unauthorized, forbidden, resource_not_found, resource_conflict, internal_server_error, …). Branch on it and on the HTTP status, not on message.
List Response
List endpoints putdata and the pagination keys at the top level:
next back as the next query parameter to get the following page. limit defaults to 10 (max 100) unless an endpoint says otherwise. Search endpoints (/search) report found, page and per_page instead of a cursor.
Exceptions
Not every endpoint uses the envelope: authentication failures (above), invoice creation and stamping ({ "message", "error" }), the SAT and bulk-download endpoints ({ "success", "message", "data" } with no timestamp) and the health probes return their own shapes. Each operation in the API reference documents the exact body it returns.
Test Mode
Every API key is either live or test; the mode is fixed and both use the same host (https://api.gigstack.io/v2). Create your test key at app.gigstack.pro/settings?tab=api.
- Separate data. Resources are stored with the mode of the key that created them, and list and search endpoints only return resources of your key’s mode.
- Crossing modes is refused. For example, cancelling a live invoice with a test key answers
403(Livemode mismatch). - Separate folios. Live and test keep independent folio counters for each series.
- Live-only operations.
POST /invoices/eom/runandPOST /teamsreject test keys. - Verification is scoped. The Mexican staging recipes created test-mode documents and checked their returned mode and workflow results. This does not establish behavior for every provider or a production issuer. Do not provide test-mode output to customers as real fiscal documents. See verification coverage.
- Draft stamping needs an extra check. It uses the stored draft mode. Verify that the draft itself was created in test mode; the calling key does not convert an existing live draft.
Rate Limits
These limits answer429. No Retry-After header is sent.
A credit-limit error requires available credits or a changed limit; retrying faster
does not add credits. A daily SAT quota requires waiting for its reset. Other limits
may apply at the infrastructure level.
For
503, inspect the operation’s error code: an unavailable provider and an unknown
stamping outcome are different. Retry reads with bounded backoff. For writes,
reconcile the result and use the endpoint’s documented idempotency behavior before
retrying. A timeout or 500 can occur after an external action has completed. See
responses and retries and invoice errors.
API Resources
Quick Examples
Create a Client
Create an Invoice
Note: exchange_rate is optional. If not provided, the latest rate from our rates collection will be used automatically.
Register a Payment
Note:
exchange_rateis optional. If not provided, the rate from the payment date will be fetched automatically from our rates collection.dateis optional. Use it to backdate a payment (must be in the past). Defaults to current time.
Development Tools
- Swagger UI: Interactive API documentation
- Postman Collection: Pre-configured requests
- Code Examples: Available in multiple languages
- Webhooks: Real-time event notifications
Support
- Documentation: docs.gigstack.io
- Support Email: support@gigstack.io
- API Status: status.gigstack.io
Ready to start building? Choose a resource from the guides above to begin your integration.