vayu-ts 0.0.13 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +19 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -104,7 +104,7 @@ To create a new customer:
104
104
  ```typescript
105
105
  const response = await vayu.customers.create({
106
106
  name: 'John Doe',
107
- alias: 'customer_12345'
107
+ externalId: 'customer_12345'
108
108
  });
109
109
 
110
110
  console.log(response.customer);
@@ -117,7 +117,7 @@ To update an existing customer by ID:
117
117
  ```typescript
118
118
  const response = await vayu.customers.update('customer-id', {
119
119
  name: 'Jane Doe',
120
- alias: 'customer_67890'
120
+ externalId: 'customer_67890'
121
121
  });
122
122
 
123
123
  console.log(response.customer);
@@ -133,6 +133,23 @@ const response = await vayu.customers.delete('customer-id');
133
133
  console.log(response.customer);
134
134
  ```
135
135
 
136
+ ### Contracts
137
+
138
+ #### Assigning a contract to a customer
139
+
140
+ In order to assign a contract to a customer you would need to provide the customer Id and the relevant plan
141
+
142
+ ```typescript
143
+ const response = await vayu.contracts.create({
144
+ startDate: new Date(),
145
+ endDate: undefined,
146
+ customerId: '1f4cf23x-2c4y-483z-1111-158621f77a21',
147
+ planId: '4f6cf35x-1234-483z-a0a9-158621f77a21',
148
+ })
149
+
150
+ console.log(response.contract)
151
+ ```
152
+
136
153
  ### Meters
137
154
 
138
155
  Meters are entities that track and aggregate usage data based on events. They are crucial for billing and monitoring purposes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vayu-ts",
3
- "version": "0.0.13",
3
+ "version": "0.1.2",
4
4
  "description": "Simple and easy to use typescript package for utilizing vayu billing system",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://withvayu.com",