Skip to content

Common recipes

Step-by-step API v2 recipes: troubleshoot a missing delivery, resend a download email, revoke access, change download limits, count orders and licence keys, and edit customer-facing texts.

Last updated

Paths are relative to https://app.filemonk.io/api/v2/external, and every call needs your key in the X-Auth-Token header. Remember that # is written %23 in a URL, so order #1042 is /orders/%231042.

  1. Run the troubleshooter

    GET /orders/:id/troubleshoot checks Shopify, the stored order, the product’s files, the order conditions, access, cancellation and whether a download email went out. It ends with a diagnosis that names the request that fixes each finding.

    Terminal window
    curl 'https://app.filemonk.io/api/v2/external/orders/%231042/troubleshoot' \
    -H 'X-Auth-Token: fm_api_key_your_key_here'
  2. Look at the emails

    GET /emails?order_id=<order> lists the emails for the order. Read each email’s status: bounced, rejected or complained means the address failed. No row at all means no email was sent.

  3. Check the files and the downloads

    GET /orders/:id/downloads lists the files the buyer can get. GET /download_logs?order_id=<order> shows whether they downloaded them anyway.

  4. Resend if you need to

    POST /orders/:id/send_email sends the download email again, optionally to another address with to. It really emails the buyer, so do it once you are sure.

Terminal window
curl -X POST 'https://app.filemonk.io/api/v2/external/orders/%231042/send_email' \
-H 'X-Auth-Token: fm_api_key_your_key_here' \
-H 'Content-Type: application/json' \
-d '{"to": "buyer@example.com"}'

Leave out to to send it to the address on the order. For many orders at once, use POST /orders/send_emails.

  1. GET /settings and check email.enabled.
  2. GET /digital_products and check each product’s files_count. A product with no files delivers nothing.
  3. Turn emails on with PATCH /settings and {"email": {"enabled": true}}.
  4. Send yourself a sample with POST /settings/test_email.

POST /orders/:id/reset_downloads sets the order’s download counts back to zero. To change the limits for every order, see Change the download limit.

There is no separate revoke action. Access is state, so you set it with a PATCH:

Terminal window
curl -X PATCH 'https://app.filemonk.io/api/v2/external/orders/%231042' \
-H 'X-Auth-Token: fm_api_key_your_key_here' \
-H 'Content-Type: application/json' \
-d '{"access": {"revoked": true}}'

Send {"access": {"revoked": false}} to restore it.

Terminal window
curl -X PATCH 'https://app.filemonk.io/api/v2/external/settings' \
-H 'X-Auth-Token: fm_api_key_your_key_here' \
-H 'Content-Type: application/json' \
-d '{"download_limits": {"per_file_count": 3, "days": 30}}'

per_file_count is how many times each file can be downloaded, and days is how many days after the order the files stay available. null on either means unlimited. show only decides whether the download page displays the limits to the buyer; it does not turn them on or off.

  1. Read the texts for a language: GET /settings/texts?locale=de.
  2. Change the one you want. Fields you leave out are untouched:
    {
    "locale": "de",
    "texts": { "download_page": { "texts": { "thanks": "Danke für deinen Einkauf!" } } }
    }
    sent with PATCH /settings/texts.

The heading or intro line of the download page is download_page.texts.thanks. Email wording is under email.* (subject, body). Read the tree first and use the key whose current text matches what you want to change.

How many orders do I have, and which is the latest?

Section titled “How many orders do I have, and which is the latest?”
Terminal window
curl 'https://app.filemonk.io/api/v2/external/orders?per_page=1' \
-H 'X-Auth-Token: fm_api_key_your_key_here'

Read meta.total_count for the count; the one record in data is the newest. The list is newest first by ordered_at, when the buyer ordered. Use sort=created_at desc to order by when Filemonk recorded it. See Pagination and sorting.

GET /licence_tags and read totals.pending. That number is shop-wide and filters do not change it. For one tag, read that tag’s licences.pending. total includes keys already assigned or used, so it is not the number left.

POST /orders/:id/licences/assign assigns the keys the order is still owed. To give it one specific key, PUT /orders/:id/licences/:licence_id. To take one back, DELETE the same path (this one previews first).

POST /licences/check tells you whether a key is valid and where it went; GET /licences/lookup finds a key by its value.

See AI connectors (MCP).

Was this page helpful?

Still stuck? Ask Quinn or chat with support