Developers

Guides

Markdown

Digital products and delivery

How your app reads the codes and links delivered to the customer, and resends them through another channel when needed.

When you need it

Stores that sell gift cards, subscriptions and files deliver a code or link to the customer as soon as the order is paid. Messaging and support apps need to resend that content to the customer over WhatsApp or SMS, or show it to a support agent.

The scope is orders.digital:read, which requires orders:read.

Read the content

cURL
curl "https://larm.sa/stores/$STORE_ID/v1/orders/ord_8Kd2/digital-items" \
  -H "Authorization: Bearer $ACCESS_TOKEN"
JSON
{
  "data": {
    "order_id": "ord_8Kd2",
    "items": [
      { "product_id": "311", "name": "Top-up card 100 SAR", "type": "code", "value": "X7Q2-9KLM-4PZT", "expires_at": null },
      { "product_id": "402", "name": "User guide", "type": "file", "value": "https://store.example/d/…", "expires_at": null }
    ]
  },
  "meta": { "request_id": "…" }
}
typevalue
codeThe code itself
linkThe subscription or service link
fileA download link signed for this order and this file
textText the merchant wrote for the product
  • An unpaid order returns 409 ORDER_NOT_PAID.
  • File links are signed for the order and checked on download. Treat them like a password: send them to the customer, never publish them, and read them again when needed instead of storing them.
  • expires_at is null today for every type. Code that reads it should already handle a time, so a future expiry needs no change on your side.

With the webhook

Instead of reading on every order, subscribe to [order.digital.delivered](/events/order-digital-delivered). When your installation holds orders.digital:read, the webhook carries digital_items directly, so you do not need a second request.

    ↑↓ moveEnter openEsc close