Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Receive goods

    Post a goods receipt, and what to do when a balance moved while the receipt was waiting.

    On this page

    A receipt adds to what is on hand at a location and changes what is available. Your ERP sends it when a goods receipt is confirmed; the receipt document is the source.

    Post the receipt

    1. Read the balances

      Read the availability of each item and location on the receipt, and keep each revision.

    2. Choose the operationId

      Create it when you decide to post the receipt and store it with the receipt, so that after a timeout your software sends the same command again and the receipt is posted once.

    3. Send it

      One line per item and location. A location is named once per item in a command.

    curl

    curl -X POST "$RDC_BASE_URL/inventory/v1/receipts" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "4bfa0af7-a8f7-4d84-ae30-792b7a99b286",
      "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
      "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
      "occurredAt": "2026-11-23T07:26:00Z",
      "source": {
        "service": "erp",
        "documentId": "978dd1f4-5f65-4307-9b96-beb995212227",
        "documentType": "goods-receipt",
        "documentRevision": 1
      },
      "actor": {
        "serviceId": "brumar-erp",
        "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
      },
      "lines": [
        {
          "productId": "11079e9a-344b-409c-8da5-e8335a7846b1",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "100",
          "expectedRevision": 7
        },
        {
          "productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "60",
          "expectedRevision": 7
        },
        {
          "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "40",
          "expectedRevision": 3
        }
      ]
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/inventory/v1/receipts`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "4bfa0af7-a8f7-4d84-ae30-792b7a99b286",
        "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
        "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
        "occurredAt": "2026-11-23T07:26:00Z",
        "source": {
          "service": "erp",
          "documentId": "978dd1f4-5f65-4307-9b96-beb995212227",
          "documentType": "goods-receipt",
          "documentRevision": 1
        },
        "actor": {
          "serviceId": "brumar-erp",
          "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
        },
        "lines": [
          {
            "productId": "11079e9a-344b-409c-8da5-e8335a7846b1",
            "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
            "quantity": "100",
            "expectedRevision": 7
          },
          {
            "productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
            "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
            "quantity": "60",
            "expectedRevision": 7
          },
          {
            "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
            "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
            "quantity": "40",
            "expectedRevision": 3
          }
        ]
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/inventory/v1/receipts',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '4bfa0af7-a8f7-4d84-ae30-792b7a99b286',
            'customerOrgId': '690fa0e3-547f-4f93-96b7-824475cc3d7c',
            'legalCompanyId': 'd84ba982-ca9a-4e91-9566-21bd23f7227b',
            'occurredAt': '2026-11-23T07:26:00Z',
            'source': {
                'service': 'erp',
                'documentId': '978dd1f4-5f65-4307-9b96-beb995212227',
                'documentType': 'goods-receipt',
                'documentRevision': 1,
            },
            'actor': {
                'serviceId': 'brumar-erp',
                'userId': '376a64f7-268a-4f79-808e-0d89162055ac',
            },
            'lines': [
                {
                    'productId': '11079e9a-344b-409c-8da5-e8335a7846b1',
                    'locationId': 'b006344d-2fae-4970-bb6f-c32877084b4f',
                    'quantity': '100',
                    'expectedRevision': 7,
                },
                {
                    'productId': '6cbfcba3-55fd-4cf0-9709-6e75c9717bb3',
                    'locationId': 'b006344d-2fae-4970-bb6f-c32877084b4f',
                    'quantity': '60',
                    'expectedRevision': 7,
                },
                {
                    'productId': '109ebad9-6627-4ac3-817e-f81ad628676b',
                    'locationId': 'b006344d-2fae-4970-bb6f-c32877084b4f',
                    'quantity': '40',
                    'expectedRevision': 3,
                },
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "4bfa0af7-a8f7-4d84-ae30-792b7a99b286",
      "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
      "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
      "occurredAt": "2026-11-23T07:26:00Z",
      "source": {
        "service": "erp",
        "documentId": "978dd1f4-5f65-4307-9b96-beb995212227",
        "documentType": "goods-receipt",
        "documentRevision": 1
      },
      "actor": {
        "serviceId": "brumar-erp",
        "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
      },
      "lines": [
        {
          "productId": "11079e9a-344b-409c-8da5-e8335a7846b1",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "100",
          "expectedRevision": 7
        },
        {
          "productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "60",
          "expectedRevision": 7
        },
        {
          "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "40",
          "expectedRevision": 3
        }
      ]
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/inventory/v1/receipts');
    curl_setopt_array($curl, [
        CURLOPT_CUSTOMREQUEST => 'POST',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('RDC_TOKEN'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => $body,
    ]);
    $result = json_decode(curl_exec($curl), true);
    curl_close($curl);

    C#

    using System.Net.Http.Headers;
    
    var client = new HttpClient();
    var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/inventory/v1/receipts");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "4bfa0af7-a8f7-4d84-ae30-792b7a99b286",
      "customerOrgId": "690fa0e3-547f-4f93-96b7-824475cc3d7c",
      "legalCompanyId": "d84ba982-ca9a-4e91-9566-21bd23f7227b",
      "occurredAt": "2026-11-23T07:26:00Z",
      "source": {
        "service": "erp",
        "documentId": "978dd1f4-5f65-4307-9b96-beb995212227",
        "documentType": "goods-receipt",
        "documentRevision": 1
      },
      "actor": {
        "serviceId": "brumar-erp",
        "userId": "376a64f7-268a-4f79-808e-0d89162055ac"
      },
      "lines": [
        {
          "productId": "11079e9a-344b-409c-8da5-e8335a7846b1",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "100",
          "expectedRevision": 7
        },
        {
          "productId": "6cbfcba3-55fd-4cf0-9709-6e75c9717bb3",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "60",
          "expectedRevision": 7
        },
        {
          "productId": "109ebad9-6627-4ac3-817e-f81ad628676b",
          "locationId": "b006344d-2fae-4970-bb6f-c32877084b4f",
          "quantity": "40",
          "expectedRevision": 3
        }
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 202

    {
      "operationId": "4bfa0af7-a8f7-4d84-ae30-792b7a99b286",
      "status": "completed",
      "aggregateRevision": 8,
      "movementIds": [
        "cd93538c-9b49-4605-97b7-b9b2eb2ea9d6",
        "ead9c438-3b01-4074-8613-c6e7d090fd80",
        "b02ec58f-c921-4591-899e-22679fccb209"
      ]
    }

    The result lists one movement per line. aggregateRevision is the highest revision any of the balances reached.

    When a balance moved

    A receipt can wait: the revision you read may be old when it is posted. If a sale landed on one of its balances in between, the answer is a 409 with revision_conflict and nothing is posted, not even the lines whose balances did not move.

    1. Read again

      Read the availability of the balances on the receipt.

    2. Send the receipt again

      Send it with the new revisions and a new operationId. The refused command changed nothing and left no record, so nothing is posted twice.

    A wrong receipt

    A receipt cannot be edited. Reverse its movements, then post the right receipt. A reversal is refused with insufficient_available_stock if the goods have already been sold on. See Reverse a movement.