- Search for the desired t-shirt:
commercelayer resources:get skus -w name_i_cont_all=t-shirt,pink -w name_not_i_cont_all=women,whiteExample ID of t-shirt selected: NzWOpOSyBx.
- Get the markets:
cl resources:get marketsExample ID of market selected: DvlGRmhdgX.
- Create a new order:
cl resources:create orders -r market=markets/DvlGRmhdgXExample ID of order created: eqkykhrAwO.
- Create a line item:
cl resources:create line_items -a quantity=1 -r order=orders/eqkykhrAwO -r item=skus/NzWOpOSyBxExample ID of line item created: EvPrYtbryZ.
- Check if the line_item has been added correctly:
cl resources:get orders eqkykhrAwO -i=line_items- Update the order with a customer (customer creation shorthand):
cl resources:update orders/eqkykhrAwO -a [email protected]- Check if the customer has been added correctly:
cl resources:get orders eqkykhrAwO -i=customerExample ID of customer created: lnjmyhjykx.
- Create an address:
cl resources:create addresses -a first_name=Silvio last_name=Relli line1="Via Foo Bar, 123" city=Florence zip_code=50100 state_code=FI country_code=IT phone=33812345678Example ID of address created: YBoeluGlWN.
- Update the order with the address:
cl resources:update orders/eqkykhrAwO -r billing_address=addresses/YBoeluGlWN shipping_address=addresses/YBoeluGlWN- Check if the address has been added correctly:
cl resources:get orders eqkykhrAwO -i billing_address,shipping_address- Get the order shipments and the available shipping methods:
cl resources:get orders eqkykhrAwO -i shipments,shipments.available_shipping_methodsExample ID of order shipment created: WPwnrCkJep.
Example ID of shipment method selected: JnEdaPFAOP.
- Update the shipment with the selected shipping_method:
cl resources:update shipments/WPwnrCkJep -r shipping_method=shipping_methods/JnEdaPFAOP- Check if the shipping method has been added correctly:
cl resources:get shipments WPwnrCkJep -i shipping_method- Get the available payment methods for the order:
cl resources:get orders eqkykhrAwO -i available_payment_methodsExample ID of payment method created: gXmLyeszkP.
- Update the order with the selected payment method:
cl resources:update orders/eqkykhrAwO -r payment_method=payment_methods/gXmLyeszkP- Create the payment source and add it to the order:
cl resources:create wire_transfer -r order=orders/eqkykhrAwO- Check if the payment method and the payment source have been added correctly:
cl resources:get orders eqkykhrAwO -i payment_method,payment_source- Place the order:
cl resources:update orders/eqkykhrAwO -a _place=true