Alipay+ DocsAlipay+ Docs

iMock

Use iMock to simulate different API call results that are caused by specific values of key request parameters. When you send an API request containing one of the values, iMock returns the corresponding result.

Note:

  • Use iTest to send API requests to receive the results that are simulated by iMock. For how to use iTest, see iTest.
  • If you use other tools such as Postman to send API requests, you need to add the following parameters in the request headers: loadmode: 2, markuid: 0A, and instmock: O.

On the Sandbox > Tools > iMock page, follow these steps:

  1. Select an API.

image.png

  1. The list shows different values of the key request parameters and the responding result codes in the response. You can click View Details to see the complete request body and response body.

image.png

  1. Set the API Mocking duration. The duration can be 30 mins, 60 mins, 90 mins, or 120 mins. iMock is turned off automatically when the time is up.

image.png

  1. Turn on iMock by switching the Off button to On.

image.png