{"files":{"SKILL.md":"---\nname: customer-credit-api\ndescription: \"Customer Credit API skill. Use when working with Customer Credit for api. Covers 25 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Customer Credit API\nAPI version: 1.0\n\n## Auth\nApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header\n\n## Base URL\nhttps://apiexamples.vtexcommercestable.com.br\n\n## Setup\n1. Set your API key in the appropriate header\n2. GET /api/creditcontrol/invoices -- verify access\n3. POST /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/payments -- create first payments\n\n## Endpoints\n\n25 endpoints across 1 groups. See references/api-spec.lap for full details.\n\n### api\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /api/creditcontrol/invoices | Search all invoices |\n| GET | /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId} | Retrieve invoice by ID |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId} | Change invoice |\n| DELETE | /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId} | Cancel invoice |\n| GET | /api/creditcontrol/accounts/{creditAccountId}/invoices | Retrieve invoices by Customer Credit account ID |\n| POST | /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/payments | Mark an invoice as paid |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/postponement | Postpone an invoice |\n| GET | /api/creditcontrol/accounts | Search all accounts |\n| POST | /api/creditcontrol/accounts | Open an account |\n| GET | /api/creditcontrol/accounts/{creditAccountId} | Retrieve an account by ID |\n| DELETE | /api/creditcontrol/accounts/{creditAccountId} | Close an account |\n| PUT | /api/creditcontrol/accounts/{creditAccountId} | Update account information |\n| GET | /api/creditcontrol/accounts/{creditAccountId}/statements | Get account statements |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/creditlimit | Change credit limit of an account |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/statements/{statementId} | Decrease balance of an account |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}/settlement | Create or update settlement |\n| POST | /api/creditcontrol/accounts/{creditAccountId}/transactions | Create a pre-authorization |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId} | Update a pre-authorization |\n| DELETE | /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId} | Cancel a pre-authorization |\n| POST | /api/creditcontrol/accounts/{creditAccountId}/holders | Add an account holder |\n| DELETE | /api/creditcontrol/accounts/{creditAccountId}/holders/{holderId} | Delete an account holder |\n| PUT | /api/creditcontrol/accounts/{creditAccountId}/tolerance | Change tolerance of an account |\n| POST | /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}/refunds | Partially or totally refund a settlement |\n| GET | /api/creditcontrol/storeconfig | Retrieve store configuration |\n| PUT | /api/creditcontrol/storeconfig | Create or change store configuration |\n\n## Common Questions\n\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all invoices?\" -> GET /api/creditcontrol/invoices\n- \"Get invoice details?\" -> GET /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n- \"Update a invoice?\" -> PUT /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n- \"Delete a invoice?\" -> DELETE /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n- \"List all invoices?\" -> GET /api/creditcontrol/accounts/{creditAccountId}/invoices\n- \"Create a payment?\" -> POST /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/payments\n- \"List all accounts?\" -> GET /api/creditcontrol/accounts\n- \"Create a account?\" -> POST /api/creditcontrol/accounts\n- \"Get account details?\" -> GET /api/creditcontrol/accounts/{creditAccountId}\n- \"Delete a account?\" -> DELETE /api/creditcontrol/accounts/{creditAccountId}\n- \"Update a account?\" -> PUT /api/creditcontrol/accounts/{creditAccountId}\n- \"List all statements?\" -> GET /api/creditcontrol/accounts/{creditAccountId}/statements\n- \"Update a statement?\" -> PUT /api/creditcontrol/accounts/{creditAccountId}/statements/{statementId}\n- \"Create a transaction?\" -> POST /api/creditcontrol/accounts/{creditAccountId}/transactions\n- \"Update a transaction?\" -> PUT /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}\n- \"Delete a transaction?\" -> DELETE /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}\n- \"Create a holder?\" -> POST /api/creditcontrol/accounts/{creditAccountId}/holders\n- \"Delete a holder?\" -> DELETE /api/creditcontrol/accounts/{creditAccountId}/holders/{holderId}\n- \"Create a refund?\" -> POST /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}/refunds\n- \"List all storeconfig?\" -> GET /api/creditcontrol/storeconfig\n- \"How to authenticate?\" -> See Auth section\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints typically return the created/updated object\n\n## CLI\n\n```bash\n# Update this spec to the latest version\nnpx @lap-platform/lapsh get customer-credit-api -o references/api-spec.lap\n\n# Search for related APIs\nnpx @lap-platform/lapsh search customer-credit-api\n```\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Customer Credit API\n@base https://apiexamples.vtexcommercestable.com.br\n@version 1.0\n@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header\n@common_fields {Content-Type: str # Type of the content being sent., Accept: str # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}\n@endpoints 25\n@hint download_for_search\n@toc api(25)\n\n@endpoint GET /api/creditcontrol/invoices\n@desc Search all invoices\n@required {creditAccountId: str # Credit account identification.}\n@optional {from: str # Indicates the starting position of the invoice to be searched in the invoice list. For example, the value `1` indicates that the first invoice in the list will be returned., to: str # Indicates the final position of the invoice to be searched in the invoice list. For example, if the value of `from` is equal to `1` and `to` is `300`, information from 300 invoices will be displayed in the response body of the request., createdDateFrom: str # Indicates the initial creation date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format., createdDateTo: str # Indicates the final creation date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format., dueDateFrom: str # Indicates the initial due date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format., dueDateTo: str # Indicates the final due date of invoices that should be searched in the invoice list based on their creation date. The dates should be in ISO8601 format., value: num # Indicates the value of the invoices to be searched for. It must be completed with a decimal value., status: str(Opened/Paid/Cancelled) # Indicates the status of the invoices to be searched for., friendlyId: str # Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment., observation: str # Observation notes about the invoice.}\n@returns(200) {data: [map], summary: map{total: num, count: int, totalPaid: num, totalCancelled: num}} # OK\n\n@endpoint GET /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n@desc Retrieve invoice by ID\n@required {creditAccountId: str # Credit account identification., invoiceId: str # Invoice identification.}\n@returns(200) {id: str, friendlyId: str, status: str, value: num, accountId: str, creditValue: num, createdAt: str, updatedAt: str, originalDueDate: str, dueDate: str, installment: num, orderId: str, transactionId: str, numberOfInstallments: num, creditAccountId: str} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n@desc Change invoice\n@required {creditAccountId: str # Credit account identification., invoiceId: str # Invoice identification., status: str(Opened/Paid/Cancelled) # Invoice status.}\n@optional {friendlyId: str # Simplified identification of an invoice. This code is created automatically, always associated with an existing invoice. It consists of an 8-digit random ID (of numbers and letters) and the installment., observation: str # Observation notes about the invoice., paymentLink: str # Link (URL) created to direct the customer to an invoice payment environment (optional).}\n@returns(200) OK. This endpoint does not return any data in the response body.\n\n@endpoint DELETE /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}\n@desc Cancel invoice\n@required {creditAccountId: str # Credit account identification., invoiceId: str # Invoice identification.}\n@returns(200) OK. This endpoint does not return any data in the response body.\n\n@endpoint GET /api/creditcontrol/accounts/{creditAccountId}/invoices\n@desc Retrieve invoices by Customer Credit account ID\n@required {creditAccountId: str # Credit account identification.}\n@returns(200) {data: [map], summary: map{total: num, count: int, totalPaid: int, totalCancelled: int}} # OK\n\n@endpoint POST /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/payments\n@desc Mark an invoice as paid\n@required {creditAccountId: str # Credit account identification., invoiceId: str # Invoice identification.}\n@returns(200) {id: str, friendlyId: str, status: str, value: num, accountId: str, creditValue: num, createdAt: str, updatedAt: str, originalDueDate: str, dueDate: str, installment: num, orderId: str, transactionId: str, numberOfInstallments: num, creditAccountId: str} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/invoices/{invoiceId}/postponement\n@desc Postpone an invoice\n@required {creditAccountId: str # Credit account identification., invoiceId: str # Invoice identification., dueDays: num # Number of days to postpone the invoice.}\n@returns(200) OK. This endpoint does not return any data in the response body.\n\n@endpoint GET /api/creditcontrol/accounts\n@desc Search all accounts\n@optional {from: str # Indicates the starting position of the credit customer account to be searched in the account list. Example, value `1` indicates that the first account in the list will be returned., to: str # Indicates the final position of the credit customer account to be searched in the account list. Example, if the value of `from` is equal to `1` and `to` is `40`, information from 40 accounts will be displayed in the response body of the request., status: str(Opened/Paid/Cancelled) # Indicates the status of the accounts to be searched for., email: str # Indicates the email registered to the account to be searched.}\n@returns(200) {data: [map], summary: map{count: int}} # OK\n\n@endpoint POST /api/creditcontrol/accounts\n@desc Open an account\n@required {document: str # Account owner document., documentType: str(CPF/CNPJ/Other) # Document type., email: str # Account owner email., creditLimit: str # Maximum credit amount on the account., description: str # This field is deprecated., tolerance: str # Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount.}\n@returns(200) {id: str, balance: num, document: str, status: str, documentType: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint GET /api/creditcontrol/accounts/{creditAccountId}\n@desc Retrieve an account by ID\n@required {creditAccountId: str # Credit account identification.}\n@returns(200) {id: str, balance: num, document: str, status: str, documentType: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint DELETE /api/creditcontrol/accounts/{creditAccountId}\n@desc Close an account\n@required {creditAccountId: str # Credit account identification.}\n@optional {document: str # Account owner document., documentType: str(CPF/CNPJ/Other) # Document type., email: str # Account owner email.}\n@returns(200) {id: str, balance: num, document: str, status: str, documentType: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}\n@desc Update account information\n@required {creditAccountId: str # Credit account identification., email: str # Account owner email., document: str # Account owner document., documentType: str(CPF/CNPJ/Other) # Document type.}\n@optional {creditLimit: num # Maximum credit amount on the account., tolerance: num # Account credit tolerance (in decimals). This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount.}\n@returns(200) {id: str, balance: num, document: str, status: str, documentType: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint GET /api/creditcontrol/accounts/{creditAccountId}/statements\n@desc Get account statements\n@required {creditAccountId: str # Credit account identification.}\n@returns(200) {statements: [map], currentBalance: num, intervalBalance: num, previousBalance: num} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/creditlimit\n@desc Change credit limit of an account\n@required {creditAccountId: str # Credit account identification., value: num # Credit limit value.}\n@returns(200) {id: str, balance: num, status: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/statements/{statementId}\n@desc Decrease balance of an account\n@required {creditAccountId: str # Credit account identification., statementId: str # Statement identification. This is the same `transactionId` value obtained from the [Account statements](https://developers.vtex.com/docs/api-reference/customer-credit-api#get-/api/creditcontrol/accounts/-creditAccountId-) endpoint response body., value: str # Value to be debited from the account balance.}\n@returns(200) {value: str} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}/settlement\n@desc Create or update settlement\n@required {creditAccountId: str # Credit account identification., transactionId: str # Pre-authorization identification., value: num # Value to be settled in the invoice.}\n@returns(200) {value: num, id: str} # OK\n\n@endpoint POST /api/creditcontrol/accounts/{creditAccountId}/transactions\n@desc Create a pre-authorization\n@required {creditAccountId: str # Credit account identification., value: num # Pre-Authorization value., settle: bool # Indicates whether pre-authorization should be available to be settled. This means that the `transactionId` created in this request can be used to be associated with an order within a maximum period of 30 days., installments: num # Number of installments.}\n@optional {expirationDate: str # Pre-Authorization expiration date. This field should only be sent if the `settle` field is sent as `false`.}\n@returns(200) {id: str, value: num, expirationDate: str, installments: num} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}\n@desc Update a pre-authorization\n@required {creditAccountId: str # Credit account identification., transactionId: str # Pre-authorization identification., value: num # Pre-Authorization value., settle: bool # Indicates whether pre-authorization should be available to be settled. This means that the `transactionId` can be used to be associated with an order within a maximum period of 30 days., installments: num # Number of installments.}\n@returns(200) {id: str, value: num, installments: num} # OK\n\n@endpoint DELETE /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}\n@desc Cancel a pre-authorization\n@required {creditAccountId: str # Credit account identification., transactionId: str # Pre-authorization identification.}\n@returns(200) OK. This endpoint does not return any data in the response body.\n\n@endpoint POST /api/creditcontrol/accounts/{creditAccountId}/holders\n@desc Add an account holder\n@required {creditAccountId: str # Credit account identification., claims: map{email!: str} # Holder information.}\n@returns(200) {level: num, claims: map{email: str}, id: str, createdAt: str} # OK\n\n@endpoint DELETE /api/creditcontrol/accounts/{creditAccountId}/holders/{holderId}\n@desc Delete an account holder\n@required {creditAccountId: str # Credit account identification., holderId: str # Holder identification.}\n@returns(200) {id: str} # OK\n\n@endpoint PUT /api/creditcontrol/accounts/{creditAccountId}/tolerance\n@desc Change tolerance of an account\n@required {creditAccountId: str # Credit account identification., value: num # This value represents the increase in credit on an account. For example, a value of `0.30` indicates that the account owner can use up to 30% above the account's original maximum credit amount.}\n@returns(200) {id: str, balance: num, status: str, creditLimit: num, updatedAt: str, createdAt: str, description: str, availableCredit: num, preAuthorizedCredit: num, email: str, tolerance: num, availableBalance: num} # OK\n\n@endpoint POST /api/creditcontrol/accounts/{creditAccountId}/transactions/{transactionId}/refunds\n@desc Partially or totally refund a settlement\n@required {creditAccountId: str # Credit account identification., transactionId: str # Pre-authorization identification., value: num # Refund amount. This number must always be less than or equal to the value of the captured transaction.}\n@returns(200) {value: num} # OK\n\n@endpoint GET /api/creditcontrol/storeconfig\n@desc Retrieve store configuration\n@returns(200) {dailyInterestRate: num, invoicePostponementLimit: num, taxRate: num, maxPostponementDays: num, defaultCreditValue: num, postponementEnabled: bool, automaticCheckingAccountCreationEnabled: bool, toleranceEnabled: bool, myCreditsEnabled: bool, maxPreAuthorizationGrowthRate: num, notificationsSettings: map{daysPrior: [map], daysAfter: [map]}} # OK\n\n@endpoint PUT /api/creditcontrol/storeconfig\n@desc Create or change store configuration\n@required {dailyInterestRate: num # Daily interest rate (percent 0.1 = 10%)., invoicePostponementLimit: num # Maximum number of postponements allowed., taxRate: num # Tax rate value (percent 0.1 = 10%)., maxPostponementDays: num # Maximum number of days of postponement., defaultCreditValue: num # Default credit amount., maxPreAuthorizationGrowthRate: num # Pre-authorization growth rate value (percent 0.1 = 10%)., myCreditsEnabled: bool # Show the [My Credits](https://help.vtex.com/en/tutorial/customer-credit-overview--1uIqTjWxIIIEW0COMg4uE0#my-credits) page on storefront., toleranceEnabled: bool # Allows orders to be placed even if they exceed X % of the account's credit limit., automaticCheckingAccountCreationEnabled: bool # Allows users who have not previously received credit to complete an order., postponementEnabled: bool # Postponement option activated.}\n@optional {notificationsSettings: map{daysPrior: [map], daysAfter: [map]} # Notification settings information.}\n@returns(200) {dailyInterestRate: num, invoicePostponementLimit: num, taxRate: num, maxPostponementDays: num, defaultCreditValue: num, postponementEnabled: bool, automaticCheckingAccountCreationEnabled: bool, toleranceEnabled: bool, myCreditsEnabled: bool, maxPreAuthorizationGrowthRate: num, notificationsSettings: map{daysPrior: [map], daysAfter: [map]}} # OK\n\n@end\n"}}