跳转到内容

e-HDM API

With the VCR REST API, your website, CRM or accounting system files fiscal receipts with the State Revenue Committee itself. One HTTP request, one receipt: the response carries the fiscal number and the receipt link. The API is free, and so is VCR.

What the API does

  • Sales, paid in cash, by card or mixed, with the receipt emailed to the buyer.
  • Refunds, full or partial, naming the lines.
  • Prepayments: taking one, checking the balance, applying it to a sale, refunding it.
  • Catalogue, departments, cashiers: create and edit them. A sale can describe a new product inline, and it is added to the catalogue along with the receipt.
  • Classifier search and the Central Bank of Armenia rate for sales in other currencies.
  • Register management: activation, certificate upload, closure.

How it works

  • JSON over HTTPS, with the key in the X-API-Key header. Amounts and quantities travel as strings, so nothing is lost to rounding.
  • An Idempotency-Key header: repeating the same request with the same key does not create a second receipt.
  • Errors name the exact field that failed, not a bare "400".
  • The full specification in OpenAPI format: /api/v1/openapi.json.

Official SDKs

TypeScript / Node.js
@blob-solutions/vcr-am-sdknpm
PHP
blob-solutions/vcr-am-sdkPackagist
Laravel
blob-solutions/laravel-vcr-am
WordPress
the ready-made WooCommerce plugin, no code needed.

For other languages, generate a client from the OpenAPI specification.

How to start

  1. 1
    Create a register in VCR. Start with a sandbox one: it works without the tax authority, and its receipts are marked TEST.
  2. 2
    Create an API key under "API keys" for your business and send your first sale, using the example below.

    Your first sale

    bash
    curl https://vcr.am/api/v1/sales \
      -H "X-API-Key: $VCR_AM_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "cashier": { "id": 1 },
        "items": [{
          "offer": { "externalId": "SKU-001" },
          "department": { "id": 1 },
          "quantity": "1",
          "price": "20000",
          "unit": "pc"
        }],
        "amount": { "nonCash": "20000" },
        "buyer": {
          "type": "individual",
          "receipt": { "email": "buyer@example.com", "language": "en" }
        }
      }'
  3. 3
    Register the real register with the tax authority (how to register an e-HDM) and switch the integration to its key. The requests look the same.

The details are in the API documentation. If you integrate many businesses at once, see the Partner API.

常见问题

How much does the API cost?

The API is free, and so is VCR: no monthly fee and no per-request fee.

Can I try it without registering with the tax authority?

Yes. A sandbox register works without the tax authority through the same API, and its receipts are marked TEST.

Which programming languages are supported?

Any that can send an HTTPS request. There are official SDKs for TypeScript, PHP and Laravel; for others, generate a client from the OpenAPI specification.

What if a request is repeated after a dropped connection?

Send the same Idempotency-Key header: repeating the same request does not create a second receipt.

I am an integrator working with many businesses.

That is what the Partner API is for: each business keeps ownership of its account and grants you access.