Ga naar hoofdinhoud
- Quickstart

API-quickstart

Voer de kleinste nuttige workflow uit: bevestig je token, importeer een asset, koppel het aan een Shopify-product en wijs downloads toe aan een bestaande bestelling.

1. Stel je basis-URL en token in

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

2. Authenticatie bevestigen

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

Een geslaagde ping bevestigt dat de token kan authenticeren voor de goedgekeurde winkel.

3. Importeer een asset vanaf een externe 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. Vraag de ingest-taak op

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

5. Koppel het bestand aan een 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. Wijs downloads toe aan een bestelling

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-documentatie

Was dit nuttig?

Nog vastgelopen? Mail admin@alvaapps.com.

Laatst bijgewerkt 2026-06-05