complete_checkout. The shopper places it.
How an order is placed
- Your agent calls
complete_checkoutwiththread_id,review_hashandtotalfrom the latest checkout read. - AgentMall checks them against the stored review and returns
status: "awaiting_confirmation"with aconfirm_url. - Your agent shows the
confirm_urlto the shopper. - The shopper opens it, sees the items, totals, address, delivery and card, and clicks Place order.
- AgentMall takes the order fee from your credit, submits the order to the merchant, and ends the thread.
complete_checkout. Once the merchant has answered, the thread ends and every call on it returns thread_ended. When the thread placed an order, the error carries its order_id. Pass that id to get_order. The message says ordered when the order was placed.
/orders/ord_….
To get a new link, call complete_checkout again. The new link replaces the old one.
States
get_order returns status:
merchant_status is the status text from the merchant’s order page, for example Shipped, when AgentMall could read it. permalink_url links to the order on the merchant site.
Reading an order
get_order takes the order id and no thread. On REST it is GET /v1/orders/:id. For a live order with a merchant order number, it opens the merchant’s order page and returns the live status and totals. When the page has no total, or the order has no merchant number yet, it returns the stored order.
A test order (test: true) is returned as stored. The merchant is never opened.
Order tracking (carrier and tracking number) is not available yet.
commit_unknown
The order was submitted to the merchant and AgentMall did not see a confirmation. It may exist at the merchant.
- Do not create a new thread and order the same items. That can place the order twice.
- The thread has ended, so calls on it return
thread_endedwith theorder_id. get_ordershowsunknownuntil AgentMall knows the outcome. The fee is not refunded while the outcome is unknown.