The order management system implements three REST APIs (known as middleware in Node.js parlance) to provide inventory and shipping method information to clients. These are as follows:
/shipping_methods
: This returns the list of supported shipping methods/inventory
: This returns the product catalog/product_image/<image_name>
: This returns the image used to represent a product to the user
When the client app is launched, it requests the list of shipping methods supported by the system (the application:didFinishLaunchingWithOptions:
method in AppDelegate.m
). Before displaying the list of the available products in the product list screen, the app requests the product catalog (the viewDidLoad
method in ProductList.m
). When the app is about to display the card for a particular product (after the user selects a product in the product list screen), it requests the product's image from the server (the viewDidLoad
method in ProductCard.m
).