Skip to main content
An order exists once the shopper confirms a checkout. Your agent asks for the order with complete_checkout. The shopper places it.

How an order is placed

  1. Your agent calls complete_checkout with thread_id, review_hash and total from the latest checkout read.
  2. AgentMall checks them against the stored review and returns status: "awaiting_confirmation" with a confirm_url.
  3. Your agent shows the confirm_url to the shopper.
  4. The shopper opens it, sees the items, totals, address, delivery and card, and clicks Place order.
  5. AgentMall takes the order fee from your credit, submits the order to the merchant, and ends the thread.
The link works once. Steps 4 and 5 happen in the shopper’s browser, so your agent does not get the result from 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.
The order is also listed on the console Orders page. Each row links to /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_ended with the order_id.
  • get_order shows unknown until AgentMall knows the outcome. The fee is not refunded while the outcome is unknown.
Tell the shopper the order may have gone through and to check their merchant account.

Returns

Returns, refunds and cancellations are not available through AgentMall. The shopper handles them with the merchant directly.