{"note":"OpenAPI conversion -- returning structured metadata","name":"vtex-local-customer-credit-api","description":"Customer Credit API","version":"1.0","base_url":"https://apiexamples.vtexcommercestable.com.br","endpoints":25,"raw":"@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"}