• GuideBreaking change in 2.0.0: the tax ID is required
  • GuideAccess
  • GuideKey scopes
  • GuideLocking a key to your network addresses
  • GuideErrors
  • GuideRate limits
  • GuideSafe retries (Idempotency-Key)
  • GuidePages
  • GuideWebhooks
  • GuideCheck the signature
  • GuideA receiver to start from
  • GuideSandbox
  • RecipeYour first call in 5 minutesMake a sandbox key and list your merchants.
  • RecipeStart a review and wait for review.readyStart a website review, get told when it is done, read the findings and download the report.
  • RecipeVerify webhook signaturesProve a delivery came from Kvali, answer fast and handle retries once.
  • RecipeSend a merchant's documentsUpload a registration certificate or bank letter in two steps.
  • RecipeMonitoring: checks, changes, alerts, violationsLearn what monitoring found about your live merchants, without missing or repeating a row.
  • RecipeRetries, idempotency, pages and rate limitsA small client that retries safely, pages through lists and stays under the limit.
  • RecipeLock a key to your network addressesMake a stolen key useless outside your own network.
  • RecipeFrom sandbox to liveThe checks to pass in the sandbox, then the switch to production keys.

↑ ↓ to move · Enter to open · Esc to close

Send a merchant's documents

Upload a registration certificate or bank letter in two steps.

10 minScope: reviews

What you get

  • A merchant's file in Kvali, shown as "from your system (API)".
  • Kvali's document check started on it.
  • What the check found, from the merchant.
  1. Ask for an upload address

    Send the file's name and size. PDF, Word (.docx), JPG, PNG or WebP, at most 10 MB. The answer has an upload_id, a one-time upload_url and the content_type to send.

    Request and answer
    curl -X POST "https://aikvali.com/api/v1/merchants/3f0c2a52-6a1e-4c1b-9d55-2f7f5b1e9a10/documents/uploads" \
      -H "Authorization: Bearer $KVALI_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{"file_name":"registration.pdf","size":482113}'
  2. PUT the file's bytes

    Within 2 hours, PUT the bytes to upload_url with the header Content-Type: <content_type>. No API key here: the address itself is the permission, for this one file. It is on Kvali's file storage host; if your network only lets known hosts out, allow it too.

    Code
    curl -X PUT "$UPLOAD_URL" \
      -H "Content-Type: application/pdf" \
      --data-binary @registration.pdf
  3. Confirm the upload

    Confirm with the upload_id and the document's kind. Kvali checks the bytes, keeps the file in your organisation's private folder and starts its document check (202). The same file twice is kept once (created: false). 409 means nothing was uploaded yet, the upload expired, or it was already confirmed.

    Request and answer
    curl -X POST "https://aikvali.com/api/v1/merchants/3f0c2a52-6a1e-4c1b-9d55-2f7f5b1e9a10/documents" \
      -H "Authorization: Bearer $KVALI_KEY" \
      -H "Content-Type: application/json" \
      -H "Idempotency-Key: $(uuidgen)" \
      -d '{"upload_id":"3f0c2a52-6a1e-4c1b-9d55-2f7f5b1e9a10","kind":"registration_certificate"}'
  4. Read what the check found

    A minute later, GET /merchants/{id} lists the merchant's documents, each with its check, the signals read and any problems found against what Kvali holds.

    Code
    curl "https://aikvali.com/api/v1/merchants/3f0c2a52-6a1e-4c1b-9d55-2f7f5b1e9a10" \
      -H "Authorization: Bearer $KVALI_KEY"