Skip to main content
POST

Authorizations

Authorization
string
header
required

Authentication Method: HTTP Bearer token.

The runtime requires the literal Bearer prefix — a bare token in the Authorization header is rejected with 401 unauthorized.

Header Format: Authorization: Bearer YOUR_API_KEY

Your API key is a JWT. Live keys operate on live data (livemode: true); test keys operate on isolated test data (livemode: false).

Get your key at: app.gigstack.pro/settings?tab=api

Errors: credential failures are answered by the authentication layer with a raw { "message": … } body, not the standardized envelope — 401 for a missing, malformed or expired token, 403 for a revoked key or a plan without API access. See the Unauthorized and AuthForbidden responses.

Query Parameters

team
string

gigstack Connect: Target team ID for multi-team access.

Requires gigstack Connect enabled on your team and shared billing account.

Also requires the multipleIssuerAccounts feature on your plan. Requests targeting a team other than the one your API key belongs to return 403 without it.

Only API keys can use it: an OAuth access token sent with another team's id is rejected with 403 Team mismatch with OAuth token.

Optional — omit it entirely unless you are acting on another team. It deliberately carries no example value so generated snippets do not emit ?team=undefined; when the parameter is absent, the team is derived from your API key.

Example: ?team=team_xyz789

Body

application/json
retention_key
string
required

SAT retention type code (01-26). E.g. "26" for Plataformas Tecnológicas

Example:

"26"

client
object
required

Client reference. Same format as invoices/payments. Three modes:

  • By ID: { id: "client_123" } — looks up existing client
  • By search: { search: { on_key: "tax_id", on_value: "XAXX010101000", auto_create: true } } — finds or creates
  • Inline: { tax_id: "XAXX010101000", legal_name: "EMPRESA SA", address: { zip: "06700" } } — creates on-the-fly
period_start
number
required

Start month (1-12)

Example:

1

period_end
number
required

End month (1-12)

Example:

3

period_year
number
required

Fiscal year

Example:

2026

total_operation
number
required

Total operation amount. Taxable amount is auto-calculated as total_operation - total_exempt

Example:

93116.98

taxes
object[]
required

Retained taxes. Use friendly names (ISR, IVA, IEPS) — SAT codes are mapped automatically

total_exempt
number | null

Total exempt amount (defaults to 0)

Example:

0

series
string | null

Series for folio management (defaults to "RET")

metadata
object | null

Custom metadata

idempotency_key
string | null

Optional stored reference. This handler does not claim or replay this key to prevent duplicate issuance. Reconcile an ambiguous result before another request; do not assume retry safety.

retention_description
string | null

Required only for key "25" (Otro tipo de retenciones). Free-text description of the retention type.

interest
object | null

Required only for key "16" (Intereses). Financial interest complement data.

platform_services
object | null

Required only for key "26" (Plataformas Tecnológicas). Service details for technology platform retentions. Header totals (IVA trasladado, ISR retenido, etc.) are auto-calculated.

Response

Retention created and stamped successfully

Standardized success envelope emitted by sendSuccessResponse.

success
enum<boolean>
required
Available options:
true
Example:

true

data
object
required

The operation payload.

timestamp
integer<int64>
required

Server time in epoch milliseconds (Luxon.now().toMillis()).

Example:

1767225600000

message
string

Human-readable summary. Present only when the handler supplies one.

Example:

"Operation completed successfully"