Skip to main content
- Quickstart

API quickstart

Run the smallest useful workflow: confirm your token, import an asset, map it to a Shopify product, and assign downloads to an existing order.

1. Set your base URL and token

export ALVA_API_BASE="https://<app-host>/api/v1"
export ALVA_API_TOKEN="adk_live_<keyId>_<secret>"

2. Confirm authentication

curl "$ALVA_API_BASE/ping" \
  -H "Authorization: Bearer $ALVA_API_TOKEN"

A successful ping confirms the token can authenticate for the approved shop.

3. Import an asset from a remote URL

curl -X POST "$ALVA_API_BASE/assets" \
  -H "Authorization: Bearer $ALVA_API_TOKEN" \
  -H "Idempotency-Key: asset-$(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "source_url": "https://storage.example.com/products/video.mp4",
    "filename": "video.mp4",
    "content_type": "video/mp4",
    "title": "Video lesson"
  }'

4. Poll the ingest job

curl "$ALVA_API_BASE/jobs/<job_id>" \
  -H "Authorization: Bearer $ALVA_API_TOKEN"

5. Map the file to a Shopify product

curl -X POST "$ALVA_API_BASE/mappings" \
  -H "Authorization: Bearer $ALVA_API_TOKEN" \
  -H "Idempotency-Key: mapping-$(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "shopify_product_id": "gid://shopify/Product/1234567890",
    "shopify_variant_ids": [],
    "file_ids": [123],
    "pack_ids": [],
    "link_ids": [],
    "license_key_tag_ids": [],
    "download_type": "ZIP",
    "is_active": true
  }'

6. Assign downloads to an order

curl -X POST "$ALVA_API_BASE/orders/5501234567890/assignments" \
  -H "Authorization: Bearer $ALVA_API_TOKEN" \
  -H "Idempotency-Key: assign-$(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "shopify_customer_id": "777888999",
    "items": [
      { "shopify_product_id": "gid://shopify/Product/1234567890" }
    ],
    "send_email": false,
    "fraud_check": false
  }'

API docs

Was this helpful?

Still stuck? Email admin@alvaapps.com.

Last updated 2026-06-05