Skip to content

Test function

POST/admin/v1/stores/{store_id}/functions/{function_id}/test
  • functions:manage
  • Idempotency-Key supported

Runs a function once with the given input and shows what checkout would apply. Nothing is recorded.

Path parameters

  • store_idstringrequired

    The store's ID, like store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.

  • function_idstringrequired

    The function's ID, like fn_01k8qs5s….

Headers

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • inputanyrequired

    What the function reads on standard input, e.g. { "version": 1, "cart": { … } }.

Returns

200 How the run went.