You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -105,53 +99,6 @@ const page = 1; // Pass in which page of orders you'd like
105
99
patch.orders.retrieveOrders({ page });
106
100
```
107
101
108
-
### Estimates
109
-
110
-
Estimates allow API users to get a quote for the cost of compensating a certain amount of CO2. When creating an estimate, an order in the `draft` state will also be created, reserving the allocation of a project for 5 minutes. If you don't place your draft order within those 5 minutes, the order will automatically be cancelled.
constmass_g=1000000; // Pass in the mass in grams (i.e. 1 metric tonne)
119
-
patch.estimates.createMassEstimate({ mass_g });
120
-
121
-
// Create an ecommerce estimate
122
-
constdistance_m=9000000;
123
-
// Pass in the shipping distance in meters, the transportation method, and the package mass
124
-
patch.estimates.createEcommerceEstimate({
125
-
distance_m,
126
-
package_mass_g:1000,
127
-
transportation_method:'air'
128
-
});
129
-
130
-
// Create a bitcoin estimate
131
-
consttransaction_value_btc_sats=1000; // [Optional] Pass in the transaction value in satoshis
132
-
patch.estimates.createBitcoinEstimate({
133
-
transaction_value_btc_sats
134
-
});
135
-
136
-
// Create a vehicle estimate
137
-
constdistance_m=9000000;
138
-
// Pass in the driving distance in meters and the model/make/year of the vehicle
139
-
patch.estimates.createVehicleEstimate({
140
-
distance_m,
141
-
make:'Toyota',
142
-
model:'Corolla',
143
-
year:1995
144
-
});
145
-
146
-
// Retrieve an estimate
147
-
constestimateId='est_test_1234';
148
-
patch.estimates.retrieveEstimate(estimate_id);
149
-
150
-
// Retrieve a list of estimates
151
-
constpage=1; // Pass in which page of estimates you'd like
152
-
patch.estimates.retrieveEstimates({ page });
153
-
```
154
-
155
102
### Projects
156
103
157
104
Projects are the ways Patch takes CO2 out of the air. They can represent reforestation, enhanced weathering, direct air carbon capture, etc. When you place an order via Patch, it is allocated to a project.
0 commit comments