File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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
7981orderId = ' ord_test_1234' ; // Pass in the order's id
You can’t perform that action at this time.
0 commit comments