Test orders
On Yandex. Market, you can test the store and its API on test orders before you start working with real ones. You can emulate the following processes:
- making an order on behalf of the buyer — add items to the cart, choose payment methods and delivery terms;
- cancellation of the order.
Yandex. Market does not charge for such orders. And errors in working with them do not affect the checks and are not used in calculating the quality index.
To go to the debugging interface, in the merchant's office on the Market, click on the icon of your account → Settings and in the menu on the left, select APIs and modules → Test order.
All orders created in the debugging interface are sent to the store with the value true the parameter fake, which allows the store to distinguish such orders from the real ones.
Данные по тестовым заказам
If you have API notifications enabled, yandex.Market will send you a request. POST notification with information about events also for test orders. How to work with notifications
However, methods that return information on orders do not include data on test orders by default. To get them, pass the value true in the parameter fake.
Limitations
Information about test orders and request logs are stored for 10 days.
How to debug
1. Create a new order
On the page APIs and modules → Test order:
-
Select a store from the drop-down list and click Choose.
-
Select the products from the list and click Add to Cart.
-
If necessary, specify the required quantity of the product and click To the registration.
-
Choose the terms of delivery (free shipping from Yandex. Market or Courier). This is an imitation of an order — The terms of delivery are not linked to the actual settings of the warehouse, store, or cabinet.
-
Check the data and click Pay by card. For a test order, only payment with a test card is available, the money is not debited.
After that, a notification about the creation of a new order and its number will appear on the page. You can go to the order page or place a new test order.
2. Process the order
После каждого запроса проверяйте лог
If the integration is not configured correctly, you will see errors in the log that need to be fixed. To view the log, in the merchant's office on the Market, click on the icon of your account → Settings and in the menu on the left, select APIs and modules → tab Query log.
-
Send a request POST v1/businesses/{businessId}/orders c
orderIdsand save the parcel ID (idinshipments) from the response. -
Send a request PUT v2/campaigns/{campaignId}/orders/{orderId}/boxes, where to transmit:
- the received ID.
- information about the distribution of goods from the order by boxes;
- if there are products that are subject to labeling, then the labeling codes for these products.
-
Confirm that you are ready for shipment by sending the status
PROCESSINGwith a sub-statusREADY_TO_SHIPusing a request PUT v2/campaigns/{campaignId}/orders/{orderId}/status. -
If in the future you will ship orders to a sorting center or a pick-up point or transfer them to Market couriers from your warehouse, send a request PUT v2/campaigns/{campaignId}/orders/{orderId}/status. Send the status in it
PROCESSINGwith a sub-statusSHIPPED.
3. Cancel the order
Send a request PUT v2/campaigns/{campaignId}/orders/{orderId}/status and send the status CANCELLED with the reason for cancellation SHOP_FAILED. A test order can only be cancelled before it is upgraded to the status PROCESSING with a sub-status:
-
SHIPPEDif in the future you will ship orders to a sorting center or a pick-up point or transfer them to Market couriers from your warehouse; -
READY_TO_SHIPif your store is connected to express delivery and you will ship orders to couriers Yandex Go.
Check for errors — in the seller's account on the Market, click on the icon of your account → Settings and in the menu on the left, select APIs and modules → tab Query log — and fix them.
Events for which Yandex.Market sends notifications:
- creating a new order;
- changing the order;
- changing the order status;
- creating a new chat with a customer;
- adding a new chat message;
- the beginning of the dispute;
- ending the dispute;
- creating a new product review;
- creating a new review comment;
- creating an order cancellation request;
- order cancellation;
- creating a new non-purchase or refund;
- changing the non-purchase or refund status.