Vai al contenuto principale
- Quickstart

Quickstart API

Esegui il flusso di lavoro utile più piccolo: conferma il tuo token, importa una risorsa, associala a un prodotto Shopify e assegna i download a un ordine esistente.

1. Imposta il tuo URL di base e il token

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

2. Conferma l'autenticazione

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

Un ping riuscito conferma che il token può autenticarsi per il negozio approvato.

3. Importa una risorsa da un URL remoto

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. Interroga il processo di ingestione

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

5. Associa il file a un prodotto Shopify

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. Assegna i download a un ordine

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
  }'

Documentazione API

È stato utile?

Ancora bloccato? Scrivi a admin@alvaapps.com.

Ultimo aggiornamento 2026-06-05