> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gigstack.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Build with agents

> Give an agent a small task, an exact request, and a result it can verify.

Start with a task such as **“record the bank transfer for order 1042”**. The agent should
first confirm the issuing team’s country and [issuer setup](/concepts/issuer-setup), then choose the matching recipe before
constructing a request. Read [Shared fields](/concepts/shared-fields), followed by
[Mexico](/countries/mexico) or [Colombia](/countries/colombia). The customer’s country
is not the issuer selection.

## Give your agent these sources

| Source | Use it for |
| - | - |
| [`llms.txt`](https://docs.gigstack.io/llms.txt?v=2026-10-08-refund-verified) | Find the relevant guide without loading the whole site |
| [`examples/workflows.json`](/examples/workflows.json) | Follow structured workflows with country, prerequisites, and verification scope |
| [`openapi.json`](/openapi.json) | Verify operation IDs, fields, types, and response contracts |
| [`recipes/invoice.md`](/recipes/invoice.md) | Read the human walkthrough as Markdown |
| [`llms-full.txt`](https://docs.gigstack.io/llms-full.txt?v=2026-10-08-refund-verified) | Read the full documentation when broad context is necessary |
| [`verification`](/verification) | Distinguish exercised behavior from unverified paths |

The index links above select this release to avoid an older cached copy at the unversioned URLs. Both text exports
include a matching `Documentation revision` digest; use that to detect mixed revisions.
The workflow JSON and OpenAPI links provide structured inputs for the examples.

The documentation search MCP is available at `https://docs.gigstack.io/mcp`.
It searches the documentation; it does not grant access to a gigstack account or execute
account operations. Supply API credentials separately through your local environment.

## A concrete starting prompt

```text theme={null}
Build the customer and payment flow for order 1042 for my Mexican issuing team.
Read https://docs.gigstack.io/recipes/payment.md and
https://docs.gigstack.io/examples/workflows.json, then check the exact operations
in https://docs.gigstack.io/openapi.json.

Use GIGSTACK_BASE_URL and GIGSTACK_API_KEY from my local environment.
Keep keys, signed URLs, certificates, and customer data out of logs and commits.
First verify that the key matches the environment and that returned data is test mode.
Find or create the customer using my stable customer reference.
Prepare the payment request for money already received; set automation_type to none.
Do not add ppd_invoice_id unless this payment is meant to create a complement.
Show me the amount, currency, client, duplicate key, and intended effects before writing,
unless I have already authorized that exact task.
After an authorized write, save the returned payment ID and fetch it to verify the result.
Treat HTTP 400 resource_conflict as a reconciliation step, not a reason to create a new key.
Report what completed, what remains pending, and which response establishes each claim.
```

For cancellations, follow [submit and verify cancellation](/recipes/cancellation). For
refunds, follow [record versus processor refund](/recipes/refund); the payment-registration
idempotency pattern does not apply to refunds.

## Match completion to the business result

| Task | Evidence the agent must inspect |
| - | - |
| Create a customer | Returned `data.id`; intended team and mode; fiscal validation if needed |
| Save a draft | `status: draft`; persisted items and client; stored draft's mode |
| Issue a CFDI | Returned UUID and `status: valid`; retrieve the issued document using that UUID |
| Record a payment | Returned payment ID, expected total/currency, and `status: succeeded` |
| Create a complement automatically | Linked complement UUID and the parent invoice's updated balance |
| Request cancellation | The resulting cancellation state; a submitted request can still be pending |

## Rules that prevent common mistakes

1. Read each workflow’s countryScope. Do not reuse a Mexico fiscal workflow for Colombia.
2. Never invent IDs, fiscal codes, required fields, or universal idempotency support.
3. Treat a JSON value such as `${CLIENT_ID}` in a workflow file as a placeholder to resolve.
4. Match the base URL to the key's environment. Test mode is separate from staging.
5. For draft updates, send the complete intended body and verify the persisted result.
6. For stamping, inspect the stored draft's mode; a test key does not convert a live draft.
7. Save `data.uuid` after stamping. Do not keep using the previous draft ID.
8. A payment registration can finish before its complement. Check both results separately.
9. After a timeout, reconcile the first attempt before retrying a consequential write.

A guide describes how to perform an operation. It is not permission to issue or cancel
invoices, collect or refund money, send messages, change credentials, or delete records.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.