Skip to content

Commit 1f80cd6

Browse files
author
Rahul Mody
committed
update readme
1 parent c1db1b3 commit 1f80cd6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,17 @@ fulfill the order for you.
6565

6666
```javascript
6767
// Create an order - you can create an order
68-
// providing either mass_g or total_price_cents_usd, but not both
68+
// providing either amount (and unit) or total_price (and currency), but not both
6969

7070
// Create order with mass
71-
const mass = 1000000; // Pass in the mass in grams (i.e. 1 metric tonne)
72-
patch.orders.createOrder({ mass_g: mass });
73-
74-
// Create an order with a maximum total price
75-
const totalPriceCentsUSD = 500; // Pass in the total price in cents (i.e. 5 dollars)
76-
patch.orders.createOrder({ total_price_cents_usd: totalPriceCentsUSD });
71+
const amount = 1_000_000; // Pass in the amount in unit specified
72+
const unit = 'g';
73+
patch.orders.createOrder({ amount: amount, unit: unit });
74+
75+
// Create an order with total price
76+
const totalPrice = 500; // Pass in the total price in smallest currency unit (ie cents for USD).
77+
const currency = 'USD';
78+
patch.orders.createOrder({ total_price: totalPrice, currency: currency });
7779

7880
// Retrieve an order
7981
orderId = 'ord_test_1234'; // Pass in the order's id

0 commit comments

Comments
 (0)