canonical: https://jentic.com/apis/vtex.local/customer-credit-api

# Vtex Customer Credit API

With Customer Credit your store can enable **credit payments** through the checkout. You can also control **invoices** and the **credit limits** of your clients. Learn more about Customer Credit in our [Help Center article](https://help.vtex.com/en/tracks/customer-credit-getting-started--1hCRg21lXYy2seOKgqQ2CC/36grlQ69NK6OCuioeekyCs). Additionally, you can find more information on installment paym. The API exposes 25 endpoints secured with apiKey authentication.

## For AI agents

Programmatically search all invoices, retrieve invoice by id. Covers 25 operations with apiKey authentication.

## Scope

Does not handle communications, crm, or developer tools - use for payments only.

## Capabilities

- Search all invoices
- Retrieve invoice by ID
- Change invoice
- Cancel invoice
- Mark an invoice as paid
- Postpone an invoice

## Use cases

### Payments Operations

Use the Customer Credit API to perform payments operations programmatically. The API provides 25 endpoints covering core functionality including search all invoices, retrieve invoice by id, change invoice.

Example prompt: Call GET `/api/creditcontrol/invoices` to search all invoices

### Automated Invoices Management

Automate invoices operations by combining multiple Customer Credit API endpoints. Agents can retrieve invoice by id and then change invoice in a single workflow.

Example prompt: Call GET `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}` to retrieve invoice by id, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Customer Credit API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle apiKey tokens manually.

Example prompt: Search Jentic for 'search all invoices', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/api/creditcontrol/invoices` | Search all invoices |
| GET | `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}` | Retrieve invoice by ID |
| PUT | `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}` | Change invoice |
| DELETE | `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}` | Cancel invoice |
| GET | `/api/creditcontrol/accounts/{creditAccountId}/invoices` | Retrieve invoices by Customer Credit account ID |
| POST | `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/payments` | Mark an invoice as paid |
| PUT | `/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/postponement` | Postpone an invoice |
| POST | `/api/creditcontrol/accounts` | Open an account |

## Key resources

- **Invoices** — Operations related to Invoices
- **Account** — Operations related to Account
- **Store Configuration** — Operations related to Store Configuration

## Why Jentic

- **Setup:** Wiring the VTEX Customer Credit API by hand means setting both the X-VTEX-API-AppKey and X-VTEX-API-AppToken headers, resolving the account and environment host template, and managing the invoice and account calls yourself. Through Jentic you install once, import the Customer Credit API from the API Directory, store the key pair once, and your agent calls it.
- **Permission scoping:** The Customer Credit API puts the credit account and invoice ids in the URL path (`/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}`), so a rule can pin your agent to reading invoices for one account. You choose the operations it may call, so destructive ones like invoice deletion are not included unless you add them.
- **Credential handling:** Your VTEX AppKey and AppToken are stored once, encrypted, by your own Jentic One instance and injected at execution time. They never enter the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list invoices' or 'read an invoice for an account', and Jentic returns the matching Customer Credit API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Stripe** — Alternative payments API
- **Adyen** — Alternative payments API
- **Square** — Complementary payments API
- **Paypal** — Complementary payments API

## FAQ

### What authentication does the Customer Credit API use?

The Customer Credit API uses an API key passed in the `X-VTEX-API-AppKey` header. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I search all invoices with the Customer Credit API?

Yes. Use the GET `/api/creditcontrol/invoices` endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Customer Credit API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I search all invoices through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'search all invoices'. Jentic returns the matching Customer Credit API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Customer Credit API have?

The Customer Credit API exposes 25 endpoints covering invoices, account, store configuration operations.

### Can I limit what my agent is allowed to do with the Customer Credit API?

Yes. Jentic One is self-hosted by you, so your own rules decide which Customer Credit API operations and credentials the agent may use. Because the credit account and invoice ids sit in the URL path (`/api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}`), you can pin the agent to reading invoices for a single account, and you choose the exact operations it may call so destructive ones like Cancel invoice (DELETE) stay out unless you add them. Your VTEX AppKey and AppToken are stored encrypted by your own instance and injected only at execution time, never entering the agent's prompt or logs.
