diff --git a/README.md b/README.md
index 38afd5a..d0a579b 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ npm install
## Initialize the API Client
-**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/client.md)
+**_Note:_** Documentation for the client can be found [here.](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/client.md)
The following parameters are configurable for the API Client:
@@ -81,7 +81,7 @@ The following parameters are configurable for the API Client:
| `timeout` | `number` | Timeout for API calls.
*Default*: `0` |
| `httpClientOptions` | `Partial` | Stable configurable http client options. |
| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. |
-| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/auth/basic-authentication.md) | The credential object for basicAuth |
+| `basicAuthCredentials` | [`BasicAuthCredentials`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/auth/basic-authentication.md) | The credential object for basicAuth |
### HttpClientOptions
@@ -121,7 +121,7 @@ const client = new Client({
This API uses the following authentication schemes.
-* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/auth/basic-authentication.md)
+* [`httpBasic (Basic Authentication)`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/auth/basic-authentication.md)
## API Errors
@@ -129,30 +129,30 @@ Here is the list of errors that the API might throw.
| HTTP Status Code | Error Description | Exception Class |
| --- | --- | --- |
-| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
-| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
-| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
-| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
-| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
-| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/models/custom-error.md) |
+| 400 | Invalid request | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
+| 401 | Invalid API key | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
+| 404 | An informed resource was not found | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
+| 412 | Business validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
+| 422 | Contract validation error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
+| 500 | Internal server error | [`CustomError`](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/models/custom-error.md) |
## List of APIs
-* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/subscriptions.md)
-* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/orders.md)
-* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/plans.md)
-* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/invoices.md)
-* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/customers.md)
-* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/charges.md)
-* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/recipients.md)
-* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/tokens.md)
-* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/transactions.md)
-* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/transfers.md)
-* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/payables.md)
-* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/controllers/balance-operations.md)
+* [Subscriptions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/subscriptions.md)
+* [Orders](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/orders.md)
+* [Plans](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/plans.md)
+* [Invoices](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/invoices.md)
+* [Customers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/customers.md)
+* [Charges](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/charges.md)
+* [Recipients](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/recipients.md)
+* [Tokens](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/tokens.md)
+* [Transactions](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/transactions.md)
+* [Transfers](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/transfers.md)
+* [Payables](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/payables.md)
+* [Balance Operations](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/controllers/balance-operations.md)
## Classes Documentation
-* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/api-response.md)
-* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.13/doc/api-error.md)
+* [ApiResponse](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/api-response.md)
+* [ApiError](https://www.github.com/pagarme/pagarme-nodejs-sdk/tree/6.8.14/doc/api-error.md)
diff --git a/doc/controllers/balance-operations.md b/doc/controllers/balance-operations.md
index 1cf12b7..b3d1a6f 100644
--- a/doc/controllers/balance-operations.md
+++ b/doc/controllers/balance-operations.md
@@ -10,39 +10,35 @@ const balanceOperationsController = new BalanceOperationsController(client);
## Methods
-* [Get Balance Operations](../../doc/controllers/balance-operations.md#get-balance-operations)
* [Get Balance Operation by Id](../../doc/controllers/balance-operations.md#get-balance-operation-by-id)
+* [Get Balance Operations](../../doc/controllers/balance-operations.md#get-balance-operations)
-# Get Balance Operations
+# Get Balance Operation by Id
```ts
-async getBalanceOperations( status?: string,
- createdSince?: string,
- createdUntil?: string,
- recipientId?: string,
-requestOptions?: RequestOptions): Promise>
+async getBalanceOperationById( id: bigint,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `status` | `string \| undefined` | Query, Optional | - |
-| `createdSince` | `string \| undefined` | Query, Optional | - |
-| `createdUntil` | `string \| undefined` | Query, Optional | - |
-| `recipientId` | `string \| undefined` | Query, Optional | - |
+| `id` | `bigint` | Template, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListBalanceOperationResponse`](../../doc/models/list-balance-operation-response.md)
+[`GetBalanceOperationResponse`](../../doc/models/get-balance-operation-response.md)
## Example Usage
```ts
+const id = BigInt(112);
+
try {
- const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperations();
+ const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperationById(id);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -54,31 +50,35 @@ try {
```
-# Get Balance Operation by Id
+# Get Balance Operations
```ts
-async getBalanceOperationById( id: bigint,
-requestOptions?: RequestOptions): Promise>
+async getBalanceOperations( status?: string,
+ createdSince?: string,
+ createdUntil?: string,
+ recipientId?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `id` | `bigint` | Template, Required | - |
+| `status` | `string \| undefined` | Query, Optional | - |
+| `createdSince` | `string \| undefined` | Query, Optional | - |
+| `createdUntil` | `string \| undefined` | Query, Optional | - |
+| `recipientId` | `string \| undefined` | Query, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetBalanceOperationResponse`](../../doc/models/get-balance-operation-response.md)
+[`ListBalanceOperationResponse`](../../doc/models/list-balance-operation-response.md)
## Example Usage
```ts
-const id = BigInt(112);
-
try {
- const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperationById(id);
+ const { result, ...httpResponse } = await balanceOperationsController.getBalanceOperations();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
diff --git a/doc/controllers/charges.md b/doc/controllers/charges.md
index dbffb4d..a77a6be 100644
--- a/doc/controllers/charges.md
+++ b/doc/controllers/charges.md
@@ -11,18 +11,18 @@ const chargesController = new ChargesController(client);
## Methods
* [Update Charge Metadata](../../doc/controllers/charges.md#update-charge-metadata)
-* [Update Charge Payment Method](../../doc/controllers/charges.md#update-charge-payment-method)
-* [Get Charge Transactions](../../doc/controllers/charges.md#get-charge-transactions)
-* [Update Charge Due Date](../../doc/controllers/charges.md#update-charge-due-date)
-* [Get Charges](../../doc/controllers/charges.md#get-charges)
* [Capture Charge](../../doc/controllers/charges.md#capture-charge)
-* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card)
* [Get Charge](../../doc/controllers/charges.md#get-charge)
+* [Confirm Payment](../../doc/controllers/charges.md#confirm-payment)
+* [Get Charge Transactions](../../doc/controllers/charges.md#get-charge-transactions)
+* [Update Charge Card](../../doc/controllers/charges.md#update-charge-card)
+* [Create Charge](../../doc/controllers/charges.md#create-charge)
+* [Update Charge Payment Method](../../doc/controllers/charges.md#update-charge-payment-method)
+* [Update Charge Due Date](../../doc/controllers/charges.md#update-charge-due-date)
* [Get Charges Summary](../../doc/controllers/charges.md#get-charges-summary)
* [Retry Charge](../../doc/controllers/charges.md#retry-charge)
+* [Get Charges](../../doc/controllers/charges.md#get-charges)
* [Cancel Charge](../../doc/controllers/charges.md#cancel-charge)
-* [Create Charge](../../doc/controllers/charges.md#create-charge)
-* [Confirm Payment](../../doc/controllers/charges.md#confirm-payment)
# Update Charge Metadata
@@ -76,13 +76,13 @@ try {
```
-# Update Charge Payment Method
+# Capture Charge
-Updates a charge's payment method
+Captures a charge
```ts
-async updateChargePaymentMethod( chargeId: string,
- request: UpdateChargePaymentMethodRequest,
+async captureCharge( chargeId: string,
+ request?: CreateCaptureChargeRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -92,7 +92,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `chargeId` | `string` | Template, Required | Charge id |
-| `request` | [`UpdateChargePaymentMethodRequest`](../../doc/models/update-charge-payment-method-request.md) | Body, Required | Request for updating the payment method from a charge |
+| `request` | [`CreateCaptureChargeRequest \| undefined`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -105,56 +105,8 @@ requestOptions?: RequestOptions): Promise>
```ts
const chargeId = 'charge_id8';
-const request: UpdateChargePaymentMethodRequest = {
- updateSubscription: false,
- paymentMethod: 'payment_method4',
- creditCard: {
- installments: 1,
- capture: true,
- recurrencyCycle: '"first" or "subsequent"',
- },
- debitCard: {},
- boleto: {
- retries: 226,
- instructions: 'instructions2',
- billingAddress: {
- street: 'street8',
- number: 'number4',
- zipCode: 'zip_code2',
- neighborhood: 'neighborhood4',
- city: 'city2',
- state: 'state6',
- country: 'country2',
- complement: 'complement6',
- line1: 'line_18',
- line2: 'line_26',
- },
- documentNumber: 'document_number6',
- statementDescriptor: 'statement_descriptor0',
- },
- voucher: {
- recurrencyCycle: '"first" or "subsequent"',
- },
- cash: {
- description: 'description0',
- confirm: false,
- },
- bankTransfer: {
- bank: 'bank0',
- retries: 236,
- },
- privateLabel: {
- installments: 1,
- capture: true,
- recurrencyCycle: '"first" or "subsequent"',
- },
-};
-
try {
- const { result, ...httpResponse } = await chargesController.updateChargePaymentMethod(
- chargeId,
- request
-);
+ const { result, ...httpResponse } = await chargesController.captureCharge(chargeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -166,27 +118,25 @@ try {
```
-# Get Charge Transactions
+# Get Charge
+
+Get a charge from its id
```ts
-async getChargeTransactions( chargeId: string,
- page?: number,
- size?: number,
-requestOptions?: RequestOptions): Promise>
+async getCharge( chargeId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `chargeId` | `string` | Template, Required | Charge Id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
+| `chargeId` | `string` | Template, Required | Charge id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListChargeTransactionsResponse`](../../doc/models/list-charge-transactions-response.md)
+[`GetChargeResponse`](../../doc/models/get-charge-response.md)
## Example Usage
@@ -194,7 +144,7 @@ requestOptions?: RequestOptions): Promise>
```
@@ -221,8 +169,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `chargeId` | `string` | Template, Required | Charge Id |
-| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date |
+| `chargeId` | `string` | Template, Required | - |
+| `request` | [`CreateConfirmPaymentRequest \| undefined`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -235,13 +183,8 @@ requestOptions?: RequestOptions): Promise>
```ts
const chargeId = 'charge_id8';
-const request: UpdateChargeDueDateRequest = {};
-
try {
- const { result, ...httpResponse } = await chargesController.updateChargeDueDate(
- chargeId,
- request
-);
+ const { result, ...httpResponse } = await chargesController.confirmPayment(chargeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -253,47 +196,35 @@ try {
```
-# Get Charges
-
-Lists all charges
+# Get Charge Transactions
```ts
-async getCharges( page?: number,
+async getChargeTransactions( chargeId: string,
+ page?: number,
size?: number,
- code?: string,
- status?: string,
- paymentMethod?: string,
- customerId?: string,
- orderId?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
+| `chargeId` | `string` | Template, Required | Charge Id |
| `page` | `number \| undefined` | Query, Optional | Page number |
| `size` | `number \| undefined` | Query, Optional | Page size |
-| `code` | `string \| undefined` | Query, Optional | Filter for charge's code |
-| `status` | `string \| undefined` | Query, Optional | Filter for charge's status |
-| `paymentMethod` | `string \| undefined` | Query, Optional | Filter for charge's payment method |
-| `customerId` | `string \| undefined` | Query, Optional | Filter for charge's customer id |
-| `orderId` | `string \| undefined` | Query, Optional | Filter for charge's order id |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for the beginning of the range for charge's creation |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for the end of the range for charge's creation |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListChargesResponse`](../../doc/models/list-charges-response.md)
+[`ListChargeTransactionsResponse`](../../doc/models/list-charge-transactions-response.md)
## Example Usage
```ts
+const chargeId = 'charge_id8';
+
try {
- const { result, ...httpResponse } = await chargesController.getCharges();
+ const { result, ...httpResponse } = await chargesController.getChargeTransactions(chargeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -305,13 +236,13 @@ try {
```
-# Capture Charge
+# Update Charge Card
-Captures a charge
+Updates the card from a charge
```ts
-async captureCharge( chargeId: string,
- request?: CreateCaptureChargeRequest,
+async updateChargeCard( chargeId: string,
+ request: UpdateChargeCardRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -321,7 +252,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `chargeId` | `string` | Template, Required | Charge id |
-| `request` | [`CreateCaptureChargeRequest \| undefined`](../../doc/models/create-capture-charge-request.md) | Body, Optional | Request for capturing a charge |
+| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -334,8 +265,20 @@ requestOptions?: RequestOptions): Promise>
```ts
const chargeId = 'charge_id8';
+const request: UpdateChargeCardRequest = {
+ updateSubscription: false,
+ cardId: 'card_id2',
+ card: {
+ type: 'credit',
+ },
+ recurrence: false,
+};
+
try {
- const { result, ...httpResponse } = await chargesController.captureCharge(chargeId);
+ const { result, ...httpResponse } = await chargesController.updateChargeCard(
+ chargeId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -347,13 +290,12 @@ try {
```
-# Update Charge Card
+# Create Charge
-Updates the card from a charge
+Creates a new charge
```ts
-async updateChargeCard( chargeId: string,
- request: UpdateChargeCardRequest,
+async createCharge( request: CreateChargeRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -362,8 +304,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `chargeId` | `string` | Template, Required | Charge id |
-| `request` | [`UpdateChargeCardRequest`](../../doc/models/update-charge-card-request.md) | Body, Required | Request for updating a charge's card |
+| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -374,22 +315,16 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const chargeId = 'charge_id8';
-
-const request: UpdateChargeCardRequest = {
- updateSubscription: false,
- cardId: 'card_id2',
- card: {
- type: 'credit',
+const request: CreateChargeRequest = {
+ amount: 242,
+ payment: {
+ paymentMethod: 'payment_method4',
},
- recurrence: false,
+ orderId: 'order_id0',
};
try {
- const { result, ...httpResponse } = await chargesController.updateChargeCard(
- chargeId,
- request
-);
+ const { result, ...httpResponse } = await chargesController.createCharge(request);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -401,12 +336,14 @@ try {
```
-# Get Charge
+# Update Charge Payment Method
-Get a charge from its id
+Updates a charge's payment method
```ts
-async getCharge( chargeId: string,
+async updateChargePaymentMethod( chargeId: string,
+ request: UpdateChargePaymentMethodRequest,
+ idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -415,6 +352,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `chargeId` | `string` | Template, Required | Charge id |
+| `request` | [`UpdateChargePaymentMethodRequest`](../../doc/models/update-charge-payment-method-request.md) | Body, Required | Request for updating the payment method from a charge |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -426,8 +365,56 @@ requestOptions?: RequestOptions): Promise>
```ts
const chargeId = 'charge_id8';
+const request: UpdateChargePaymentMethodRequest = {
+ updateSubscription: false,
+ paymentMethod: 'payment_method4',
+ creditCard: {
+ installments: 1,
+ capture: true,
+ recurrencyCycle: '"first" or "subsequent"',
+ },
+ debitCard: {},
+ boleto: {
+ retries: 226,
+ instructions: 'instructions2',
+ billingAddress: {
+ street: 'street8',
+ number: 'number4',
+ zipCode: 'zip_code2',
+ neighborhood: 'neighborhood4',
+ city: 'city2',
+ state: 'state6',
+ country: 'country2',
+ complement: 'complement6',
+ line1: 'line_18',
+ line2: 'line_26',
+ },
+ documentNumber: 'document_number6',
+ statementDescriptor: 'statement_descriptor0',
+ },
+ voucher: {
+ recurrencyCycle: '"first" or "subsequent"',
+ },
+ cash: {
+ description: 'description0',
+ confirm: false,
+ },
+ bankTransfer: {
+ bank: 'bank0',
+ retries: 236,
+ },
+ privateLabel: {
+ installments: 1,
+ capture: true,
+ recurrencyCycle: '"first" or "subsequent"',
+ },
+};
+
try {
- const { result, ...httpResponse } = await chargesController.getCharge(chargeId);
+ const { result, ...httpResponse } = await chargesController.updateChargePaymentMethod(
+ chargeId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -439,35 +426,42 @@ try {
```
-# Get Charges Summary
+# Update Charge Due Date
+
+Updates the due date from a charge
```ts
-async getChargesSummary( status: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async updateChargeDueDate( chargeId: string,
+ request: UpdateChargeDueDateRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `status` | `string` | Query, Required | - |
-| `createdSince` | `string \| undefined` | Query, Optional | - |
-| `createdUntil` | `string \| undefined` | Query, Optional | - |
+| `chargeId` | `string` | Template, Required | Charge Id |
+| `request` | [`UpdateChargeDueDateRequest`](../../doc/models/update-charge-due-date-request.md) | Body, Required | Request for updating the due date |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetChargesSummaryResponse`](../../doc/models/get-charges-summary-response.md)
+[`GetChargeResponse`](../../doc/models/get-charge-response.md)
## Example Usage
```ts
-const status = 'status8';
+const chargeId = 'charge_id8';
+
+const request: UpdateChargeDueDateRequest = {};
try {
- const { result, ...httpResponse } = await chargesController.getChargesSummary(status);
+ const { result, ...httpResponse } = await chargesController.updateChargeDueDate(
+ chargeId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -479,35 +473,35 @@ try {
```
-# Retry Charge
-
-Retries a charge
+# Get Charges Summary
```ts
-async retryCharge( chargeId: string,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getChargesSummary( status: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `chargeId` | `string` | Template, Required | Charge id |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `status` | `string` | Query, Required | - |
+| `createdSince` | `string \| undefined` | Query, Optional | - |
+| `createdUntil` | `string \| undefined` | Query, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetChargeResponse`](../../doc/models/get-charge-response.md)
+[`GetChargesSummaryResponse`](../../doc/models/get-charges-summary-response.md)
## Example Usage
```ts
-const chargeId = 'charge_id8';
+const status = 'status8';
try {
- const { result, ...httpResponse } = await chargesController.retryCharge(chargeId);
+ const { result, ...httpResponse } = await chargesController.getChargesSummary(status);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -519,13 +513,12 @@ try {
```
-# Cancel Charge
+# Retry Charge
-Cancel a charge
+Retries a charge
```ts
-async cancelCharge( chargeId: string,
- request?: CreateCancelChargeRequest,
+async retryCharge( chargeId: string,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -535,7 +528,6 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `chargeId` | `string` | Template, Required | Charge id |
-| `request` | [`CreateCancelChargeRequest \| undefined`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -549,7 +541,7 @@ requestOptions?: RequestOptions): Promise>
const chargeId = 'charge_id8';
try {
- const { result, ...httpResponse } = await chargesController.cancelCharge(chargeId);
+ const { result, ...httpResponse } = await chargesController.retryCharge(chargeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -561,41 +553,47 @@ try {
```
-# Create Charge
+# Get Charges
-Creates a new charge
+Lists all charges
```ts
-async createCharge( request: CreateChargeRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getCharges( page?: number,
+ size?: number,
+ code?: string,
+ status?: string,
+ paymentMethod?: string,
+ customerId?: string,
+ orderId?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `request` | [`CreateChargeRequest`](../../doc/models/create-charge-request.md) | Body, Required | Request for creating a charge |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `code` | `string \| undefined` | Query, Optional | Filter for charge's code |
+| `status` | `string \| undefined` | Query, Optional | Filter for charge's status |
+| `paymentMethod` | `string \| undefined` | Query, Optional | Filter for charge's payment method |
+| `customerId` | `string \| undefined` | Query, Optional | Filter for charge's customer id |
+| `orderId` | `string \| undefined` | Query, Optional | Filter for charge's order id |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for the beginning of the range for charge's creation |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for the end of the range for charge's creation |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetChargeResponse`](../../doc/models/get-charge-response.md)
+[`ListChargesResponse`](../../doc/models/list-charges-response.md)
## Example Usage
```ts
-const request: CreateChargeRequest = {
- amount: 242,
- payment: {
- paymentMethod: 'payment_method4',
- },
- orderId: 'order_id0',
-};
-
try {
- const { result, ...httpResponse } = await chargesController.createCharge(request);
+ const { result, ...httpResponse } = await chargesController.getCharges();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -607,11 +605,13 @@ try {
```
-# Confirm Payment
+# Cancel Charge
+
+Cancel a charge
```ts
-async confirmPayment( chargeId: string,
- request?: CreateConfirmPaymentRequest,
+async cancelCharge( chargeId: string,
+ request?: CreateCancelChargeRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -620,8 +620,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `chargeId` | `string` | Template, Required | - |
-| `request` | [`CreateConfirmPaymentRequest \| undefined`](../../doc/models/create-confirm-payment-request.md) | Body, Optional | Request for confirm payment |
+| `chargeId` | `string` | Template, Required | Charge id |
+| `request` | [`CreateCancelChargeRequest \| undefined`](../../doc/models/create-cancel-charge-request.md) | Body, Optional | Request for cancelling a charge |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -635,7 +635,7 @@ requestOptions?: RequestOptions): Promise>
const chargeId = 'charge_id8';
try {
- const { result, ...httpResponse } = await chargesController.confirmPayment(chargeId);
+ const { result, ...httpResponse } = await chargesController.cancelCharge(chargeId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
diff --git a/doc/controllers/customers.md b/doc/controllers/customers.md
index e1bbb14..0e21510 100644
--- a/doc/controllers/customers.md
+++ b/doc/controllers/customers.md
@@ -10,39 +10,38 @@ const customersController = new CustomersController(client);
## Methods
+* [Create Address](../../doc/controllers/customers.md#create-address)
* [Update Card](../../doc/controllers/customers.md#update-card)
-* [Update Address](../../doc/controllers/customers.md#update-address)
* [Delete Access Token](../../doc/controllers/customers.md#delete-access-token)
* [Create Customer](../../doc/controllers/customers.md#create-customer)
-* [Create Address](../../doc/controllers/customers.md#create-address)
* [Delete Access Tokens](../../doc/controllers/customers.md#delete-access-tokens)
+* [Update Address](../../doc/controllers/customers.md#update-address)
* [Get Address](../../doc/controllers/customers.md#get-address)
* [Delete Address](../../doc/controllers/customers.md#delete-address)
-* [Create Card](../../doc/controllers/customers.md#create-card)
* [Get Customers](../../doc/controllers/customers.md#get-customers)
+* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens)
+* [Delete Card](../../doc/controllers/customers.md#delete-card)
+* [Get Card](../../doc/controllers/customers.md#get-card)
+* [Create Card](../../doc/controllers/customers.md#create-card)
+* [Get Access Token](../../doc/controllers/customers.md#get-access-token)
+* [Get Addresses](../../doc/controllers/customers.md#get-addresses)
* [Update Customer](../../doc/controllers/customers.md#update-customer)
* [Create Access Token](../../doc/controllers/customers.md#create-access-token)
-* [Get Access Tokens](../../doc/controllers/customers.md#get-access-tokens)
* [Get Cards](../../doc/controllers/customers.md#get-cards)
* [Renew Card](../../doc/controllers/customers.md#renew-card)
-* [Get Access Token](../../doc/controllers/customers.md#get-access-token)
* [Update Customer Metadata](../../doc/controllers/customers.md#update-customer-metadata)
-* [Delete Card](../../doc/controllers/customers.md#delete-card)
-* [Get Addresses](../../doc/controllers/customers.md#get-addresses)
* [Get Customer](../../doc/controllers/customers.md#get-customer)
-* [Get Card](../../doc/controllers/customers.md#get-card)
-# Update Card
+# Create Address
-Updates a card
+Creates a new address for a customer
```ts
-async updateCard( customerId: string,
- cardId: string,
- request: UpdateCardRequest,
+async createAddress( customerId: string,
+ request: CreateAddressRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -50,48 +49,35 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
-| `cardId` | `string` | Template, Required | Card id |
-| `request` | [`UpdateCardRequest`](../../doc/models/update-card-request.md) | Body, Required | Request for updating a card |
+| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCardResponse`](../../doc/models/get-card-response.md)
+[`GetAddressResponse`](../../doc/models/get-address-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const cardId = 'card_id4';
-
-const request: UpdateCardRequest = {
- holderName: 'holder_name2',
- expMonth: 10,
- expYear: 30,
- billingAddress: {
- street: 'street8',
- number: 'number4',
- zipCode: 'zip_code2',
- neighborhood: 'neighborhood4',
- city: 'city2',
- state: 'state6',
- country: 'country2',
- complement: 'complement6',
- line1: 'line_18',
- line2: 'line_26',
- },
- metadata: {
- 'key0': 'metadata3'
- },
- label: 'label6',
+const request: CreateAddressRequest = {
+ street: 'street6',
+ number: 'number4',
+ zipCode: 'zip_code0',
+ neighborhood: 'neighborhood2',
+ city: 'city6',
+ state: 'state2',
+ country: 'country0',
+ complement: 'complement2',
+ line1: 'line_10',
+ line2: 'line_24',
};
try {
- const { result, ...httpResponse } = await customersController.updateCard(
+ const { result, ...httpResponse } = await customersController.createAddress(
customerId,
- cardId,
request
);
// Get more response info...
@@ -105,16 +91,16 @@ try {
```
-# Update Address
+# Update Card
-Updates an address
+Updates a card
```ts
-async updateAddress( customerId: string,
- addressId: string,
- request: UpdateAddressRequest,
+async updateCard( customerId: string,
+ cardId: string,
+ request: UpdateCardRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -122,35 +108,48 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
-| `addressId` | `string` | Template, Required | Address Id |
-| `request` | [`UpdateAddressRequest`](../../doc/models/update-address-request.md) | Body, Required | Request for updating an address |
+| `cardId` | `string` | Template, Required | Card id |
+| `request` | [`UpdateCardRequest`](../../doc/models/update-card-request.md) | Body, Required | Request for updating a card |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAddressResponse`](../../doc/models/get-address-response.md)
+[`GetCardResponse`](../../doc/models/get-card-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const addressId = 'address_id0';
+const cardId = 'card_id4';
-const request: UpdateAddressRequest = {
- number: 'number4',
- complement: 'complement2',
+const request: UpdateCardRequest = {
+ holderName: 'holder_name2',
+ expMonth: 10,
+ expYear: 30,
+ billingAddress: {
+ street: 'street8',
+ number: 'number4',
+ zipCode: 'zip_code2',
+ neighborhood: 'neighborhood4',
+ city: 'city2',
+ state: 'state6',
+ country: 'country2',
+ complement: 'complement6',
+ line1: 'line_18',
+ line2: 'line_26',
+ },
metadata: {
'key0': 'metadata3'
},
- line2: 'line_24',
+ label: 'label6',
};
try {
- const { result, ...httpResponse } = await customersController.updateAddress(
+ const { result, ...httpResponse } = await customersController.updateCard(
customerId,
- addressId,
+ cardId,
request
);
// Get more response info...
@@ -273,15 +272,13 @@ try {
```
-# Create Address
+# Delete Access Tokens
-Creates a new address for a customer
+Delete a Customer's access tokens
```ts
-async createAddress( customerId: string,
- request: CreateAddressRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async deleteAccessTokens( customerId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -289,37 +286,19 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
-| `request` | [`CreateAddressRequest`](../../doc/models/create-address-request.md) | Body, Required | Request for creating an address |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAddressResponse`](../../doc/models/get-address-response.md)
+[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const request: CreateAddressRequest = {
- street: 'street6',
- number: 'number4',
- zipCode: 'zip_code0',
- neighborhood: 'neighborhood2',
- city: 'city6',
- state: 'state2',
- country: 'country0',
- complement: 'complement2',
- line1: 'line_10',
- line2: 'line_24',
-};
-
try {
- const { result, ...httpResponse } = await customersController.createAddress(
- customerId,
- request
-);
+ const { result, ...httpResponse } = await customersController.deleteAccessTokens(customerId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -331,13 +310,16 @@ try {
```
-# Delete Access Tokens
+# Update Address
-Delete a Customer's access tokens
+Updates an address
```ts
-async deleteAccessTokens( customerId: string,
-requestOptions?: RequestOptions): Promise>
+async updateAddress( customerId: string,
+ addressId: string,
+ request: UpdateAddressRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -345,19 +327,37 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
+| `addressId` | `string` | Template, Required | Address Id |
+| `request` | [`UpdateAddressRequest`](../../doc/models/update-address-request.md) | Body, Required | Request for updating an address |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md)
+[`GetAddressResponse`](../../doc/models/get-address-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
+const addressId = 'address_id0';
+
+const request: UpdateAddressRequest = {
+ number: 'number4',
+ complement: 'complement2',
+ metadata: {
+ 'key0': 'metadata3'
+ },
+ line2: 'line_24',
+};
+
try {
- const { result, ...httpResponse } = await customersController.deleteAccessTokens(customerId);
+ const { result, ...httpResponse } = await customersController.updateAddress(
+ customerId,
+ addressId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -461,55 +461,6 @@ try {
```
-# Create Card
-
-Creates a new card for a customer
-
-```ts
-async createCard( customerId: string,
- request: CreateCardRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer id |
-| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
-| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
-
-## Response Type
-
-[`GetCardResponse`](../../doc/models/get-card-response.md)
-
-## Example Usage
-
-```ts
-const customerId = 'customer_id8';
-
-const request: CreateCardRequest = {
- type: 'credit',
-};
-
-try {
- const { result, ...httpResponse } = await customersController.createCard(
- customerId,
- request
-);
- // Get more response info...
- // const { statusCode, headers } = httpResponse;
-} catch (error) {
- if (error instanceof ApiError) {
- const errors = error.result;
- // const { statusCode, headers } = error;
- }
-}
-```
-
-
# Get Customers
Get all Customers
@@ -565,42 +516,37 @@ try {
```
-# Update Customer
+# Get Access Tokens
-Updates a customer
+Get all access tokens from a customer
```ts
-async updateCustomer( customerId: string,
- request: UpdateCustomerRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getAccessTokens( customerId: string,
+ page?: number,
+ size?: number,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer id |
-| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `customerId` | `string` | Template, Required | Customer Id |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCustomerResponse`](../../doc/models/get-customer-response.md)
+[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const request: UpdateCustomerRequest = {};
-
try {
- const { result, ...httpResponse } = await customersController.updateCustomer(
- customerId,
- request
-);
+ const { result, ...httpResponse } = await customersController.getAccessTokens(customerId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -612,15 +558,15 @@ try {
```
-# Create Access Token
+# Delete Card
-Creates a access token for a customer
+Delete a customer's card
```ts
-async createAccessToken( customerId: string,
- request: CreateAccessTokenRequest,
+async deleteCard( customerId: string,
+ cardId: string,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -628,25 +574,25 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
-| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token |
+| `cardId` | `string` | Template, Required | Card Id |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md)
+[`GetCardResponse`](../../doc/models/get-card-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const request: CreateAccessTokenRequest = {};
+const cardId = 'card_id4';
try {
- const { result, ...httpResponse } = await customersController.createAccessToken(
+ const { result, ...httpResponse } = await customersController.deleteCard(
customerId,
- request
+ cardId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -659,37 +605,40 @@ try {
```
-# Get Access Tokens
+# Get Card
-Get all access tokens from a customer
+Get a customer's card
```ts
-async getAccessTokens( customerId: string,
- page?: number,
- size?: number,
-requestOptions?: RequestOptions): Promise>
+async getCard( customerId: string,
+ cardId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer Id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
+| `customerId` | `string` | Template, Required | Customer id |
+| `cardId` | `string` | Template, Required | Card id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListAccessTokensResponse`](../../doc/models/list-access-tokens-response.md)
+[`GetCardResponse`](../../doc/models/get-card-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
+const cardId = 'card_id4';
+
try {
- const { result, ...httpResponse } = await customersController.getAccessTokens(customerId);
+ const { result, ...httpResponse } = await customersController.getCard(
+ customerId,
+ cardId
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -701,37 +650,44 @@ try {
```
-# Get Cards
+# Create Card
-Get all cards from a customer
+Creates a new card for a customer
```ts
-async getCards( customerId: string,
- page?: number,
- size?: number,
-requestOptions?: RequestOptions): Promise>
+async createCard( customerId: string,
+ request: CreateCardRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer Id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
+| `customerId` | `string` | Template, Required | Customer id |
+| `request` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | Request for creating a card |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListCardsResponse`](../../doc/models/list-cards-response.md)
+[`GetCardResponse`](../../doc/models/get-card-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
+const request: CreateCardRequest = {
+ type: 'credit',
+};
+
try {
- const { result, ...httpResponse } = await customersController.getCards(customerId);
+ const { result, ...httpResponse } = await customersController.createCard(
+ customerId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -743,41 +699,39 @@ try {
```
-# Renew Card
+# Get Access Token
-Renew a card
+Get a Customer's access token
```ts
-async renewCard( customerId: string,
- cardId: string,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getAccessToken( customerId: string,
+ tokenId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer id |
-| `cardId` | `string` | Template, Required | Card Id |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `customerId` | `string` | Template, Required | Customer Id |
+| `tokenId` | `string` | Template, Required | Token Id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCardResponse`](../../doc/models/get-card-response.md)
+[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const cardId = 'card_id4';
+const tokenId = 'token_id6';
try {
- const { result, ...httpResponse } = await customersController.renewCard(
+ const { result, ...httpResponse } = await customersController.getAccessToken(
customerId,
- cardId
+ tokenId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -790,40 +744,37 @@ try {
```
-# Get Access Token
+# Get Addresses
-Get a Customer's access token
+Gets all adressess from a customer
```ts
-async getAccessToken( customerId: string,
- tokenId: string,
-requestOptions?: RequestOptions): Promise>
+async getAddresses( customerId: string,
+ page?: number,
+ size?: number,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer Id |
-| `tokenId` | `string` | Template, Required | Token Id |
+| `customerId` | `string` | Template, Required | Customer id |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md)
+[`ListAddressesResponse`](../../doc/models/list-addresses-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const tokenId = 'token_id6';
-
try {
- const { result, ...httpResponse } = await customersController.getAccessToken(
- customerId,
- tokenId
-);
+ const { result, ...httpResponse } = await customersController.getAddresses(customerId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -835,13 +786,13 @@ try {
```
-# Update Customer Metadata
+# Update Customer
-Updates the metadata a customer
+Updates a customer
```ts
-async updateCustomerMetadata( customerId: string,
- request: UpdateMetadataRequest,
+async updateCustomer( customerId: string,
+ request: UpdateCustomerRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -850,8 +801,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | The customer id |
-| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata |
+| `customerId` | `string` | Template, Required | Customer id |
+| `request` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | Request for updating a customer |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -864,14 +815,10 @@ requestOptions?: RequestOptions): Promise>
```ts
const customerId = 'customer_id8';
-const request: UpdateMetadataRequest = {
- metadata: {
- 'key0': 'metadata3'
- },
-};
+const request: UpdateCustomerRequest = {};
try {
- const { result, ...httpResponse } = await customersController.updateCustomerMetadata(
+ const { result, ...httpResponse } = await customersController.updateCustomer(
customerId,
request
);
@@ -886,15 +833,15 @@ try {
```
-# Delete Card
+# Create Access Token
-Delete a customer's card
+Creates a access token for a customer
```ts
-async deleteCard( customerId: string,
- cardId: string,
+async createAccessToken( customerId: string,
+ request: CreateAccessTokenRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -902,25 +849,25 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `customerId` | `string` | Template, Required | Customer Id |
-| `cardId` | `string` | Template, Required | Card Id |
+| `request` | [`CreateAccessTokenRequest`](../../doc/models/create-access-token-request.md) | Body, Required | Request for creating a access token |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCardResponse`](../../doc/models/get-card-response.md)
+[`GetAccessTokenResponse`](../../doc/models/get-access-token-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const cardId = 'card_id4';
+const request: CreateAccessTokenRequest = {};
try {
- const { result, ...httpResponse } = await customersController.deleteCard(
+ const { result, ...httpResponse } = await customersController.createAccessToken(
customerId,
- cardId
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -933,29 +880,29 @@ try {
```
-# Get Addresses
+# Get Cards
-Gets all adressess from a customer
+Get all cards from a customer
```ts
-async getAddresses( customerId: string,
+async getCards( customerId: string,
page?: number,
size?: number,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer id |
+| `customerId` | `string` | Template, Required | Customer Id |
| `page` | `number \| undefined` | Query, Optional | Page number |
| `size` | `number \| undefined` | Query, Optional | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListAddressesResponse`](../../doc/models/list-addresses-response.md)
+[`ListCardsResponse`](../../doc/models/list-cards-response.md)
## Example Usage
@@ -963,7 +910,7 @@ requestOptions?: RequestOptions): Promise>
const customerId = 'customer_id8';
try {
- const { result, ...httpResponse } = await customersController.getAddresses(customerId);
+ const { result, ...httpResponse } = await customersController.getCards(customerId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -975,33 +922,42 @@ try {
```
-# Get Customer
+# Renew Card
-Get a customer
+Renew a card
```ts
-async getCustomer( customerId: string,
-requestOptions?: RequestOptions): Promise>
+async renewCard( customerId: string,
+ cardId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer Id |
+| `customerId` | `string` | Template, Required | Customer id |
+| `cardId` | `string` | Template, Required | Card Id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCustomerResponse`](../../doc/models/get-customer-response.md)
+[`GetCardResponse`](../../doc/models/get-card-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
+const cardId = 'card_id4';
+
try {
- const { result, ...httpResponse } = await customersController.getCustomer(customerId);
+ const { result, ...httpResponse } = await customersController.renewCard(
+ customerId,
+ cardId
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1013,39 +969,45 @@ try {
```
-# Get Card
+# Update Customer Metadata
-Get a customer's card
+Updates the metadata a customer
```ts
-async getCard( customerId: string,
- cardId: string,
-requestOptions?: RequestOptions): Promise>
+async updateCustomerMetadata( customerId: string,
+ request: UpdateMetadataRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `customerId` | `string` | Template, Required | Customer id |
-| `cardId` | `string` | Template, Required | Card id |
+| `customerId` | `string` | Template, Required | The customer id |
+| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the customer metadata |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetCardResponse`](../../doc/models/get-card-response.md)
+[`GetCustomerResponse`](../../doc/models/get-customer-response.md)
## Example Usage
```ts
const customerId = 'customer_id8';
-const cardId = 'card_id4';
+const request: UpdateMetadataRequest = {
+ metadata: {
+ 'key0': 'metadata3'
+ },
+};
try {
- const { result, ...httpResponse } = await customersController.getCard(
+ const { result, ...httpResponse } = await customersController.updateCustomerMetadata(
customerId,
- cardId
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1057,3 +1019,41 @@ try {
}
```
+
+# Get Customer
+
+Get a customer
+
+```ts
+async getCustomer( customerId: string,
+requestOptions?: RequestOptions): Promise>
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `customerId` | `string` | Template, Required | Customer Id |
+| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
+
+## Response Type
+
+[`GetCustomerResponse`](../../doc/models/get-customer-response.md)
+
+## Example Usage
+
+```ts
+const customerId = 'customer_id8';
+
+try {
+ const { result, ...httpResponse } = await customersController.getCustomer(customerId);
+ // Get more response info...
+ // const { statusCode, headers } = httpResponse;
+} catch (error) {
+ if (error instanceof ApiError) {
+ const errors = error.result;
+ // const { statusCode, headers } = error;
+ }
+}
+```
+
diff --git a/doc/controllers/invoices.md b/doc/controllers/invoices.md
index 37339a5..f5b875f 100644
--- a/doc/controllers/invoices.md
+++ b/doc/controllers/invoices.md
@@ -10,55 +10,60 @@ const invoicesController = new InvoicesController(client);
## Methods
+* [Get Invoices](../../doc/controllers/invoices.md#get-invoices)
+* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice)
+* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status)
* [Update Invoice Metadata](../../doc/controllers/invoices.md#update-invoice-metadata)
* [Get Partial Invoice](../../doc/controllers/invoices.md#get-partial-invoice)
-* [Cancel Invoice](../../doc/controllers/invoices.md#cancel-invoice)
* [Create Invoice](../../doc/controllers/invoices.md#create-invoice)
-* [Get Invoices](../../doc/controllers/invoices.md#get-invoices)
* [Get Invoice](../../doc/controllers/invoices.md#get-invoice)
-* [Update Invoice Status](../../doc/controllers/invoices.md#update-invoice-status)
-# Update Invoice Metadata
+# Get Invoices
-Updates the metadata from an invoice
+Gets all invoices
```ts
-async updateInvoiceMetadata( invoiceId: string,
- request: UpdateMetadataRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getInvoices( page?: number,
+ size?: number,
+ code?: string,
+ customerId?: string,
+ subscriptionId?: string,
+ createdSince?: string,
+ createdUntil?: string,
+ status?: string,
+ dueSince?: string,
+ dueUntil?: string,
+ customerDocument?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `invoiceId` | `string` | Template, Required | The invoice id |
-| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `code` | `string \| undefined` | Query, Optional | Filter for Invoice's code |
+| `customerId` | `string \| undefined` | Query, Optional | Filter for Invoice's customer id |
+| `subscriptionId` | `string \| undefined` | Query, Optional | Filter for Invoice's subscription id |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for Invoice's creation date start range |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for Invoices creation date end range |
+| `status` | `string \| undefined` | Query, Optional | Filter for Invoice's status |
+| `dueSince` | `string \| undefined` | Query, Optional | Filter for Invoice's due date start range |
+| `dueUntil` | `string \| undefined` | Query, Optional | Filter for Invoice's due date end range |
+| `customerDocument` | `string \| undefined` | Query, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetInvoiceResponse`](../../doc/models/get-invoice-response.md)
+[`ListInvoicesResponse`](../../doc/models/list-invoices-response.md)
## Example Usage
```ts
-const invoiceId = 'invoice_id0';
-
-const request: UpdateMetadataRequest = {
- metadata: {
- 'key0': 'metadata3'
- },
-};
-
try {
- const { result, ...httpResponse } = await invoicesController.updateInvoiceMetadata(
- invoiceId,
- request
-);
+ const { result, ...httpResponse } = await invoicesController.getInvoices();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -70,10 +75,13 @@ try {
```
-# Get Partial Invoice
+# Cancel Invoice
+
+Cancels an invoice
```ts
-async getPartialInvoice( subscriptionId: string,
+async cancelInvoice( invoiceId: string,
+ idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -81,7 +89,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `invoiceId` | `string` | Template, Required | Invoice id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -91,10 +100,10 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const subscriptionId = 'subscription_id0';
+const invoiceId = 'invoice_id0';
try {
- const { result, ...httpResponse } = await invoicesController.getPartialInvoice(subscriptionId);
+ const { result, ...httpResponse } = await invoicesController.cancelInvoice(invoiceId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -106,12 +115,13 @@ try {
```
-# Cancel Invoice
+# Update Invoice Status
-Cancels an invoice
+Updates the status from an invoice
```ts
-async cancelInvoice( invoiceId: string,
+async updateInvoiceStatus( invoiceId: string,
+ request: UpdateInvoiceStatusRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -120,7 +130,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `invoiceId` | `string` | Template, Required | Invoice id |
+| `invoiceId` | `string` | Template, Required | Invoice Id |
+| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -133,8 +144,15 @@ requestOptions?: RequestOptions): Promise>
```ts
const invoiceId = 'invoice_id0';
+const request: UpdateInvoiceStatusRequest = {
+ status: 'status8',
+};
+
try {
- const { result, ...httpResponse } = await invoicesController.cancelInvoice(invoiceId);
+ const { result, ...httpResponse } = await invoicesController.updateInvoiceStatus(
+ invoiceId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -146,14 +164,13 @@ try {
```
-# Create Invoice
+# Update Invoice Metadata
-Create an Invoice
+Updates the metadata from an invoice
```ts
-async createInvoice( subscriptionId: string,
- cycleId: string,
- request?: CreateInvoiceRequest,
+async updateInvoiceMetadata( invoiceId: string,
+ request: UpdateMetadataRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -162,9 +179,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `cycleId` | `string` | Template, Required | Cycle Id |
-| `request` | [`CreateInvoiceRequest \| undefined`](../../doc/models/create-invoice-request.md) | Body, Optional | - |
+| `invoiceId` | `string` | Template, Required | The invoice id |
+| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the invoice metadata |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -175,14 +191,18 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const subscriptionId = 'subscription_id0';
+const invoiceId = 'invoice_id0';
-const cycleId = 'cycle_id6';
+const request: UpdateMetadataRequest = {
+ metadata: {
+ 'key0': 'metadata3'
+ },
+};
try {
- const { result, ...httpResponse } = await invoicesController.createInvoice(
- subscriptionId,
- cycleId
+ const { result, ...httpResponse } = await invoicesController.updateInvoiceMetadata(
+ invoiceId,
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -195,51 +215,31 @@ try {
```
-# Get Invoices
-
-Gets all invoices
+# Get Partial Invoice
```ts
-async getInvoices( page?: number,
- size?: number,
- code?: string,
- customerId?: string,
- subscriptionId?: string,
- createdSince?: string,
- createdUntil?: string,
- status?: string,
- dueSince?: string,
- dueUntil?: string,
- customerDocument?: string,
-requestOptions?: RequestOptions): Promise>
+async getPartialInvoice( subscriptionId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `code` | `string \| undefined` | Query, Optional | Filter for Invoice's code |
-| `customerId` | `string \| undefined` | Query, Optional | Filter for Invoice's customer id |
-| `subscriptionId` | `string \| undefined` | Query, Optional | Filter for Invoice's subscription id |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for Invoice's creation date start range |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for Invoices creation date end range |
-| `status` | `string \| undefined` | Query, Optional | Filter for Invoice's status |
-| `dueSince` | `string \| undefined` | Query, Optional | Filter for Invoice's due date start range |
-| `dueUntil` | `string \| undefined` | Query, Optional | Filter for Invoice's due date end range |
-| `customerDocument` | `string \| undefined` | Query, Optional | - |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListInvoicesResponse`](../../doc/models/list-invoices-response.md)
+[`GetInvoiceResponse`](../../doc/models/get-invoice-response.md)
## Example Usage
```ts
+const subscriptionId = 'subscription_id0';
+
try {
- const { result, ...httpResponse } = await invoicesController.getInvoices();
+ const { result, ...httpResponse } = await invoicesController.getPartialInvoice(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -251,12 +251,15 @@ try {
```
-# Get Invoice
+# Create Invoice
-Gets an invoice
+Create an Invoice
```ts
-async getInvoice( invoiceId: string,
+async createInvoice( subscriptionId: string,
+ cycleId: string,
+ request?: CreateInvoiceRequest,
+ idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -264,7 +267,10 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `invoiceId` | `string` | Template, Required | Invoice Id |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `cycleId` | `string` | Template, Required | Cycle Id |
+| `request` | [`CreateInvoiceRequest \| undefined`](../../doc/models/create-invoice-request.md) | Body, Optional | - |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -274,10 +280,15 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const invoiceId = 'invoice_id0';
+const subscriptionId = 'subscription_id0';
+
+const cycleId = 'cycle_id6';
try {
- const { result, ...httpResponse } = await invoicesController.getInvoice(invoiceId);
+ const { result, ...httpResponse } = await invoicesController.createInvoice(
+ subscriptionId,
+ cycleId
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -289,14 +300,12 @@ try {
```
-# Update Invoice Status
+# Get Invoice
-Updates the status from an invoice
+Gets an invoice
```ts
-async updateInvoiceStatus( invoiceId: string,
- request: UpdateInvoiceStatusRequest,
- idempotencyKey?: string,
+async getInvoice( invoiceId: string,
requestOptions?: RequestOptions): Promise>
```
@@ -305,8 +314,6 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `invoiceId` | `string` | Template, Required | Invoice Id |
-| `request` | [`UpdateInvoiceStatusRequest`](../../doc/models/update-invoice-status-request.md) | Body, Required | Request for updating an invoice's status |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -318,15 +325,8 @@ requestOptions?: RequestOptions): Promise>
```ts
const invoiceId = 'invoice_id0';
-const request: UpdateInvoiceStatusRequest = {
- status: 'status8',
-};
-
try {
- const { result, ...httpResponse } = await invoicesController.updateInvoiceStatus(
- invoiceId,
- request
-);
+ const { result, ...httpResponse } = await invoicesController.getInvoice(invoiceId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
diff --git a/doc/controllers/orders.md b/doc/controllers/orders.md
index 4c04323..2e7912d 100644
--- a/doc/controllers/orders.md
+++ b/doc/controllers/orders.md
@@ -10,55 +10,45 @@ const ordersController = new OrdersController(client);
## Methods
-* [Get Orders](../../doc/controllers/orders.md#get-orders)
-* [Update Order Item](../../doc/controllers/orders.md#update-order-item)
* [Delete All Order Items](../../doc/controllers/orders.md#delete-all-order-items)
+* [Get Order Item](../../doc/controllers/orders.md#get-order-item)
+* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata)
* [Delete Order Item](../../doc/controllers/orders.md#delete-order-item)
+* [Get Order](../../doc/controllers/orders.md#get-order)
+* [Get Orders](../../doc/controllers/orders.md#get-orders)
+* [Update Order Item](../../doc/controllers/orders.md#update-order-item)
* [Close Order](../../doc/controllers/orders.md#close-order)
* [Create Order](../../doc/controllers/orders.md#create-order)
* [Create Order Item](../../doc/controllers/orders.md#create-order-item)
-* [Get Order Item](../../doc/controllers/orders.md#get-order-item)
-* [Update Order Metadata](../../doc/controllers/orders.md#update-order-metadata)
-* [Get Order](../../doc/controllers/orders.md#get-order)
-# Get Orders
-
-Gets all orders
+# Delete All Order Items
```ts
-async getOrders( page?: number,
- size?: number,
- code?: string,
- status?: string,
- createdSince?: string,
- createdUntil?: string,
- customerId?: string,
-requestOptions?: RequestOptions): Promise>
+async deleteAllOrderItems( orderId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `code` | `string \| undefined` | Query, Optional | Filter for order's code |
-| `status` | `string \| undefined` | Query, Optional | Filter for order's status |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for order's creation date start range |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for order's creation date end range |
-| `customerId` | `string \| undefined` | Query, Optional | Filter for order's customer id |
+| `orderId` | `string` | Template, Required | Order Id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListOrderResponse`](../../doc/models/list-order-response.md)
+[`GetOrderResponse`](../../doc/models/get-order-response.md)
## Example Usage
```ts
+const orderId = 'orderId2';
+
try {
- const { result, ...httpResponse } = await ordersController.getOrders();
+ const { result, ...httpResponse } = await ordersController.deleteAllOrderItems(orderId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -70,13 +60,11 @@ try {
```
-# Update Order Item
+# Get Order Item
```ts
-async updateOrderItem( orderId: string,
+async getOrderItem( orderId: string,
itemId: string,
- request: UpdateOrderItemRequest,
- idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -86,8 +74,6 @@ requestOptions?: RequestOptions): Promise>
| --- | --- | --- | --- |
| `orderId` | `string` | Template, Required | Order Id |
| `itemId` | `string` | Template, Required | Item Id |
-| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -101,18 +87,10 @@ const orderId = 'orderId2';
const itemId = 'itemId8';
-const request: UpdateOrderItemRequest = {
- amount: 242,
- description: 'description6',
- quantity: 100,
- category: 'category4',
-};
-
try {
- const { result, ...httpResponse } = await ordersController.updateOrderItem(
+ const { result, ...httpResponse } = await ordersController.getOrderItem(
orderId,
- itemId,
- request
+ itemId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -125,10 +103,13 @@ try {
```
-# Delete All Order Items
+# Update Order Metadata
+
+Updates the metadata from an order
```ts
-async deleteAllOrderItems( orderId: string,
+async updateOrderMetadata( orderId: string,
+ request: UpdateMetadataRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -137,7 +118,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `orderId` | `string` | Template, Required | Order Id |
+| `orderId` | `string` | Template, Required | The order id |
+| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the order metadata |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -148,10 +130,19 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const orderId = 'orderId2';
+const orderId = 'order_id6';
+
+const request: UpdateMetadataRequest = {
+ metadata: {
+ 'key0': 'metadata3'
+ },
+};
try {
- const { result, ...httpResponse } = await ordersController.deleteAllOrderItems(orderId);
+ const { result, ...httpResponse } = await ordersController.updateOrderMetadata(
+ orderId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -208,12 +199,12 @@ try {
```
-# Close Order
+# Get Order
+
+Gets an order
```ts
-async closeOrder( id: string,
- request: UpdateOrderStatusRequest,
- idempotencyKey?: string,
+async getOrder( orderId: string,
requestOptions?: RequestOptions): Promise>
```
@@ -221,9 +212,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `id` | `string` | Template, Required | Order Id |
-| `request` | [`UpdateOrderStatusRequest`](../../doc/models/update-order-status-request.md) | Body, Required | Update Order Model |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `orderId` | `string` | Template, Required | Order id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -233,17 +222,10 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const id = 'id0';
-
-const request: UpdateOrderStatusRequest = {
- status: 'status8',
-};
+const orderId = 'order_id6';
try {
- const { result, ...httpResponse } = await ordersController.closeOrder(
- id,
- request
-);
+ const { result, ...httpResponse } = await ordersController.getOrder(orderId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -255,74 +237,43 @@ try {
```
-# Create Order
+# Get Orders
-Creates a new Order
+Gets all orders
```ts
-async createOrder( body: CreateOrderRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getOrders( page?: number,
+ size?: number,
+ code?: string,
+ status?: string,
+ createdSince?: string,
+ createdUntil?: string,
+ customerId?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | Request for creating an order |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `code` | `string \| undefined` | Query, Optional | Filter for order's code |
+| `status` | `string \| undefined` | Query, Optional | Filter for order's status |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for order's creation date start range |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for order's creation date end range |
+| `customerId` | `string \| undefined` | Query, Optional | Filter for order's customer id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetOrderResponse`](../../doc/models/get-order-response.md)
+[`ListOrderResponse`](../../doc/models/list-order-response.md)
## Example Usage
```ts
-const body: CreateOrderRequest = {
- items: [
- {
- amount: 164,
- description: 'description2',
- quantity: 22,
- category: 'category6',
- }
- ],
- customer: {
- name: 'Tony Stark',
- email: 'email6',
- document: 'document6',
- type: 'type0',
- address: {
- street: 'street6',
- number: 'number4',
- zipCode: 'zip_code0',
- neighborhood: 'neighborhood2',
- city: 'city6',
- state: 'state2',
- country: 'country0',
- complement: 'complement2',
- line1: 'line_10',
- line2: 'line_24',
- },
- metadata: {
- 'key0': 'metadata3'
- },
- phones: {},
- code: 'code8',
- },
- payments: [
- {
- paymentMethod: 'payment_method8',
- }
- ],
- code: 'code4',
- closed: true,
-};
-
try {
- const { result, ...httpResponse } = await ordersController.createOrder(body);
+ const { result, ...httpResponse } = await ordersController.getOrders();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -334,11 +285,12 @@ try {
```
-# Create Order Item
+# Update Order Item
```ts
-async createOrderItem( orderId: string,
- request: CreateOrderItemRequest,
+async updateOrderItem( orderId: string,
+ itemId: string,
+ request: UpdateOrderItemRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -348,7 +300,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `orderId` | `string` | Template, Required | Order Id |
-| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model |
+| `itemId` | `string` | Template, Required | Item Id |
+| `request` | [`UpdateOrderItemRequest`](../../doc/models/update-order-item-request.md) | Body, Required | Item Model |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -361,7 +314,9 @@ requestOptions?: RequestOptions): Promise>
```ts
const orderId = 'orderId2';
-const request: CreateOrderItemRequest = {
+const itemId = 'itemId8';
+
+const request: UpdateOrderItemRequest = {
amount: 242,
description: 'description6',
quantity: 100,
@@ -369,8 +324,9 @@ const request: CreateOrderItemRequest = {
};
try {
- const { result, ...httpResponse } = await ordersController.createOrderItem(
+ const { result, ...httpResponse } = await ordersController.updateOrderItem(
orderId,
+ itemId,
request
);
// Get more response info...
@@ -384,37 +340,41 @@ try {
```
-# Get Order Item
+# Close Order
```ts
-async getOrderItem( orderId: string,
- itemId: string,
-requestOptions?: RequestOptions): Promise>
+async closeOrder( id: string,
+ request: UpdateOrderStatusRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `orderId` | `string` | Template, Required | Order Id |
-| `itemId` | `string` | Template, Required | Item Id |
+| `id` | `string` | Template, Required | Order Id |
+| `request` | [`UpdateOrderStatusRequest`](../../doc/models/update-order-status-request.md) | Body, Required | Update Order Model |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md)
+[`GetOrderResponse`](../../doc/models/get-order-response.md)
## Example Usage
```ts
-const orderId = 'orderId2';
+const id = 'id0';
-const itemId = 'itemId8';
+const request: UpdateOrderStatusRequest = {
+ status: 'status8',
+};
try {
- const { result, ...httpResponse } = await ordersController.getOrderItem(
- orderId,
- itemId
+ const { result, ...httpResponse } = await ordersController.closeOrder(
+ id,
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -427,13 +387,12 @@ try {
```
-# Update Order Metadata
+# Create Order
-Updates the metadata from an order
+Creates a new Order
```ts
-async updateOrderMetadata( orderId: string,
- request: UpdateMetadataRequest,
+async createOrder( body: CreateOrderRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -442,8 +401,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `orderId` | `string` | Template, Required | The order id |
-| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the order metadata |
+| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | Request for creating an order |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -454,19 +412,49 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const orderId = 'order_id6';
-
-const request: UpdateMetadataRequest = {
- metadata: {
- 'key0': 'metadata3'
+const body: CreateOrderRequest = {
+ items: [
+ {
+ amount: 164,
+ description: 'description2',
+ quantity: 22,
+ category: 'category6',
+ }
+ ],
+ customer: {
+ name: 'Tony Stark',
+ email: 'email6',
+ document: 'document6',
+ type: 'type0',
+ address: {
+ street: 'street6',
+ number: 'number4',
+ zipCode: 'zip_code0',
+ neighborhood: 'neighborhood2',
+ city: 'city6',
+ state: 'state2',
+ country: 'country0',
+ complement: 'complement2',
+ line1: 'line_10',
+ line2: 'line_24',
+ },
+ metadata: {
+ 'key0': 'metadata3'
+ },
+ phones: {},
+ code: 'code8',
},
+ payments: [
+ {
+ paymentMethod: 'payment_method8',
+ }
+ ],
+ code: 'code4',
+ closed: true,
};
try {
- const { result, ...httpResponse } = await ordersController.updateOrderMetadata(
- orderId,
- request
-);
+ const { result, ...httpResponse } = await ordersController.createOrder(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -478,33 +466,45 @@ try {
```
-# Get Order
-
-Gets an order
+# Create Order Item
```ts
-async getOrder( orderId: string,
-requestOptions?: RequestOptions): Promise>
+async createOrderItem( orderId: string,
+ request: CreateOrderItemRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `orderId` | `string` | Template, Required | Order id |
+| `orderId` | `string` | Template, Required | Order Id |
+| `request` | [`CreateOrderItemRequest`](../../doc/models/create-order-item-request.md) | Body, Required | Order Item Model |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetOrderResponse`](../../doc/models/get-order-response.md)
+[`GetOrderItemResponse`](../../doc/models/get-order-item-response.md)
## Example Usage
```ts
-const orderId = 'order_id6';
+const orderId = 'orderId2';
+
+const request: CreateOrderItemRequest = {
+ amount: 242,
+ description: 'description6',
+ quantity: 100,
+ category: 'category4',
+};
try {
- const { result, ...httpResponse } = await ordersController.getOrder(orderId);
+ const { result, ...httpResponse } = await ordersController.createOrderItem(
+ orderId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
diff --git a/doc/controllers/plans.md b/doc/controllers/plans.md
index 7dfb444..da59bf7 100644
--- a/doc/controllers/plans.md
+++ b/doc/controllers/plans.md
@@ -11,15 +11,15 @@ const plansController = new PlansController(client);
## Methods
* [Get Plan](../../doc/controllers/plans.md#get-plan)
-* [Delete Plan](../../doc/controllers/plans.md#delete-plan)
+* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item)
* [Update Plan Metadata](../../doc/controllers/plans.md#update-plan-metadata)
+* [Create Plan](../../doc/controllers/plans.md#create-plan)
+* [Update Plan](../../doc/controllers/plans.md#update-plan)
+* [Delete Plan](../../doc/controllers/plans.md#delete-plan)
+* [Get Plans](../../doc/controllers/plans.md#get-plans)
* [Update Plan Item](../../doc/controllers/plans.md#update-plan-item)
* [Create Plan Item](../../doc/controllers/plans.md#create-plan-item)
* [Get Plan Item](../../doc/controllers/plans.md#get-plan-item)
-* [Create Plan](../../doc/controllers/plans.md#create-plan)
-* [Delete Plan Item](../../doc/controllers/plans.md#delete-plan-item)
-* [Get Plans](../../doc/controllers/plans.md#get-plans)
-* [Update Plan](../../doc/controllers/plans.md#update-plan)
# Get Plan
@@ -60,14 +60,15 @@ try {
```
-# Delete Plan
+# Delete Plan Item
-Deletes a plan
+Removes an item from a plan
```ts
-async deletePlan( planId: string,
+async deletePlanItem( planId: string,
+ planItemId: string,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -75,20 +76,26 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `planId` | `string` | Template, Required | Plan id |
+| `planItemId` | `string` | Template, Required | Plan item id |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanResponse`](../../doc/models/get-plan-response.md)
+[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
## Example Usage
```ts
const planId = 'plan_id8';
+const planItemId = 'plan_item_id0';
+
try {
- const { result, ...httpResponse } = await plansController.deletePlan(planId);
+ const { result, ...httpResponse } = await plansController.deletePlanItem(
+ planId,
+ planItemId
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -151,60 +158,71 @@ try {
```
-# Update Plan Item
+# Create Plan
-Updates a plan item
+Creates a new plan
```ts
-async updatePlanItem( planId: string,
- planItemId: string,
- body: UpdatePlanItemRequest,
+async createPlan( body: CreatePlanRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `planId` | `string` | Template, Required | Plan id |
-| `planItemId` | `string` | Template, Required | Plan item id |
-| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item |
+| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
+[`GetPlanResponse`](../../doc/models/get-plan-response.md)
## Example Usage
```ts
-const planId = 'plan_id8';
-
-const planItemId = 'plan_item_id0';
-
-const body: UpdatePlanItemRequest = {
+const body: CreatePlanRequest = {
name: 'name6',
description: 'description4',
- status: 'status2',
+ statementDescriptor: 'statement_descriptor6',
+ items: [
+ {
+ name: 'name8',
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ },
+ id: 'id8',
+ description: 'description2',
+ }
+ ],
+ shippable: false,
+ paymentMethods: [
+ 'payment_methods9'
+ ],
+ installments: [
+ 207
+ ],
+ currency: 'currency6',
+ interval: 'interval6',
+ intervalCount: 170,
+ billingDays: [
+ 201,
+ 200
+ ],
+ billingType: 'billing_type0',
pricingScheme: {
schemeType: 'scheme_type8',
- priceBrackets: [
- {
- startQuantity: 144,
- price: 174,
- }
- ],
+ },
+ metadata: {
+ 'key0': 'metadata7',
+ 'key1': 'metadata8'
},
};
try {
- const { result, ...httpResponse } = await plansController.updatePlanItem(
- planId,
- planItemId,
- body
-);
+ const { result, ...httpResponse } = await plansController.createPlan(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -216,15 +234,15 @@ try {
```
-# Create Plan Item
+# Update Plan
-Adds a new item to a plan
+Updates a plan
```ts
-async createPlanItem( planId: string,
- request: CreatePlanItemRequest,
+async updatePlan( planId: string,
+ request: UpdatePlanRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -232,30 +250,48 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `planId` | `string` | Template, Required | Plan id |
-| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item |
+| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
+[`GetPlanResponse`](../../doc/models/get-plan-response.md)
## Example Usage
```ts
const planId = 'plan_id8';
-const request: CreatePlanItemRequest = {
+const request: UpdatePlanRequest = {
name: 'name6',
- pricingScheme: {
- schemeType: 'scheme_type8',
- },
- id: 'id6',
description: 'description6',
+ installments: [
+ 151,
+ 152
+ ],
+ statementDescriptor: 'statement_descriptor6',
+ currency: 'currency6',
+ interval: 'interval4',
+ intervalCount: 114,
+ paymentMethods: [
+ 'payment_methods1',
+ 'payment_methods0',
+ 'payment_methods9'
+ ],
+ billingType: 'billing_type0',
+ status: 'status8',
+ shippable: false,
+ billingDays: [
+ 115
+ ],
+ metadata: {
+ 'key0': 'metadata3'
+ },
};
try {
- const { result, ...httpResponse } = await plansController.createPlanItem(
+ const { result, ...httpResponse } = await plansController.updatePlan(
planId,
request
);
@@ -270,14 +306,14 @@ try {
```
-# Get Plan Item
+# Delete Plan
-Gets a plan item
+Deletes a plan
```ts
-async getPlanItem( planId: string,
- planItemId: string,
-requestOptions?: RequestOptions): Promise>
+async deletePlan( planId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -285,25 +321,20 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `planId` | `string` | Template, Required | Plan id |
-| `planItemId` | `string` | Template, Required | Plan item id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
+[`GetPlanResponse`](../../doc/models/get-plan-response.md)
## Example Usage
```ts
const planId = 'plan_id8';
-const planItemId = 'plan_item_id0';
-
try {
- const { result, ...httpResponse } = await plansController.getPlanItem(
- planId,
- planItemId
-);
+ const { result, ...httpResponse } = await plansController.deletePlan(planId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -315,71 +346,43 @@ try {
```
-# Create Plan
+# Get Plans
-Creates a new plan
+Gets all plans
```ts
-async createPlan( body: CreatePlanRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getPlans( page?: number,
+ size?: number,
+ name?: string,
+ status?: string,
+ billingType?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `body` | [`CreatePlanRequest`](../../doc/models/create-plan-request.md) | Body, Required | Request for creating a plan |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `name` | `string \| undefined` | Query, Optional | Filter for Plan's name |
+| `status` | `string \| undefined` | Query, Optional | Filter for Plan's status |
+| `billingType` | `string \| undefined` | Query, Optional | Filter for plan's billing type |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for plan's creation date start range |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for plan's creation date end range |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanResponse`](../../doc/models/get-plan-response.md)
+[`ListPlansResponse`](../../doc/models/list-plans-response.md)
## Example Usage
```ts
-const body: CreatePlanRequest = {
- name: 'name6',
- description: 'description4',
- statementDescriptor: 'statement_descriptor6',
- items: [
- {
- name: 'name8',
- pricingScheme: {
- schemeType: 'scheme_type8',
- },
- id: 'id8',
- description: 'description2',
- }
- ],
- shippable: false,
- paymentMethods: [
- 'payment_methods9'
- ],
- installments: [
- 207
- ],
- currency: 'currency6',
- interval: 'interval6',
- intervalCount: 170,
- billingDays: [
- 201,
- 200
- ],
- billingType: 'billing_type0',
- pricingScheme: {
- schemeType: 'scheme_type8',
- },
- metadata: {
- 'key0': 'metadata7',
- 'key1': 'metadata8'
- },
-};
-
try {
- const { result, ...httpResponse } = await plansController.createPlan(body);
+ const { result, ...httpResponse } = await plansController.getPlans();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -391,13 +394,14 @@ try {
```
-# Delete Plan Item
+# Update Plan Item
-Removes an item from a plan
+Updates a plan item
```ts
-async deletePlanItem( planId: string,
+async updatePlanItem( planId: string,
planItemId: string,
+ body: UpdatePlanItemRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -408,6 +412,7 @@ requestOptions?: RequestOptions): Promise>
| --- | --- | --- | --- |
| `planId` | `string` | Template, Required | Plan id |
| `planItemId` | `string` | Template, Required | Plan item id |
+| `body` | [`UpdatePlanItemRequest`](../../doc/models/update-plan-item-request.md) | Body, Required | Request for updating the plan item |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -422,10 +427,26 @@ const planId = 'plan_id8';
const planItemId = 'plan_item_id0';
+const body: UpdatePlanItemRequest = {
+ name: 'name6',
+ description: 'description4',
+ status: 'status2',
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ priceBrackets: [
+ {
+ startQuantity: 144,
+ price: 174,
+ }
+ ],
+ },
+};
+
try {
- const { result, ...httpResponse } = await plansController.deletePlanItem(
+ const { result, ...httpResponse } = await plansController.updatePlanItem(
planId,
- planItemId
+ planItemId,
+ body
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -438,43 +459,49 @@ try {
```
-# Get Plans
+# Create Plan Item
-Gets all plans
+Adds a new item to a plan
```ts
-async getPlans( page?: number,
- size?: number,
- name?: string,
- status?: string,
- billingType?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async createPlanItem( planId: string,
+ request: CreatePlanItemRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `name` | `string \| undefined` | Query, Optional | Filter for Plan's name |
-| `status` | `string \| undefined` | Query, Optional | Filter for Plan's status |
-| `billingType` | `string \| undefined` | Query, Optional | Filter for plan's billing type |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for plan's creation date start range |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for plan's creation date end range |
+| `planId` | `string` | Template, Required | Plan id |
+| `request` | [`CreatePlanItemRequest`](../../doc/models/create-plan-item-request.md) | Body, Required | Request for creating a plan item |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListPlansResponse`](../../doc/models/list-plans-response.md)
+[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
## Example Usage
```ts
+const planId = 'plan_id8';
+
+const request: CreatePlanItemRequest = {
+ name: 'name6',
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ },
+ id: 'id6',
+ description: 'description6',
+};
+
try {
- const { result, ...httpResponse } = await plansController.getPlans();
+ const { result, ...httpResponse } = await plansController.createPlanItem(
+ planId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -486,15 +513,14 @@ try {
```
-# Update Plan
+# Get Plan Item
-Updates a plan
+Gets a plan item
```ts
-async updatePlan( planId: string,
- request: UpdatePlanRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getPlanItem( planId: string,
+ planItemId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -502,50 +528,24 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `planId` | `string` | Template, Required | Plan id |
-| `request` | [`UpdatePlanRequest`](../../doc/models/update-plan-request.md) | Body, Required | Request for updating a plan |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `planItemId` | `string` | Template, Required | Plan item id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPlanResponse`](../../doc/models/get-plan-response.md)
+[`GetPlanItemResponse`](../../doc/models/get-plan-item-response.md)
## Example Usage
```ts
const planId = 'plan_id8';
-const request: UpdatePlanRequest = {
- name: 'name6',
- description: 'description6',
- installments: [
- 151,
- 152
- ],
- statementDescriptor: 'statement_descriptor6',
- currency: 'currency6',
- interval: 'interval4',
- intervalCount: 114,
- paymentMethods: [
- 'payment_methods1',
- 'payment_methods0',
- 'payment_methods9'
- ],
- billingType: 'billing_type0',
- status: 'status8',
- shippable: false,
- billingDays: [
- 115
- ],
- metadata: {
- 'key0': 'metadata3'
- },
-};
+const planItemId = 'plan_item_id0';
try {
- const { result, ...httpResponse } = await plansController.updatePlan(
+ const { result, ...httpResponse } = await plansController.getPlanItem(
planId,
- request
+ planItemId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
diff --git a/doc/controllers/recipients.md b/doc/controllers/recipients.md
index 1a0abb7..02f6845 100644
--- a/doc/controllers/recipients.md
+++ b/doc/controllers/recipients.md
@@ -11,27 +11,28 @@ const recipientsController = new RecipientsController(client);
## Methods
* [Update Recipient](../../doc/controllers/recipients.md#update-recipient)
-* [Create Anticipation](../../doc/controllers/recipients.md#create-anticipation)
-* [Get Anticipation Limits](../../doc/controllers/recipients.md#get-anticipation-limits)
-* [Get Recipients](../../doc/controllers/recipients.md#get-recipients)
* [Get Withdraw by Id](../../doc/controllers/recipients.md#get-withdraw-by-id)
+* [Get Recipient](../../doc/controllers/recipients.md#get-recipient)
+* [Get Balance](../../doc/controllers/recipients.md#get-balance)
+* [Get Recipients](../../doc/controllers/recipients.md#get-recipients)
* [Update Recipient Default Bank Account](../../doc/controllers/recipients.md#update-recipient-default-bank-account)
-* [Update Recipient Metadata](../../doc/controllers/recipients.md#update-recipient-metadata)
* [Get Transfers](../../doc/controllers/recipients.md#get-transfers)
* [Get Transfer](../../doc/controllers/recipients.md#get-transfer)
* [Create Withdraw](../../doc/controllers/recipients.md#create-withdraw)
-* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings)
* [Get Anticipation](../../doc/controllers/recipients.md#get-anticipation)
* [Update Recipient Transfer Settings](../../doc/controllers/recipients.md#update-recipient-transfer-settings)
-* [Get Anticipations](../../doc/controllers/recipients.md#get-anticipations)
-* [Get Recipient](../../doc/controllers/recipients.md#get-recipient)
-* [Get Balance](../../doc/controllers/recipients.md#get-balance)
-* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals)
+* [Get Recipient by Code](../../doc/controllers/recipients.md#get-recipient-by-code)
+* [Update Automatic Anticipation Settings](../../doc/controllers/recipients.md#update-automatic-anticipation-settings)
* [Create Transfer](../../doc/controllers/recipients.md#create-transfer)
* [Create Recipient](../../doc/controllers/recipients.md#create-recipient)
-* [Get Recipient by Code](../../doc/controllers/recipients.md#get-recipient-by-code)
* [Get Default Recipient](../../doc/controllers/recipients.md#get-default-recipient)
+* [Create Anticipation](../../doc/controllers/recipients.md#create-anticipation)
+* [Get Anticipation Limits](../../doc/controllers/recipients.md#get-anticipation-limits)
+* [Update Recipient Metadata](../../doc/controllers/recipients.md#update-recipient-metadata)
+* [Get Anticipations](../../doc/controllers/recipients.md#get-anticipations)
+* [Get Withdrawals](../../doc/controllers/recipients.md#get-withdrawals)
* [Create KYC Link](../../doc/controllers/recipients.md#create-kyc-link)
+* [Update Recipient Code](../../doc/controllers/recipients.md#update-recipient-code)
# Update Recipient
@@ -90,45 +91,37 @@ try {
```
-# Create Anticipation
-
-Creates an anticipation
+# Get Withdraw by Id
```ts
-async createAnticipation( recipientId: string,
- request: CreateAnticipationRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getWithdrawById( recipientId: string,
+ withdrawalId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
-| `request` | [`CreateAnticipationRequest`](../../doc/models/create-anticipation-request.md) | Body, Required | Anticipation data |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `recipientId` | `string` | Template, Required | - |
+| `withdrawalId` | `string` | Template, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAnticipationResponse`](../../doc/models/get-anticipation-response.md)
+[`GetWithdrawResponse`](../../doc/models/get-withdraw-response.md)
## Example Usage
```ts
const recipientId = 'recipient_id0';
-const request: CreateAnticipationRequest = {
- amount: 242,
- timeframe: 'timeframe8',
- paymentDate: '2016-03-13T12:52:32.123Z',
-};
+const withdrawalId = 'withdrawal_id2';
try {
- const { result, ...httpResponse } = await recipientsController.createAnticipation(
+ const { result, ...httpResponse } = await recipientsController.getWithdrawById(
recipientId,
- request
+ withdrawalId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -141,45 +134,33 @@ try {
```
-# Get Anticipation Limits
+# Get Recipient
-Gets the anticipation limits for a recipient
+Retrieves recipient information
```ts
-async getAnticipationLimits( recipientId: string,
- timeframe: string,
- paymentDate: string,
-requestOptions?: RequestOptions): Promise>
+async getRecipient( recipientId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
-| `timeframe` | `string` | Query, Required | Timeframe |
-| `paymentDate` | `string` | Query, Required | Anticipation payment date |
+| `recipientId` | `string` | Template, Required | Recipiend id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetAnticipationLimitResponse`](../../doc/models/get-anticipation-limit-response.md)
+[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
## Example Usage
```ts
const recipientId = 'recipient_id0';
-const timeframe = 'timeframe2';
-
-const paymentDate = '2016-03-13T12:52:32.123Z';
-
try {
- const { result, ...httpResponse } = await recipientsController.getAnticipationLimits(
- recipientId,
- timeframe,
- paymentDate
-);
+ const { result, ...httpResponse } = await recipientsController.getRecipient(recipientId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -191,33 +172,33 @@ try {
```
-# Get Recipients
+# Get Balance
-Retrieves paginated recipients information
+Get balance information for a recipient
```ts
-async getRecipients( page?: number,
- size?: number,
-requestOptions?: RequestOptions): Promise>
+async getBalance( recipientId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
+| `recipientId` | `string` | Template, Required | Recipient id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListRecipientResponse`](../../doc/models/list-recipient-response.md)
+[`GetBalanceResponse`](../../doc/models/get-balance-response.md)
## Example Usage
```ts
+const recipientId = 'recipient_id0';
+
try {
- const { result, ...httpResponse } = await recipientsController.getRecipients();
+ const { result, ...httpResponse } = await recipientsController.getBalance(recipientId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -229,38 +210,33 @@ try {
```
-# Get Withdraw by Id
+# Get Recipients
+
+Retrieves paginated recipients information
```ts
-async getWithdrawById( recipientId: string,
- withdrawalId: string,
-requestOptions?: RequestOptions): Promise>
+async getRecipients( page?: number,
+ size?: number,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | - |
-| `withdrawalId` | `string` | Template, Required | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetWithdrawResponse`](../../doc/models/get-withdraw-response.md)
+[`ListRecipientResponse`](../../doc/models/list-recipient-response.md)
## Example Usage
```ts
-const recipientId = 'recipient_id0';
-
-const withdrawalId = 'withdrawal_id2';
-
try {
- const { result, ...httpResponse } = await recipientsController.getWithdrawById(
- recipientId,
- withdrawalId
-);
+ const { result, ...httpResponse } = await recipientsController.getRecipients();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -335,57 +311,6 @@ try {
```
-# Update Recipient Metadata
-
-Updates recipient metadata
-
-```ts
-async updateRecipientMetadata( recipientId: string,
- request: UpdateMetadataRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
-| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
-| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
-
-## Response Type
-
-[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
-
-## Example Usage
-
-```ts
-const recipientId = 'recipient_id0';
-
-const request: UpdateMetadataRequest = {
- metadata: {
- 'key0': 'metadata3'
- },
-};
-
-try {
- const { result, ...httpResponse } = await recipientsController.updateRecipientMetadata(
- recipientId,
- request
-);
- // Get more response info...
- // const { statusCode, headers } = httpResponse;
-} catch (error) {
- if (error instanceof ApiError) {
- const errors = error.result;
- // const { statusCode, headers } = error;
- }
-}
-```
-
-
# Get Transfers
Gets a paginated list of transfers for the recipient
@@ -524,53 +449,6 @@ try {
```
-# Update Automatic Anticipation Settings
-
-Updates recipient metadata
-
-```ts
-async updateAutomaticAnticipationSettings( recipientId: string,
- request: UpdateAutomaticAnticipationSettingsRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
-| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
-| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
-
-## Response Type
-
-[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
-
-## Example Usage
-
-```ts
-const recipientId = 'recipient_id0';
-
-const request: UpdateAutomaticAnticipationSettingsRequest = {};
-
-try {
- const { result, ...httpResponse } = await recipientsController.updateAutomaticAnticipationSettings(
- recipientId,
- request
-);
- // Get more response info...
- // const { statusCode, headers } = httpResponse;
-} catch (error) {
- if (error instanceof ApiError) {
- const errors = error.result;
- // const { statusCode, headers } = error;
- }
-}
-```
-
-
# Get Anticipation
Gets an anticipation
@@ -665,49 +543,33 @@ try {
```
-# Get Anticipations
+# Get Recipient by Code
-Retrieves a paginated list of anticipations from a recipient
+Retrieves recipient information
```ts
-async getAnticipations( recipientId: string,
- page?: number,
- size?: number,
- status?: string,
- timeframe?: string,
- paymentDateSince?: string,
- paymentDateUntil?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async getRecipientByCode( code: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `status` | `string \| undefined` | Query, Optional | Filter for anticipation status |
-| `timeframe` | `string \| undefined` | Query, Optional | Filter for anticipation timeframe |
-| `paymentDateSince` | `string \| undefined` | Query, Optional | Filter for start range for anticipation payment date |
-| `paymentDateUntil` | `string \| undefined` | Query, Optional | Filter for end range for anticipation payment date |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for start range for anticipation creation date |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for end range for anticipation creation date |
+| `code` | `string` | Template, Required | Recipient code |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListAnticipationResponse`](../../doc/models/list-anticipation-response.md)
+[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
## Example Usage
```ts
-const recipientId = 'recipient_id0';
+const code = 'code8';
try {
- const { result, ...httpResponse } = await recipientsController.getAnticipations(recipientId);
+ const { result, ...httpResponse } = await recipientsController.getRecipientByCode(code);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -719,12 +581,14 @@ try {
```
-# Get Recipient
+# Update Automatic Anticipation Settings
-Retrieves recipient information
+Updates recipient metadata
```ts
-async getRecipient( recipientId: string,
+async updateAutomaticAnticipationSettings( recipientId: string,
+ request: UpdateAutomaticAnticipationSettingsRequest,
+ idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -732,7 +596,9 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipiend id |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `request` | [`UpdateAutomaticAnticipationSettingsRequest`](../../doc/models/update-automatic-anticipation-settings-request.md) | Body, Required | Metadata |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -744,8 +610,13 @@ requestOptions?: RequestOptions): Promise>
```ts
const recipientId = 'recipient_id0';
+const request: UpdateAutomaticAnticipationSettingsRequest = {};
+
try {
- const { result, ...httpResponse } = await recipientsController.getRecipient(recipientId);
+ const { result, ...httpResponse } = await recipientsController.updateAutomaticAnticipationSettings(
+ recipientId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -757,33 +628,47 @@ try {
```
-# Get Balance
+# Create Transfer
-Get balance information for a recipient
+Creates a transfer for a recipient
```ts
-async getBalance( recipientId: string,
-requestOptions?: RequestOptions): Promise>
+async createTransfer( recipientId: string,
+ request: CreateTransferRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient id |
+| `recipientId` | `string` | Template, Required | Recipient Id |
+| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetBalanceResponse`](../../doc/models/get-balance-response.md)
+[`GetTransferResponse`](../../doc/models/get-transfer-response.md)
## Example Usage
```ts
const recipientId = 'recipient_id0';
+const request: CreateTransferRequest = {
+ amount: 242,
+ metadata: {
+ 'key0': 'metadata3'
+ },
+};
+
try {
- const { result, ...httpResponse } = await recipientsController.getBalance(recipientId);
+ const { result, ...httpResponse } = await recipientsController.createTransfer(
+ recipientId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -795,43 +680,56 @@ try {
```
-# Get Withdrawals
+# Create Recipient
-Gets a paginated list of transfers for the recipient
+Creates a new recipient
```ts
-async getWithdrawals( recipientId: string,
- page?: number,
- size?: number,
- status?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async createRecipient( request: CreateRecipientRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | - |
-| `page` | `number \| undefined` | Query, Optional | - |
-| `size` | `number \| undefined` | Query, Optional | - |
-| `status` | `string \| undefined` | Query, Optional | - |
-| `createdSince` | `string \| undefined` | Query, Optional | - |
-| `createdUntil` | `string \| undefined` | Query, Optional | - |
+| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListWithdrawals`](../../doc/models/list-withdrawals.md)
+[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
## Example Usage
```ts
-const recipientId = 'recipient_id0';
+const request: CreateRecipientRequest = {
+ defaultBankAccount: {
+ holderName: 'holder_name4',
+ holderType: 'holder_type0',
+ holderDocument: 'holder_document2',
+ bank: 'bank6',
+ branchNumber: 'branch_number4',
+ accountNumber: 'account_number8',
+ accountCheckDigit: 'account_check_digit4',
+ type: 'type2',
+ metadata: {
+ 'key0': 'metadata5',
+ 'key1': 'metadata4',
+ 'key2': 'metadata3'
+ },
+ },
+ metadata: {
+ 'key0': 'metadata3'
+ },
+ code: 'code4',
+ paymentMode: 'bank_transfer',
+};
try {
- const { result, ...httpResponse } = await recipientsController.getWithdrawals(recipientId);
+ const { result, ...httpResponse } = await recipientsController.createRecipient(request);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -843,44 +741,75 @@ try {
```
-# Create Transfer
+# Get Default Recipient
-Creates a transfer for a recipient
+```ts
+async getDefaultRecipient(requestOptions?: RequestOptions): Promise>
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
+
+## Response Type
+
+[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
+
+## Example Usage
```ts
-async createTransfer( recipientId: string,
- request: CreateTransferRequest,
+try {
+ const { result, ...httpResponse } = await recipientsController.getDefaultRecipient();
+ // Get more response info...
+ // const { statusCode, headers } = httpResponse;
+} catch (error) {
+ if (error instanceof ApiError) {
+ const errors = error.result;
+ // const { statusCode, headers } = error;
+ }
+}
+```
+
+
+# Create Anticipation
+
+Creates an anticipation
+
+```ts
+async createAnticipation( recipientId: string,
+ request: CreateAnticipationRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `recipientId` | `string` | Template, Required | Recipient Id |
-| `request` | [`CreateTransferRequest`](../../doc/models/create-transfer-request.md) | Body, Required | Transfer data |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `request` | [`CreateAnticipationRequest`](../../doc/models/create-anticipation-request.md) | Body, Required | Anticipation data |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetTransferResponse`](../../doc/models/get-transfer-response.md)
+[`GetAnticipationResponse`](../../doc/models/get-anticipation-response.md)
## Example Usage
```ts
const recipientId = 'recipient_id0';
-const request: CreateTransferRequest = {
+const request: CreateAnticipationRequest = {
amount: 242,
- metadata: {
- 'key0': 'metadata3'
- },
+ timeframe: 'timeframe8',
+ paymentDate: '2016-03-13T12:52:32.123Z',
};
try {
- const { result, ...httpResponse } = await recipientsController.createTransfer(
+ const { result, ...httpResponse } = await recipientsController.createAnticipation(
recipientId,
request
);
@@ -895,12 +824,63 @@ try {
```
-# Create Recipient
+# Get Anticipation Limits
-Creates a new recipient
+Gets the anticipation limits for a recipient
```ts
-async createRecipient( request: CreateRecipientRequest,
+async getAnticipationLimits( recipientId: string,
+ timeframe: string,
+ paymentDate: string,
+requestOptions?: RequestOptions): Promise>
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `timeframe` | `string` | Query, Required | Timeframe |
+| `paymentDate` | `string` | Query, Required | Anticipation payment date |
+| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
+
+## Response Type
+
+[`GetAnticipationLimitResponse`](../../doc/models/get-anticipation-limit-response.md)
+
+## Example Usage
+
+```ts
+const recipientId = 'recipient_id0';
+
+const timeframe = 'timeframe2';
+
+const paymentDate = '2016-03-13T12:52:32.123Z';
+
+try {
+ const { result, ...httpResponse } = await recipientsController.getAnticipationLimits(
+ recipientId,
+ timeframe,
+ paymentDate
+);
+ // Get more response info...
+ // const { statusCode, headers } = httpResponse;
+} catch (error) {
+ if (error instanceof ApiError) {
+ const errors = error.result;
+ // const { statusCode, headers } = error;
+ }
+}
+```
+
+
+# Update Recipient Metadata
+
+Updates recipient metadata
+
+```ts
+async updateRecipientMetadata( recipientId: string,
+ request: UpdateMetadataRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -909,7 +889,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `request` | [`CreateRecipientRequest`](../../doc/models/create-recipient-request.md) | Body, Required | Recipient data |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Metadata |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -920,31 +901,19 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const request: CreateRecipientRequest = {
- defaultBankAccount: {
- holderName: 'holder_name4',
- holderType: 'holder_type0',
- holderDocument: 'holder_document2',
- bank: 'bank6',
- branchNumber: 'branch_number4',
- accountNumber: 'account_number8',
- accountCheckDigit: 'account_check_digit4',
- type: 'type2',
- metadata: {
- 'key0': 'metadata5',
- 'key1': 'metadata4',
- 'key2': 'metadata3'
- },
- },
+const recipientId = 'recipient_id0';
+
+const request: UpdateMetadataRequest = {
metadata: {
'key0': 'metadata3'
},
- code: 'code4',
- paymentMode: 'bank_transfer',
};
try {
- const { result, ...httpResponse } = await recipientsController.createRecipient(request);
+ const { result, ...httpResponse } = await recipientsController.updateRecipientMetadata(
+ recipientId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -956,33 +925,49 @@ try {
```
-# Get Recipient by Code
+# Get Anticipations
-Retrieves recipient information
+Retrieves a paginated list of anticipations from a recipient
```ts
-async getRecipientByCode( code: string,
-requestOptions?: RequestOptions): Promise>
+async getAnticipations( recipientId: string,
+ page?: number,
+ size?: number,
+ status?: string,
+ timeframe?: string,
+ paymentDateSince?: string,
+ paymentDateUntil?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `code` | `string` | Template, Required | Recipient code |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `status` | `string \| undefined` | Query, Optional | Filter for anticipation status |
+| `timeframe` | `string \| undefined` | Query, Optional | Filter for anticipation timeframe |
+| `paymentDateSince` | `string \| undefined` | Query, Optional | Filter for start range for anticipation payment date |
+| `paymentDateUntil` | `string \| undefined` | Query, Optional | Filter for end range for anticipation payment date |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for start range for anticipation creation date |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for end range for anticipation creation date |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
+[`ListAnticipationResponse`](../../doc/models/list-anticipation-response.md)
## Example Usage
```ts
-const code = 'code8';
+const recipientId = 'recipient_id0';
try {
- const { result, ...httpResponse } = await recipientsController.getRecipientByCode(code);
+ const { result, ...httpResponse } = await recipientsController.getAnticipations(recipientId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -994,27 +979,43 @@ try {
```
-# Get Default Recipient
+# Get Withdrawals
+
+Gets a paginated list of transfers for the recipient
```ts
-async getDefaultRecipient(requestOptions?: RequestOptions): Promise>
+async getWithdrawals( recipientId: string,
+ page?: number,
+ size?: number,
+ status?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
+| `recipientId` | `string` | Template, Required | - |
+| `page` | `number \| undefined` | Query, Optional | - |
+| `size` | `number \| undefined` | Query, Optional | - |
+| `status` | `string \| undefined` | Query, Optional | - |
+| `createdSince` | `string \| undefined` | Query, Optional | - |
+| `createdUntil` | `string \| undefined` | Query, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
+[`ListWithdrawals`](../../doc/models/list-withdrawals.md)
## Example Usage
```ts
+const recipientId = 'recipient_id0';
+
try {
- const { result, ...httpResponse } = await recipientsController.getDefaultRecipient();
+ const { result, ...httpResponse } = await recipientsController.getWithdrawals(recipientId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1063,3 +1064,52 @@ try {
}
```
+
+# Update Recipient Code
+
+Updates recipient code
+
+```ts
+async updateRecipientCode( recipientId: string,
+ request: UpdateRecipientCodeRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `recipientId` | `string` | Template, Required | Recipient id |
+| `request` | [`UpdateRecipientCodeRequest`](../../doc/models/update-recipient-code-request.md) | Body, Required | UpdateRecipientCodeRequest |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
+
+## Response Type
+
+[`GetRecipientResponse`](../../doc/models/get-recipient-response.md)
+
+## Example Usage
+
+```ts
+const recipientId = 'recipient_id0';
+
+const request: UpdateRecipientCodeRequest = {
+ code: 'code4',
+};
+
+try {
+ const { result, ...httpResponse } = await recipientsController.updateRecipientCode(
+ recipientId,
+ request
+);
+ // Get more response info...
+ // const { statusCode, headers } = httpResponse;
+} catch (error) {
+ if (error instanceof ApiError) {
+ const errors = error.result;
+ // const { statusCode, headers } = error;
+ }
+}
+```
+
diff --git a/doc/controllers/subscriptions.md b/doc/controllers/subscriptions.md
index 8d9036e..6fc8cf6 100644
--- a/doc/controllers/subscriptions.md
+++ b/doc/controllers/subscriptions.md
@@ -10,71 +10,85 @@ const subscriptionsController = new SubscriptionsController(client);
## Methods
-* [Renew Subscription](../../doc/controllers/subscriptions.md#renew-subscription)
* [Update Subscription Card](../../doc/controllers/subscriptions.md#update-subscription-card)
-* [Delete Usage](../../doc/controllers/subscriptions.md#delete-usage)
* [Create Discount](../../doc/controllers/subscriptions.md#create-discount)
-* [Create an Usage](../../doc/controllers/subscriptions.md#create-an-usage)
-* [Update Current Cycle Status](../../doc/controllers/subscriptions.md#update-current-cycle-status)
+* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date)
+* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at)
+* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription)
+* [Get Usages](../../doc/controllers/subscriptions.md#get-usages)
+* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at)
* [Delete Discount](../../doc/controllers/subscriptions.md#delete-discount)
-* [Get Subscription Items](../../doc/controllers/subscriptions.md#get-subscription-items)
* [Update Subscription Payment Method](../../doc/controllers/subscriptions.md#update-subscription-payment-method)
+* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription)
+* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription)
+* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id)
+* [Update Subscription Minium Price](../../doc/controllers/subscriptions.md#update-subscription-minium-price)
+* [Get Subscription Cycle by Id](../../doc/controllers/subscriptions.md#get-subscription-cycle-by-id)
+* [Get Usage Report](../../doc/controllers/subscriptions.md#get-usage-report)
+* [Renew Subscription](../../doc/controllers/subscriptions.md#renew-subscription)
+* [Delete Usage](../../doc/controllers/subscriptions.md#delete-usage)
+* [Create an Usage](../../doc/controllers/subscriptions.md#create-an-usage)
+* [Update Current Cycle Status](../../doc/controllers/subscriptions.md#update-current-cycle-status)
* [Get Subscription Item](../../doc/controllers/subscriptions.md#get-subscription-item)
+* [Get Increment by Id](../../doc/controllers/subscriptions.md#get-increment-by-id)
+* [Delete Increment](../../doc/controllers/subscriptions.md#delete-increment)
+* [Get Discounts](../../doc/controllers/subscriptions.md#get-discounts)
+* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days)
+* [Create Subscription Item](../../doc/controllers/subscriptions.md#create-subscription-item)
+* [Update Split Subscription](../../doc/controllers/subscriptions.md#update-split-subscription)
+* [Get Subscription Items](../../doc/controllers/subscriptions.md#get-subscription-items)
* [Get Subscriptions](../../doc/controllers/subscriptions.md#get-subscriptions)
-* [Cancel Subscription](../../doc/controllers/subscriptions.md#cancel-subscription)
* [Create Increment](../../doc/controllers/subscriptions.md#create-increment)
* [Create Usage](../../doc/controllers/subscriptions.md#create-usage)
* [Get Discount by Id](../../doc/controllers/subscriptions.md#get-discount-by-id)
-* [Create Subscription](../../doc/controllers/subscriptions.md#create-subscription)
-* [Get Increment by Id](../../doc/controllers/subscriptions.md#get-increment-by-id)
-* [Update Subscription Affiliation Id](../../doc/controllers/subscriptions.md#update-subscription-affiliation-id)
* [Update Subscription Metadata](../../doc/controllers/subscriptions.md#update-subscription-metadata)
-* [Delete Increment](../../doc/controllers/subscriptions.md#delete-increment)
* [Get Subscription Cycles](../../doc/controllers/subscriptions.md#get-subscription-cycles)
-* [Get Discounts](../../doc/controllers/subscriptions.md#get-discounts)
-* [Update Subscription Billing Date](../../doc/controllers/subscriptions.md#update-subscription-billing-date)
* [Delete Subscription Item](../../doc/controllers/subscriptions.md#delete-subscription-item)
* [Get Increments](../../doc/controllers/subscriptions.md#get-increments)
-* [Update Subscription Due Days](../../doc/controllers/subscriptions.md#update-subscription-due-days)
-* [Update Subscription Start At](../../doc/controllers/subscriptions.md#update-subscription-start-at)
* [Update Subscription Item](../../doc/controllers/subscriptions.md#update-subscription-item)
-* [Create Subscription Item](../../doc/controllers/subscriptions.md#create-subscription-item)
-* [Get Subscription](../../doc/controllers/subscriptions.md#get-subscription)
-* [Get Usages](../../doc/controllers/subscriptions.md#get-usages)
-* [Update Latest Period End At](../../doc/controllers/subscriptions.md#update-latest-period-end-at)
-* [Update Subscription Minium Price](../../doc/controllers/subscriptions.md#update-subscription-minium-price)
-* [Get Subscription Cycle by Id](../../doc/controllers/subscriptions.md#get-subscription-cycle-by-id)
-* [Get Usage Report](../../doc/controllers/subscriptions.md#get-usage-report)
-* [Update Split Subscription](../../doc/controllers/subscriptions.md#update-split-subscription)
-# Renew Subscription
+# Update Subscription Card
+
+Updates the credit card from a subscription
```ts
-async renewSubscription( subscriptionId: string,
+async updateSubscriptionCard( subscriptionId: string,
+ request: UpdateSubscriptionCardRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | - |
+| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `request` | [`UpdateSubscriptionCardRequest`](../../doc/models/update-subscription-card-request.md) | Body, Required | Request for updating a card |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPeriodResponse`](../../doc/models/get-period-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
+const request: UpdateSubscriptionCardRequest = {
+ card: {
+ type: 'credit',
+ },
+ cardId: 'card_id2',
+};
+
try {
- const { result, ...httpResponse } = await subscriptionsController.renewSubscription(subscriptionId);
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionCard(
+ subscriptionId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -86,15 +100,15 @@ try {
```
-# Update Subscription Card
+# Create Discount
-Updates the credit card from a subscription
+Creates a discount
```ts
-async updateSubscriptionCard( subscriptionId: string,
- request: UpdateSubscriptionCardRequest,
+async createDiscount( subscriptionId: string,
+ request: CreateDiscountRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -102,28 +116,27 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `request` | [`UpdateSubscriptionCardRequest`](../../doc/models/update-subscription-card-request.md) | Body, Required | Request for updating a card |
+| `request` | [`CreateDiscountRequest`](../../doc/models/create-discount-request.md) | Body, Required | Request for creating a discount |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`GetDiscountResponse`](../../doc/models/get-discount-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionCardRequest = {
- card: {
- type: 'credit',
- },
- cardId: 'card_id2',
+const request: CreateDiscountRequest = {
+ value: 185.28,
+ discountType: 'discount_type4',
+ itemId: 'item_id6',
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionCard(
+ const { result, ...httpResponse } = await subscriptionsController.createDiscount(
subscriptionId,
request
);
@@ -138,16 +151,15 @@ try {
```
-# Delete Usage
+# Update Subscription Billing Date
-Deletes a usage
+Updates the billing date from a subscription
```ts
-async deleteUsage( subscriptionId: string,
- itemId: string,
- usageId: string,
+async updateSubscriptionBillingDate( subscriptionId: string,
+ request: UpdateSubscriptionBillingDateRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -155,29 +167,27 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `itemId` | `string` | Template, Required | The subscription item id |
-| `usageId` | `string` | Template, Required | The usage id |
+| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetUsageResponse`](../../doc/models/get-usage-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const itemId = 'item_id0';
-
-const usageId = 'usage_id0';
+const request: UpdateSubscriptionBillingDateRequest = {
+ nextBillingAt: '2016-03-13T12:52:32.123Z',
+};
try {
- const { result, ...httpResponse } = await subscriptionsController.deleteUsage(
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionBillingDate(
subscriptionId,
- itemId,
- usageId
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -190,43 +200,41 @@ try {
```
-# Create Discount
+# Update Subscription Start At
-Creates a discount
+Updates the start at date from a subscription
```ts
-async createDiscount( subscriptionId: string,
- request: CreateDiscountRequest,
+async updateSubscriptionStartAt( subscriptionId: string,
+ request: UpdateSubscriptionStartAtRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `request` | [`CreateDiscountRequest`](../../doc/models/create-discount-request.md) | Body, Required | Request for creating a discount |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetDiscountResponse`](../../doc/models/get-discount-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: CreateDiscountRequest = {
- value: 185.28,
- discountType: 'discount_type4',
- itemId: 'item_id6',
+const request: UpdateSubscriptionStartAtRequest = {
+ startAt: '2016-03-13T12:52:32.123Z',
};
try {
- const { result, ...httpResponse } = await subscriptionsController.createDiscount(
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionStartAt(
subscriptionId,
request
);
@@ -241,15 +249,13 @@ try {
```
-# Create an Usage
+# Get Subscription
-Create Usage
+Gets a subscription
```ts
-async createAnUsage( subscriptionId: string,
- itemId: string,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscription( subscriptionId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -257,13 +263,63 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `itemId` | `string` | Template, Required | Item id |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetUsageResponse`](../../doc/models/get-usage-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+
+## Example Usage
+
+```ts
+const subscriptionId = 'subscription_id0';
+
+try {
+ const { result, ...httpResponse } = await subscriptionsController.getSubscription(subscriptionId);
+ // Get more response info...
+ // const { statusCode, headers } = httpResponse;
+} catch (error) {
+ if (error instanceof ApiError) {
+ const errors = error.result;
+ // const { statusCode, headers } = error;
+ }
+}
+```
+
+
+# Get Usages
+
+Lists all usages from a subscription item
+
+```ts
+async getUsages( subscriptionId: string,
+ itemId: string,
+ page?: number,
+ size?: number,
+ code?: string,
+ group?: string,
+ usedSince?: string,
+ usedUntil?: string,
+requestOptions?: RequestOptions): Promise>
+```
+
+## Parameters
+
+| Parameter | Type | Tags | Description |
+| --- | --- | --- | --- |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `itemId` | `string` | Template, Required | The subscription item id |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `code` | `string \| undefined` | Query, Optional | Identification code in the client system |
+| `group` | `string \| undefined` | Query, Optional | Identification group in the client system |
+| `usedSince` | `string \| undefined` | Query, Optional | - |
+| `usedUntil` | `string \| undefined` | Query, Optional | - |
+| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
+
+## Response Type
+
+[`ListUsagesResponse`](../../doc/models/list-usages-response.md)
## Example Usage
@@ -273,7 +329,7 @@ const subscriptionId = 'subscription_id0';
const itemId = 'item_id0';
try {
- const { result, ...httpResponse } = await subscriptionsController.createAnUsage(
+ const { result, ...httpResponse } = await subscriptionsController.getUsages(
subscriptionId,
itemId
);
@@ -288,39 +344,37 @@ try {
```
-# Update Current Cycle Status
+# Update Latest Period End At
```ts
-async updateCurrentCycleStatus( subscriptionId: string,
- request: UpdateCurrentCycleStatusRequest,
+async updateLatestPeriodEndAt( subscriptionId: string,
+ request: UpdateCurrentCycleEndDateRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status |
+| `subscriptionId` | `string` | Template, Required | - |
+| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-`void`
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateCurrentCycleStatusRequest = {
- status: 'status8',
-};
+const request: UpdateCurrentCycleEndDateRequest = {};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateCurrentCycleStatus(
+ const { result, ...httpResponse } = await subscriptionsController.updateLatestPeriodEndAt(
subscriptionId,
request
);
@@ -382,49 +436,48 @@ try {
```
-# Get Subscription Items
+# Update Subscription Payment Method
-Get Subscription Items
+Updates the payment method from a subscription
```ts
-async getSubscriptionItems( subscriptionId: string,
- page?: number,
- size?: number,
- name?: string,
- code?: string,
- status?: string,
- description?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async updateSubscriptionPaymentMethod( subscriptionId: string,
+ request: UpdateSubscriptionPaymentMethodRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `name` | `string \| undefined` | Query, Optional | The item name |
-| `code` | `string \| undefined` | Query, Optional | Identification code in the client system |
-| `status` | `string \| undefined` | Query, Optional | The item statis |
-| `description` | `string \| undefined` | Query, Optional | The item description |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for item's creation date start range |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for item's creation date end range |
+| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListSubscriptionItemsResponse`](../../doc/models/list-subscription-items-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
+const request: UpdateSubscriptionPaymentMethodRequest = {
+ paymentMethod: 'payment_method4',
+ cardId: 'card_id2',
+ card: {
+ type: 'credit',
+ },
+};
+
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscriptionItems(subscriptionId);
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionPaymentMethod(
+ subscriptionId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -436,13 +489,13 @@ try {
```
-# Update Subscription Payment Method
+# Cancel Subscription
-Updates the payment method from a subscription
+Cancels a subscription
```ts
-async updateSubscriptionPaymentMethod( subscriptionId: string,
- request: UpdateSubscriptionPaymentMethodRequest,
+async cancelSubscription( subscriptionId: string,
+ request?: CreateCancelSubscriptionRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -452,7 +505,7 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `request` | [`UpdateSubscriptionPaymentMethodRequest`](../../doc/models/update-subscription-payment-method-request.md) | Body, Required | Request for updating the paymentmethod from a subscription |
+| `request` | [`CreateCancelSubscriptionRequest \| undefined`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -465,16 +518,12 @@ requestOptions?: RequestOptions): Promise>
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionPaymentMethodRequest = {
- paymentMethod: 'payment_method4',
- cardId: 'card_id2',
- card: {
- type: 'credit',
- },
+const request: CreateCancelSubscriptionRequest = {
+ cancelPendingInvoices: true,
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionPaymentMethod(
+ const { result, ...httpResponse } = await subscriptionsController.cancelSubscription(
subscriptionId,
request
);
@@ -489,40 +538,129 @@ try {
```
-# Get Subscription Item
+# Create Subscription
-Get Subscription Item
+Creates a new subscription
```ts
-async getSubscriptionItem( subscriptionId: string,
- itemId: string,
-requestOptions?: RequestOptions): Promise>
+async createSubscription( body: CreateSubscriptionRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `itemId` | `string` | Template, Required | Item id |
+| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | Request for creating a subscription |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
-const subscriptionId = 'subscription_id0';
-
-const itemId = 'item_id0';
+const body: CreateSubscriptionRequest = {
+ customer: {
+ name: 'Tony Stark',
+ email: 'email6',
+ document: 'document6',
+ type: 'type0',
+ address: {
+ street: 'street6',
+ number: 'number4',
+ zipCode: 'zip_code0',
+ neighborhood: 'neighborhood2',
+ city: 'city6',
+ state: 'state2',
+ country: 'country0',
+ complement: 'complement2',
+ line1: 'line_10',
+ line2: 'line_24',
+ },
+ metadata: {
+ 'key0': 'metadata3'
+ },
+ phones: {},
+ code: 'code8',
+ },
+ card: {
+ type: 'credit',
+ },
+ code: 'code4',
+ paymentMethod: 'payment_method4',
+ billingType: 'billing_type0',
+ statementDescriptor: 'statement_descriptor6',
+ description: 'description4',
+ currency: 'currency6',
+ interval: 'interval6',
+ intervalCount: 170,
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ },
+ items: [
+ {
+ description: 'description2',
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ },
+ id: 'id8',
+ planItemId: 'plan_item_id8',
+ discounts: [
+ {
+ value: 90.66,
+ discountType: 'discount_type2',
+ itemId: 'item_id4',
+ }
+ ],
+ name: 'name8',
+ }
+ ],
+ shipping: {
+ amount: 52,
+ description: 'description6',
+ recipientName: 'recipient_name2',
+ recipientPhone: 'recipient_phone6',
+ addressId: 'address_id6',
+ address: {
+ street: 'street6',
+ number: 'number4',
+ zipCode: 'zip_code0',
+ neighborhood: 'neighborhood2',
+ city: 'city6',
+ state: 'state2',
+ country: 'country0',
+ complement: 'complement2',
+ line1: 'line_10',
+ line2: 'line_24',
+ },
+ type: 'type6',
+ },
+ discounts: [
+ {
+ value: 90.66,
+ discountType: 'discount_type2',
+ itemId: 'item_id4',
+ }
+ ],
+ metadata: {
+ 'key0': 'metadata7',
+ 'key1': 'metadata8'
+ },
+ increments: [
+ {
+ value: 252.86,
+ incrementType: 'increment_type6',
+ itemId: 'item_id6',
+ }
+ ],
+};
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscriptionItem(
- subscriptionId,
- itemId
-);
+ const { result, ...httpResponse } = await subscriptionsController.createSubscription(body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -534,53 +672,42 @@ try {
```
-# Get Subscriptions
-
-Gets all subscriptions
+# Update Subscription Affiliation Id
```ts
-async getSubscriptions( page?: number,
- size?: number,
- code?: string,
- billingType?: string,
- customerId?: string,
- planId?: string,
- cardId?: string,
- status?: string,
- nextBillingSince?: string,
- nextBillingUntil?: string,
- createdSince?: string,
- createdUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async updateSubscriptionAffiliationId( subscriptionId: string,
+ request: UpdateSubscriptionAffiliationIdRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `code` | `string \| undefined` | Query, Optional | Filter for subscription's code |
-| `billingType` | `string \| undefined` | Query, Optional | Filter for subscription's billing type |
-| `customerId` | `string \| undefined` | Query, Optional | Filter for subscription's customer id |
-| `planId` | `string \| undefined` | Query, Optional | Filter for subscription's plan id |
-| `cardId` | `string \| undefined` | Query, Optional | Filter for subscription's card id |
-| `status` | `string \| undefined` | Query, Optional | Filter for subscription's status |
-| `nextBillingSince` | `string \| undefined` | Query, Optional | Filter for subscription's next billing date start range |
-| `nextBillingUntil` | `string \| undefined` | Query, Optional | Filter for subscription's next billing date end range |
-| `createdSince` | `string \| undefined` | Query, Optional | Filter for subscription's creation date start range |
-| `createdUntil` | `string \| undefined` | Query, Optional | Filter for subscriptions creation date end range |
+| `subscriptionId` | `string` | Template, Required | - |
+| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListSubscriptionsResponse`](../../doc/models/list-subscriptions-response.md)
+[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
## Example Usage
```ts
+const subscriptionId = 'subscription_id0';
+
+const request: UpdateSubscriptionAffiliationIdRequest = {
+ gatewayAffiliationId: 'gateway_affiliation_id2',
+};
+
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscriptions();
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionAffiliationId(
+ subscriptionId,
+ request
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -592,13 +719,13 @@ try {
```
-# Cancel Subscription
+# Update Subscription Minium Price
-Cancels a subscription
+Atualização do valor mínimo da assinatura
```ts
-async cancelSubscription( subscriptionId: string,
- request?: CreateCancelSubscriptionRequest,
+async updateSubscriptionMiniumPrice( subscriptionId: string,
+ request: UpdateSubscriptionMinimumPriceRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -607,8 +734,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `request` | [`CreateCancelSubscriptionRequest \| undefined`](../../doc/models/create-cancel-subscription-request.md) | Body, Optional | Request for cancelling a subscription |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -621,12 +748,10 @@ requestOptions?: RequestOptions): Promise>
```ts
const subscriptionId = 'subscription_id0';
-const request: CreateCancelSubscriptionRequest = {
- cancelPendingInvoices: true,
-};
+const request: UpdateSubscriptionMinimumPriceRequest = {};
try {
- const { result, ...httpResponse } = await subscriptionsController.cancelSubscription(
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionMiniumPrice(
subscriptionId,
request
);
@@ -641,45 +766,37 @@ try {
```
-# Create Increment
-
-Creates a increment
+# Get Subscription Cycle by Id
```ts
-async createIncrement( subscriptionId: string,
- request: CreateIncrementRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscriptionCycleById( subscriptionId: string,
+ cycleId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `request` | [`CreateIncrementRequest`](../../doc/models/create-increment-request.md) | Body, Required | Request for creating a increment |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `cycleId` | `string` | Template, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetIncrementResponse`](../../doc/models/get-increment-response.md)
+[`GetPeriodResponse`](../../doc/models/get-period-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: CreateIncrementRequest = {
- value: 185.28,
- incrementType: 'increment_type8',
- itemId: 'item_id6',
-};
+const cycleId = 'cycleId0';
try {
- const { result, ...httpResponse } = await subscriptionsController.createIncrement(
+ const { result, ...httpResponse } = await subscriptionsController.getSubscriptionCycleById(
subscriptionId,
- request
+ cycleId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -692,50 +809,37 @@ try {
```
-# Create Usage
-
-Creates a usage
+# Get Usage Report
```ts
-async createUsage( subscriptionId: string,
- itemId: string,
- body: CreateUsageRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getUsageReport( subscriptionId: string,
+ periodId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `itemId` | `string` | Template, Required | Item id |
-| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `subscriptionId` | `string` | Template, Required | The subscription Id |
+| `periodId` | `string` | Template, Required | The period Id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetUsageResponse`](../../doc/models/get-usage-response.md)
+[`GetUsageReportResponse`](../../doc/models/get-usage-report-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const itemId = 'item_id0';
-
-const body: CreateUsageRequest = {
- quantity: 156,
- description: 'description4',
- usedAt: '2016-03-13T12:52:32.123Z',
-};
+const periodId = 'period_id0';
try {
- const { result, ...httpResponse } = await subscriptionsController.createUsage(
+ const { result, ...httpResponse } = await subscriptionsController.getUsageReport(
subscriptionId,
- itemId,
- body
+ periodId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -748,38 +852,33 @@ try {
```
-# Get Discount by Id
+# Renew Subscription
```ts
-async getDiscountById( subscriptionId: string,
- discountId: string,
-requestOptions?: RequestOptions): Promise>
+async renewSubscription( subscriptionId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `discountId` | `string` | Template, Required | - |
+| `subscriptionId` | `string` | Template, Required | - |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetDiscountResponse`](../../doc/models/get-discount-response.md)
+[`GetPeriodResponse`](../../doc/models/get-period-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const discountId = 'discountId0';
-
try {
- const { result, ...httpResponse } = await subscriptionsController.getDiscountById(
- subscriptionId,
- discountId
-);
+ const { result, ...httpResponse } = await subscriptionsController.renewSubscription(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -791,129 +890,47 @@ try {
```
-# Create Subscription
+# Delete Usage
-Creates a new subscription
+Deletes a usage
```ts
-async createSubscription( body: CreateSubscriptionRequest,
+async deleteUsage( subscriptionId: string,
+ itemId: string,
+ usageId: string,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | Request for creating a subscription |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `itemId` | `string` | Template, Required | The subscription item id |
+| `usageId` | `string` | Template, Required | The usage id |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`GetUsageResponse`](../../doc/models/get-usage-response.md)
## Example Usage
```ts
-const body: CreateSubscriptionRequest = {
- customer: {
- name: 'Tony Stark',
- email: 'email6',
- document: 'document6',
- type: 'type0',
- address: {
- street: 'street6',
- number: 'number4',
- zipCode: 'zip_code0',
- neighborhood: 'neighborhood2',
- city: 'city6',
- state: 'state2',
- country: 'country0',
- complement: 'complement2',
- line1: 'line_10',
- line2: 'line_24',
- },
- metadata: {
- 'key0': 'metadata3'
- },
- phones: {},
- code: 'code8',
- },
- card: {
- type: 'credit',
- },
- code: 'code4',
- paymentMethod: 'payment_method4',
- billingType: 'billing_type0',
- statementDescriptor: 'statement_descriptor6',
- description: 'description4',
- currency: 'currency6',
- interval: 'interval6',
- intervalCount: 170,
- pricingScheme: {
- schemeType: 'scheme_type8',
- },
- items: [
- {
- description: 'description2',
- pricingScheme: {
- schemeType: 'scheme_type8',
- },
- id: 'id8',
- planItemId: 'plan_item_id8',
- discounts: [
- {
- value: 90.66,
- discountType: 'discount_type2',
- itemId: 'item_id4',
- }
- ],
- name: 'name8',
- }
- ],
- shipping: {
- amount: 52,
- description: 'description6',
- recipientName: 'recipient_name2',
- recipientPhone: 'recipient_phone6',
- addressId: 'address_id6',
- address: {
- street: 'street6',
- number: 'number4',
- zipCode: 'zip_code0',
- neighborhood: 'neighborhood2',
- city: 'city6',
- state: 'state2',
- country: 'country0',
- complement: 'complement2',
- line1: 'line_10',
- line2: 'line_24',
- },
- type: 'type6',
- },
- discounts: [
- {
- value: 90.66,
- discountType: 'discount_type2',
- itemId: 'item_id4',
- }
- ],
- metadata: {
- 'key0': 'metadata7',
- 'key1': 'metadata8'
- },
- increments: [
- {
- value: 252.86,
- incrementType: 'increment_type6',
- itemId: 'item_id6',
- }
- ],
-};
+const subscriptionId = 'subscription_id0';
+
+const itemId = 'item_id0';
+
+const usageId = 'usage_id0';
try {
- const { result, ...httpResponse } = await subscriptionsController.createSubscription(body);
+ const { result, ...httpResponse } = await subscriptionsController.deleteUsage(
+ subscriptionId,
+ itemId,
+ usageId
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -925,37 +942,41 @@ try {
```
-# Get Increment by Id
+# Create an Usage
+
+Create Usage
```ts
-async getIncrementById( subscriptionId: string,
- incrementId: string,
-requestOptions?: RequestOptions): Promise>
+async createAnUsage( subscriptionId: string,
+ itemId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription Id |
-| `incrementId` | `string` | Template, Required | The increment Id |
+| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `itemId` | `string` | Template, Required | Item id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetIncrementResponse`](../../doc/models/get-increment-response.md)
+[`GetUsageResponse`](../../doc/models/get-usage-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const incrementId = 'increment_id8';
+const itemId = 'item_id0';
try {
- const { result, ...httpResponse } = await subscriptionsController.getIncrementById(
+ const { result, ...httpResponse } = await subscriptionsController.createAnUsage(
subscriptionId,
- incrementId
+ itemId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -968,39 +989,39 @@ try {
```
-# Update Subscription Affiliation Id
+# Update Current Cycle Status
```ts
-async updateSubscriptionAffiliationId( subscriptionId: string,
- request: UpdateSubscriptionAffiliationIdRequest,
+async updateCurrentCycleStatus( subscriptionId: string,
+ request: UpdateCurrentCycleStatusRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | - |
-| `request` | [`UpdateSubscriptionAffiliationIdRequest`](../../doc/models/update-subscription-affiliation-id-request.md) | Body, Required | Request for updating a subscription affiliation id |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `request` | [`UpdateCurrentCycleStatusRequest`](../../doc/models/update-current-cycle-status-request.md) | Body, Required | Request for updating the end date of the subscription current status |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+`void`
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionAffiliationIdRequest = {
- gatewayAffiliationId: 'gateway_affiliation_id2',
+const request: UpdateCurrentCycleStatusRequest = {
+ status: 'status8',
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionAffiliationId(
+ const { result, ...httpResponse } = await subscriptionsController.updateCurrentCycleStatus(
subscriptionId,
request
);
@@ -1015,45 +1036,39 @@ try {
```
-# Update Subscription Metadata
+# Get Subscription Item
-Updates the metadata from a subscription
+Get Subscription Item
```ts
-async updateSubscriptionMetadata( subscriptionId: string,
- request: UpdateMetadataRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscriptionItem( subscriptionId: string,
+ itemId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `itemId` | `string` | Template, Required | Item id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateMetadataRequest = {
- metadata: {
- 'key0': 'metadata3'
- },
-};
+const itemId = 'item_id0';
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionMetadata(
+ const { result, ...httpResponse } = await subscriptionsController.getSubscriptionItem(
subscriptionId,
- request
+ itemId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1066,14 +1081,11 @@ try {
```
-# Delete Increment
-
-Deletes a increment
+# Get Increment by Id
```ts
-async deleteIncrement( subscriptionId: string,
+async getIncrementById( subscriptionId: string,
incrementId: string,
- idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -1081,9 +1093,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription id |
-| `incrementId` | `string` | Template, Required | Increment id |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `subscriptionId` | `string` | Template, Required | The subscription Id |
+| `incrementId` | `string` | Template, Required | The increment Id |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -1098,7 +1109,7 @@ const subscriptionId = 'subscription_id0';
const incrementId = 'increment_id8';
try {
- const { result, ...httpResponse } = await subscriptionsController.deleteIncrement(
+ const { result, ...httpResponse } = await subscriptionsController.getIncrementById(
subscriptionId,
incrementId
);
@@ -1113,42 +1124,41 @@ try {
```
-# Get Subscription Cycles
+# Delete Increment
+
+Deletes a increment
```ts
-async getSubscriptionCycles( subscriptionId: string,
- page: string,
- size: string,
-requestOptions?: RequestOptions): Promise>
+async deleteIncrement( subscriptionId: string,
+ incrementId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `page` | `string` | Query, Required | Page number |
-| `size` | `string` | Query, Required | Page size |
+| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `incrementId` | `string` | Template, Required | Increment id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListCyclesResponse`](../../doc/models/list-cycles-response.md)
+[`GetIncrementResponse`](../../doc/models/get-increment-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const page = 'page8';
-
-const size = 'size0';
+const incrementId = 'increment_id8';
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscriptionCycles(
+ const { result, ...httpResponse } = await subscriptionsController.deleteIncrement(
subscriptionId,
- page,
- size
+ incrementId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1209,13 +1219,13 @@ try {
```
-# Update Subscription Billing Date
+# Update Subscription Due Days
-Updates the billing date from a subscription
+Updates the boleto due days from a subscription
```ts
-async updateSubscriptionBillingDate( subscriptionId: string,
- request: UpdateSubscriptionBillingDateRequest,
+async updateSubscriptionDueDays( subscriptionId: string,
+ request: UpdateSubscriptionDueDaysRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -1224,8 +1234,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `request` | [`UpdateSubscriptionBillingDateRequest`](../../doc/models/update-subscription-billing-date-request.md) | Body, Required | Request for updating the subscription billing date |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -1238,12 +1248,12 @@ requestOptions?: RequestOptions): Promise>
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionBillingDateRequest = {
- nextBillingAt: '2016-03-13T12:52:32.123Z',
+const request: UpdateSubscriptionDueDaysRequest = {
+ boletoDueDays: 226,
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionBillingDate(
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionDueDays(
subscriptionId,
request
);
@@ -1258,13 +1268,13 @@ try {
```
-# Delete Subscription Item
+# Create Subscription Item
-Deletes a subscription item
+Creates a new Subscription item
```ts
-async deleteSubscriptionItem( subscriptionId: string,
- subscriptionItemId: string,
+async createSubscriptionItem( subscriptionId: string,
+ request: CreateSubscriptionItemRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -1274,7 +1284,7 @@ requestOptions?: RequestOptions): Promise>
-```
-
-## Parameters
-
-| Parameter | Type | Tags | Description |
-| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
-
-## Response Type
-
-[`ListIncrementsResponse`](../../doc/models/list-increments-response.md)
-
-## Example Usage
-
-```ts
-const subscriptionId = 'subscription_id0';
-
-try {
- const { result, ...httpResponse } = await subscriptionsController.getIncrements(subscriptionId);
- // Get more response info...
- // const { statusCode, headers } = httpResponse;
-} catch (error) {
- if (error instanceof ApiError) {
- const errors = error.result;
- // const { statusCode, headers } = error;
- }
-}
-```
-
-
-# Update Subscription Due Days
-
-Updates the boleto due days from a subscription
+# Update Split Subscription
```ts
-async updateSubscriptionDueDays( subscriptionId: string,
- request: UpdateSubscriptionDueDaysRequest,
- idempotencyKey?: string,
+async updateSplitSubscription( id: string,
+ request: UpdateSubscriptionSplitRequest,
requestOptions?: RequestOptions): Promise>
```
@@ -1360,9 +1342,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `request` | [`UpdateSubscriptionDueDaysRequest`](../../doc/models/update-subscription-due-days-request.md) | Body, Required | - |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `id` | `string` | Template, Required | Subscription's id |
+| `request` | [`UpdateSubscriptionSplitRequest`](../../doc/models/update-subscription-split-request.md) | Body, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -1372,15 +1353,22 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const subscriptionId = 'subscription_id0';
+const id = 'id0';
-const request: UpdateSubscriptionDueDaysRequest = {
- boletoDueDays: 226,
+const request: UpdateSubscriptionSplitRequest = {
+ enabled: false,
+ rules: [
+ {
+ type: 'type2',
+ amount: 118,
+ recipientId: 'recipient_id2',
+ }
+ ],
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionDueDays(
- subscriptionId,
+ const { result, ...httpResponse } = await subscriptionsController.updateSplitSubscription(
+ id,
request
);
// Get more response info...
@@ -1394,15 +1382,21 @@ try {
```
-# Update Subscription Start At
+# Get Subscription Items
-Updates the start at date from a subscription
+Get Subscription Items
```ts
-async updateSubscriptionStartAt( subscriptionId: string,
- request: UpdateSubscriptionStartAtRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscriptionItems( subscriptionId: string,
+ page?: number,
+ size?: number,
+ name?: string,
+ code?: string,
+ status?: string,
+ description?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -1410,28 +1404,27 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `request` | [`UpdateSubscriptionStartAtRequest`](../../doc/models/update-subscription-start-at-request.md) | Body, Required | Request for updating the subscription start date |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `name` | `string \| undefined` | Query, Optional | The item name |
+| `code` | `string \| undefined` | Query, Optional | Identification code in the client system |
+| `status` | `string \| undefined` | Query, Optional | The item statis |
+| `description` | `string \| undefined` | Query, Optional | The item description |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for item's creation date start range |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for item's creation date end range |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`ListSubscriptionItemsResponse`](../../doc/models/list-subscription-items-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionStartAtRequest = {
- startAt: '2016-03-13T12:52:32.123Z',
-};
-
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionStartAt(
- subscriptionId,
- request
-);
+ const { result, ...httpResponse } = await subscriptionsController.getSubscriptionItems(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1443,60 +1436,53 @@ try {
```
-# Update Subscription Item
+# Get Subscriptions
-Updates a subscription item
+Gets all subscriptions
```ts
-async updateSubscriptionItem( subscriptionId: string,
- itemId: string,
- body: UpdateSubscriptionItemRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscriptions( page?: number,
+ size?: number,
+ code?: string,
+ billingType?: string,
+ customerId?: string,
+ planId?: string,
+ cardId?: string,
+ status?: string,
+ nextBillingSince?: string,
+ nextBillingUntil?: string,
+ createdSince?: string,
+ createdUntil?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `itemId` | `string` | Template, Required | Item id |
-| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
+| `code` | `string \| undefined` | Query, Optional | Filter for subscription's code |
+| `billingType` | `string \| undefined` | Query, Optional | Filter for subscription's billing type |
+| `customerId` | `string \| undefined` | Query, Optional | Filter for subscription's customer id |
+| `planId` | `string \| undefined` | Query, Optional | Filter for subscription's plan id |
+| `cardId` | `string \| undefined` | Query, Optional | Filter for subscription's card id |
+| `status` | `string \| undefined` | Query, Optional | Filter for subscription's status |
+| `nextBillingSince` | `string \| undefined` | Query, Optional | Filter for subscription's next billing date start range |
+| `nextBillingUntil` | `string \| undefined` | Query, Optional | Filter for subscription's next billing date end range |
+| `createdSince` | `string \| undefined` | Query, Optional | Filter for subscription's creation date start range |
+| `createdUntil` | `string \| undefined` | Query, Optional | Filter for subscriptions creation date end range |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md)
-
-## Example Usage
-
-```ts
-const subscriptionId = 'subscription_id0';
-
-const itemId = 'item_id0';
-
-const body: UpdateSubscriptionItemRequest = {
- description: 'description4',
- status: 'status2',
- pricingScheme: {
- schemeType: 'scheme_type8',
- priceBrackets: [
- {
- startQuantity: 144,
- price: 174,
- }
- ],
- },
- name: 'name6',
-};
+[`ListSubscriptionsResponse`](../../doc/models/list-subscriptions-response.md)
+
+## Example Usage
+```ts
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionItem(
- subscriptionId,
- itemId,
- body
-);
+ const { result, ...httpResponse } = await subscriptionsController.getSubscriptions();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1508,15 +1494,15 @@ try {
```
-# Create Subscription Item
+# Create Increment
-Creates a new Subscription item
+Creates a increment
```ts
-async createSubscriptionItem( subscriptionId: string,
- request: CreateSubscriptionItemRequest,
+async createIncrement( subscriptionId: string,
+ request: CreateIncrementRequest,
idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -1524,38 +1510,27 @@ requestOptions?: RequestOptions): Promise>
+async createUsage( subscriptionId: string,
+ itemId: string,
+ body: CreateUsageRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `itemId` | `string` | Template, Required | Item id |
+| `body` | [`CreateUsageRequest`](../../doc/models/create-usage-request.md) | Body, Required | Request for creating a usage |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`GetUsageResponse`](../../doc/models/get-usage-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
+const itemId = 'item_id0';
+
+const body: CreateUsageRequest = {
+ quantity: 156,
+ description: 'description4',
+ usedAt: '2016-03-13T12:52:32.123Z',
+};
+
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscription(subscriptionId);
+ const { result, ...httpResponse } = await subscriptionsController.createUsage(
+ subscriptionId,
+ itemId,
+ body
+);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1608,20 +1601,12 @@ try {
```
-# Get Usages
-
-Lists all usages from a subscription item
+# Get Discount by Id
```ts
-async getUsages( subscriptionId: string,
- itemId: string,
- page?: number,
- size?: number,
- code?: string,
- group?: string,
- usedSince?: string,
- usedUntil?: string,
-requestOptions?: RequestOptions): Promise>
+async getDiscountById( subscriptionId: string,
+ discountId: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -1629,30 +1614,24 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `itemId` | `string` | Template, Required | The subscription item id |
-| `page` | `number \| undefined` | Query, Optional | Page number |
-| `size` | `number \| undefined` | Query, Optional | Page size |
-| `code` | `string \| undefined` | Query, Optional | Identification code in the client system |
-| `group` | `string \| undefined` | Query, Optional | Identification group in the client system |
-| `usedSince` | `string \| undefined` | Query, Optional | - |
-| `usedUntil` | `string \| undefined` | Query, Optional | - |
+| `discountId` | `string` | Template, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`ListUsagesResponse`](../../doc/models/list-usages-response.md)
+[`GetDiscountResponse`](../../doc/models/get-discount-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const itemId = 'item_id0';
+const discountId = 'discountId0';
try {
- const { result, ...httpResponse } = await subscriptionsController.getUsages(
+ const { result, ...httpResponse } = await subscriptionsController.getDiscountById(
subscriptionId,
- itemId
+ discountId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1665,11 +1644,13 @@ try {
```
-# Update Latest Period End At
+# Update Subscription Metadata
+
+Updates the metadata from a subscription
```ts
-async updateLatestPeriodEndAt( subscriptionId: string,
- request: UpdateCurrentCycleEndDateRequest,
+async updateSubscriptionMetadata( subscriptionId: string,
+ request: UpdateMetadataRequest,
idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -1678,8 +1659,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | - |
-| `request` | [`UpdateCurrentCycleEndDateRequest`](../../doc/models/update-current-cycle-end-date-request.md) | Body, Required | Request for updating the end date of the current signature cycle |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `request` | [`UpdateMetadataRequest`](../../doc/models/update-metadata-request.md) | Body, Required | Request for updating the subscrption metadata |
| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
@@ -1692,10 +1673,14 @@ requestOptions?: RequestOptions): Promise>
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateCurrentCycleEndDateRequest = {};
+const request: UpdateMetadataRequest = {
+ metadata: {
+ 'key0': 'metadata3'
+ },
+};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateLatestPeriodEndAt(
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionMetadata(
subscriptionId,
request
);
@@ -1710,15 +1695,13 @@ try {
```
-# Update Subscription Minium Price
-
-Atualização do valor mínimo da assinatura
+# Get Subscription Cycles
```ts
-async updateSubscriptionMiniumPrice( subscriptionId: string,
- request: UpdateSubscriptionMinimumPriceRequest,
- idempotencyKey?: string,
-requestOptions?: RequestOptions): Promise>
+async getSubscriptionCycles( subscriptionId: string,
+ page: string,
+ size: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
@@ -1726,25 +1709,28 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `subscriptionId` | `string` | Template, Required | Subscription Id |
-| `request` | [`UpdateSubscriptionMinimumPriceRequest`](../../doc/models/update-subscription-minimum-price-request.md) | Body, Required | Request da requisição com o valor mínimo que será configurado |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
+| `page` | `string` | Query, Required | Page number |
+| `size` | `string` | Query, Required | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`ListCyclesResponse`](../../doc/models/list-cycles-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionMinimumPriceRequest = {};
+const page = 'page8';
+
+const size = 'size0';
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionMiniumPrice(
+ const { result, ...httpResponse } = await subscriptionsController.getSubscriptionCycles(
subscriptionId,
- request
+ page,
+ size
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1757,37 +1743,41 @@ try {
```
-# Get Subscription Cycle by Id
+# Delete Subscription Item
+
+Deletes a subscription item
```ts
-async getSubscriptionCycleById( subscriptionId: string,
- cycleId: string,
-requestOptions?: RequestOptions): Promise>
+async deleteSubscriptionItem( subscriptionId: string,
+ subscriptionItemId: string,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription id |
-| `cycleId` | `string` | Template, Required | - |
+| `subscriptionId` | `string` | Template, Required | Subscription id |
+| `subscriptionItemId` | `string` | Template, Required | Subscription item id |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetPeriodResponse`](../../doc/models/get-period-response.md)
+[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const cycleId = 'cycleId0';
+const subscriptionItemId = 'subscription_item_id4';
try {
- const { result, ...httpResponse } = await subscriptionsController.getSubscriptionCycleById(
+ const { result, ...httpResponse } = await subscriptionsController.deleteSubscriptionItem(
subscriptionId,
- cycleId
+ subscriptionItemId
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -1800,38 +1790,35 @@ try {
```
-# Get Usage Report
+# Get Increments
```ts
-async getUsageReport( subscriptionId: string,
- periodId: string,
-requestOptions?: RequestOptions): Promise>
+async getIncrements( subscriptionId: string,
+ page?: number,
+ size?: number,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `subscriptionId` | `string` | Template, Required | The subscription Id |
-| `periodId` | `string` | Template, Required | The period Id |
+| `subscriptionId` | `string` | Template, Required | The subscription id |
+| `page` | `number \| undefined` | Query, Optional | Page number |
+| `size` | `number \| undefined` | Query, Optional | Page size |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetUsageReportResponse`](../../doc/models/get-usage-report-response.md)
+[`ListIncrementsResponse`](../../doc/models/list-increments-response.md)
## Example Usage
```ts
const subscriptionId = 'subscription_id0';
-const periodId = 'period_id0';
-
try {
- const { result, ...httpResponse } = await subscriptionsController.getUsageReport(
- subscriptionId,
- periodId
-);
+ const { result, ...httpResponse } = await subscriptionsController.getIncrements(subscriptionId);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -1843,46 +1830,59 @@ try {
```
-# Update Split Subscription
+# Update Subscription Item
+
+Updates a subscription item
```ts
-async updateSplitSubscription( id: string,
- request: UpdateSubscriptionSplitRequest,
-requestOptions?: RequestOptions): Promise>
+async updateSubscriptionItem( subscriptionId: string,
+ itemId: string,
+ body: UpdateSubscriptionItemRequest,
+ idempotencyKey?: string,
+requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `id` | `string` | Template, Required | Subscription's id |
-| `request` | [`UpdateSubscriptionSplitRequest`](../../doc/models/update-subscription-split-request.md) | Body, Required | - |
+| `subscriptionId` | `string` | Template, Required | Subscription Id |
+| `itemId` | `string` | Template, Required | Item id |
+| `body` | [`UpdateSubscriptionItemRequest`](../../doc/models/update-subscription-item-request.md) | Body, Required | Request for updating a subscription item |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetSubscriptionResponse`](../../doc/models/get-subscription-response.md)
+[`GetSubscriptionItemResponse`](../../doc/models/get-subscription-item-response.md)
## Example Usage
```ts
-const id = 'id0';
+const subscriptionId = 'subscription_id0';
-const request: UpdateSubscriptionSplitRequest = {
- enabled: false,
- rules: [
- {
- type: 'type2',
- amount: 118,
- recipientId: 'recipient_id2',
- }
- ],
+const itemId = 'item_id0';
+
+const body: UpdateSubscriptionItemRequest = {
+ description: 'description4',
+ status: 'status2',
+ pricingScheme: {
+ schemeType: 'scheme_type8',
+ priceBrackets: [
+ {
+ startQuantity: 144,
+ price: 174,
+ }
+ ],
+ },
+ name: 'name6',
};
try {
- const { result, ...httpResponse } = await subscriptionsController.updateSplitSubscription(
- id,
- request
+ const { result, ...httpResponse } = await subscriptionsController.updateSubscriptionItem(
+ subscriptionId,
+ itemId,
+ body
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
diff --git a/doc/controllers/tokens.md b/doc/controllers/tokens.md
index 2dbf625..c69e86e 100644
--- a/doc/controllers/tokens.md
+++ b/doc/controllers/tokens.md
@@ -10,18 +10,19 @@ const tokensController = new TokensController(client);
## Methods
-* [Create Token](../../doc/controllers/tokens.md#create-token)
* [Get Token](../../doc/controllers/tokens.md#get-token)
+* [Create Token](../../doc/controllers/tokens.md#create-token)
-# Create Token
+# Get Token
+
+Gets a token from its id
:information_source: **Note** This endpoint does not require authentication.
```ts
-async createToken( publicKey: string,
- request: CreateTokenRequest,
- idempotencyKey?: string,
+async getToken( id: string,
+ publicKey: string,
requestOptions?: RequestOptions): Promise>
```
@@ -29,9 +30,8 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
+| `id` | `string` | Template, Required | Token id |
| `publicKey` | `string` | Template, Required | Public key |
-| `request` | [`CreateTokenRequest`](../../doc/models/create-token-request.md) | Body, Required | Request for creating a token |
-| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -41,25 +41,14 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const publicKey = 'public_key6';
+const id = 'id0';
-const request: CreateTokenRequest = {
- type: 'card',
- card: {
- number: 'number6',
- holderName: 'holder_name2',
- expMonth: 228,
- expYear: 68,
- cvv: 'cvv4',
- brand: 'brand0',
- label: 'label6',
- },
-};
+const publicKey = 'public_key6';
try {
- const { result, ...httpResponse } = await tokensController.createToken(
- publicKey,
- request
+ const { result, ...httpResponse } = await tokensController.getToken(
+ id,
+ publicKey
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
@@ -72,15 +61,14 @@ try {
```
-# Get Token
-
-Gets a token from its id
+# Create Token
:information_source: **Note** This endpoint does not require authentication.
```ts
-async getToken( id: string,
- publicKey: string,
+async createToken( publicKey: string,
+ request: CreateTokenRequest,
+ idempotencyKey?: string,
requestOptions?: RequestOptions): Promise>
```
@@ -88,8 +76,9 @@ requestOptions?: RequestOptions): Promise>
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `id` | `string` | Template, Required | Token id |
| `publicKey` | `string` | Template, Required | Public key |
+| `request` | [`CreateTokenRequest`](../../doc/models/create-token-request.md) | Body, Required | Request for creating a token |
+| `idempotencyKey` | `string \| undefined` | Header, Optional | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
@@ -99,14 +88,25 @@ requestOptions?: RequestOptions): Promise>
## Example Usage
```ts
-const id = 'id0';
-
const publicKey = 'public_key6';
+const request: CreateTokenRequest = {
+ type: 'card',
+ card: {
+ number: 'number6',
+ holderName: 'holder_name2',
+ expMonth: 228,
+ expYear: 68,
+ cvv: 'cvv4',
+ brand: 'brand0',
+ label: 'label6',
+ },
+};
+
try {
- const { result, ...httpResponse } = await tokensController.getToken(
- id,
- publicKey
+ const { result, ...httpResponse } = await tokensController.createToken(
+ publicKey,
+ request
);
// Get more response info...
// const { statusCode, headers } = httpResponse;
diff --git a/doc/controllers/transfers.md b/doc/controllers/transfers.md
index 9a4a522..faf4867 100644
--- a/doc/controllers/transfers.md
+++ b/doc/controllers/transfers.md
@@ -11,8 +11,8 @@ const transfersController = new TransfersController(client);
## Methods
* [Get Transfer by Id](../../doc/controllers/transfers.md#get-transfer-by-id)
-* [Create Transfer](../../doc/controllers/transfers.md#create-transfer)
* [Get Transfers](../../doc/controllers/transfers.md#get-transfers)
+* [Create Transfer](../../doc/controllers/transfers.md#create-transfer)
# Get Transfer by Id
@@ -51,35 +51,29 @@ try {
```
-# Create Transfer
+# Get Transfers
+
+Gets all transfers
```ts
-async createTransfer( request: CreateTransfer,
-requestOptions?: RequestOptions): Promise>
+async getTransfers(requestOptions?: RequestOptions): Promise>
```
## Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
-| `request` | [`CreateTransfer`](../../doc/models/create-transfer.md) | Body, Required | - |
| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. |
## Response Type
-[`GetTransfer`](../../doc/models/get-transfer.md)
+[`ListTransfers`](../../doc/models/list-transfers.md)
## Example Usage
```ts
-const request: CreateTransfer = {
- amount: 242,
- sourceId: 'source_id0',
- targetId: 'target_id6',
-};
-
try {
- const { result, ...httpResponse } = await transfersController.createTransfer(request);
+ const { result, ...httpResponse } = await transfersController.getTransfers();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch (error) {
@@ -91,29 +85,35 @@ try {
```
-# Get Transfers
-
-Gets all transfers
+# Create Transfer
```ts
-async getTransfers(requestOptions?: RequestOptions): Promise