Skip to content
Docs
API 1.0.0 · 22 Nov 2026

Search the docs

    Română

    Close and lock a month

    How a month is closed in Accounting, what your software sees on the way, and what happens to a document that arrives after the lock.

    Closing a month is done in Accounting by the people who own its checklist. The API has no operation for it: your software learns about it through events and through the refusals of a request. This guide follows one month from the point of view of an integration.

    1. The month starts closing

      The period changes from open to closing and you receive period.closing. Entries can still be posted into October 2026. Keep submitting documents of the month.

    2. The checklist is worked through

      The items are bank reconciled, VAT reconciled with documents, accruals, depreciation, stock valued. Documents you submitted late are the usual blocker: they hold the bank and the accruals items until they are posted or rejected.

    3. The month is locked

      Locking is refused while something blocks. When it succeeds you receive period.locked. Start the reports of the month now, not before.

    A document after the lock

    An invoice dated in the locked month can still arrive. A request dated in that month is refused with period_closed, and nothing is posted.

    A request into a locked month

    curl

    curl -X POST "$RDC_BASE_URL/accounting/v1/posting-requests" \
      -H "Authorization: Bearer $RDC_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
      "operationId": "2c37bd46-f931-4a04-a3a1-23a8808c258c",
      "postingRequestId": "e6708a6e-b4a1-4c2a-b4de-b73537dcf162",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "1ace2ba6-4133-40c1-b281-63264156db25",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "aa34ba23-cc63-4fb2-b78b-045551e8dbde",
      "effectiveDate": "2026-09-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a8201b6e-328f-4678-8596-e6c22e1721e9",
      "facts": [
        {
          "type": "document",
          "number": "BO-3188",
          "date": "2026-09-29"
        },
        {
          "type": "partner",
          "name": "Brânzeturi Obcina SRL",
          "vatId": "RO51603546"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "7310.00",
          "vat": "804.10"
        },
        {
          "type": "total",
          "gross": "8114.10"
        }
      ]
    }'

    JavaScript

    const response = await fetch(`${process.env.RDC_BASE_URL}/accounting/v1/posting-requests`, {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.RDC_TOKEN}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "operationId": "2c37bd46-f931-4a04-a3a1-23a8808c258c",
        "postingRequestId": "e6708a6e-b4a1-4c2a-b4de-b73537dcf162",
        "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
        "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
        "sourceDocumentId": "1ace2ba6-4133-40c1-b281-63264156db25",
        "sourceDocumentType": "supplier_invoice",
        "sourceRevision": 2,
        "eventId": "aa34ba23-cc63-4fb2-b78b-045551e8dbde",
        "effectiveDate": "2026-09-29",
        "currency": "RON",
        "mappingPolicyVersion": "ro-2026.1",
        "correlationId": "a8201b6e-328f-4678-8596-e6c22e1721e9",
        "facts": [
          {
            "type": "document",
            "number": "BO-3188",
            "date": "2026-09-29"
          },
          {
            "type": "partner",
            "name": "Brânzeturi Obcina SRL",
            "vatId": "RO51603546"
          },
          {
            "type": "amount",
            "rate": "11",
            "base": "7310.00",
            "vat": "804.10"
          },
          {
            "type": "total",
            "gross": "8114.10"
          }
        ]
      }),
    });
    const result = await response.json();

    Python

    import os
    import requests
    
    response = requests.request(
        'POST',
        f'{os.environ["RDC_BASE_URL"]}/accounting/v1/posting-requests',
        headers={
            'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
        },
        json={
            'operationId': '2c37bd46-f931-4a04-a3a1-23a8808c258c',
            'postingRequestId': 'e6708a6e-b4a1-4c2a-b4de-b73537dcf162',
            'customerOrgId': 'bdbc5b26-3f8a-4c1a-8c21-6c396293da32',
            'legalCompanyId': '8373a2b0-3239-4aee-b6c8-56d7829a746d',
            'sourceDocumentId': '1ace2ba6-4133-40c1-b281-63264156db25',
            'sourceDocumentType': 'supplier_invoice',
            'sourceRevision': 2,
            'eventId': 'aa34ba23-cc63-4fb2-b78b-045551e8dbde',
            'effectiveDate': '2026-09-29',
            'currency': 'RON',
            'mappingPolicyVersion': 'ro-2026.1',
            'correlationId': 'a8201b6e-328f-4678-8596-e6c22e1721e9',
            'facts': [
                {
                    'type': 'document',
                    'number': 'BO-3188',
                    'date': '2026-09-29',
                },
                {
                    'type': 'partner',
                    'name': 'Brânzeturi Obcina SRL',
                    'vatId': 'RO51603546',
                },
                {
                    'type': 'amount',
                    'rate': '11',
                    'base': '7310.00',
                    'vat': '804.10',
                },
                {
                    'type': 'total',
                    'gross': '8114.10',
                },
            ],
        },
    )
    result = response.json()

    PHP

    <?php
    
    $body = <<<'JSON'
    {
      "operationId": "2c37bd46-f931-4a04-a3a1-23a8808c258c",
      "postingRequestId": "e6708a6e-b4a1-4c2a-b4de-b73537dcf162",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "1ace2ba6-4133-40c1-b281-63264156db25",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "aa34ba23-cc63-4fb2-b78b-045551e8dbde",
      "effectiveDate": "2026-09-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a8201b6e-328f-4678-8596-e6c22e1721e9",
      "facts": [
        {
          "type": "document",
          "number": "BO-3188",
          "date": "2026-09-29"
        },
        {
          "type": "partner",
          "name": "Brânzeturi Obcina SRL",
          "vatId": "RO51603546"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "7310.00",
          "vat": "804.10"
        },
        {
          "type": "total",
          "gross": "8114.10"
        }
      ]
    }
    JSON;
    
    $curl = curl_init(getenv('RDC_BASE_URL') . '/accounting/v1/posting-requests');
    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")}/accounting/v1/posting-requests");
    request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
    request.Content = new StringContent("""
    {
      "operationId": "2c37bd46-f931-4a04-a3a1-23a8808c258c",
      "postingRequestId": "e6708a6e-b4a1-4c2a-b4de-b73537dcf162",
      "customerOrgId": "bdbc5b26-3f8a-4c1a-8c21-6c396293da32",
      "legalCompanyId": "8373a2b0-3239-4aee-b6c8-56d7829a746d",
      "sourceDocumentId": "1ace2ba6-4133-40c1-b281-63264156db25",
      "sourceDocumentType": "supplier_invoice",
      "sourceRevision": 2,
      "eventId": "aa34ba23-cc63-4fb2-b78b-045551e8dbde",
      "effectiveDate": "2026-09-29",
      "currency": "RON",
      "mappingPolicyVersion": "ro-2026.1",
      "correlationId": "a8201b6e-328f-4678-8596-e6c22e1721e9",
      "facts": [
        {
          "type": "document",
          "number": "BO-3188",
          "date": "2026-09-29"
        },
        {
          "type": "partner",
          "name": "Brânzeturi Obcina SRL",
          "vatId": "RO51603546"
        },
        {
          "type": "amount",
          "rate": "11",
          "base": "7310.00",
          "vat": "804.10"
        },
        {
          "type": "total",
          "gross": "8114.10"
        }
      ]
    }
    """, System.Text.Encoding.UTF8, "application/json");
    var response = await client.SendAsync(request);
    var result = await response.Content.ReadAsStringAsync();

    Response 409

    {
      "code": "period_closed",
      "message": "The period of the date is locked, or there is no period for it. Nothing is posted into it.",
      "requestId": "29c05286-9358-40ef-ace1-708027844f4c"
    }

    Send the same facts again with the date of the first open month in effectiveDate, a new postingRequestId and a new operationId. The document fact keeps the date printed on the invoice, so the entry is dated when it was posted and the invoice keeps its own date.