{
  "id": "doc-fk-001",
  "meta": { "lastModified": "2025-02-19T14:30:00Z" },
  "identifier": [
    { "system": "https://api-erp.kamsoft.pl/ns/company", "value": "FV/2025/0123" },
    { "system": "https://api-erp.kamsoft.pl/ns/origin", "value": "FK-EXT-456" }
  ],
  "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-type", "code": "invoice", "display": "Faktura" }] },
  "status": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-status", "code": "issued", "display": "Wystawiona" }] },
  "issueDate": "2025-02-19",
  "participant": [
    { "reference": "Party/supplier-01", "display": "Dostawca XYZ" },
    { "reference": "Party/customer-01", "display": "Odbiorca ABC" }
  ],
  "attachment": [],
  "position": [
    {
      "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-position-type", "code": "invoice-line", "display": "Wiersz faktury" }] },
      "positionNo": 1,
      "valueItem": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "quantity", "display": "Ilość" }] }, "valueQuantity": { "value": 1, "unit": "szt" } },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "unit-price", "display": "Cena jedn." }] }, "valueMoney": { "value": 1000, "currency": "PLN" } },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "net-amount", "display": "Kwota netto" }] }, "valueMoney": { "value": 1000, "currency": "PLN" } },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "vat-amount", "display": "Kwota VAT" }] }, "valueMoney": { "value": 230, "currency": "PLN" } }
      ],
      "valueCodeableConcept": [
        { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/vat-rate", "code": "23", "display": "23%" }] }
      ],
      "valueReference": [{ "reference": "Product/P-001", "display": "Produkt A" }],
      "valueString": "Usługa wg umowy"
    },
    {
      "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-position-type", "code": "vat-summary-line", "display": "Podsumowanie VAT" }] },
      "positionNo": 2,
      "valueItem": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "net-amount", "display": "Kwota netto" }] }, "valueMoney": { "value": 1000, "currency": "PLN" } },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/quantity-item-type", "code": "vat-amount", "display": "Kwota VAT" }] }, "valueMoney": { "value": 230, "currency": "PLN" } }
      ],
      "valueCodeableConcept": [
        { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/vat-rate", "code": "23", "display": "23%" }] }
      ]
    },
    {
      "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-position-type", "code": "allocation-item", "display": "Pozycja alokacji" }] },
      "positionNo": 3,
      "valueItem": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-item-type", "code": "cost-net-amount", "display": "Koszt netto" }] }, "valueMoney": { "value": 1000, "currency": "PLN" } },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-item-type", "code": "vat-amount-non-deductible", "display": "VAT nieodliczalny (stanowiący koszt)" }] }, "valueMoney": { "value": 300, "currency": "PLN" } }
      ],
      "valueAllocation": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-type", "code": "KR", "display": "Rodzaj kosztów" }] }, "weights": [{ "value": "401-01-01", "display": "Konsultacja medyczna", "weight": 1 }] },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-type", "code": "KO", "display": "Ośrodek kosztów" }] }, "weights": [{ "value": "501-01-01", "display": "Poradnia alergologiczna", "weight": 1 }] }
      ]
    },
    {
      "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-position-type", "code": "allocation-item", "display": "Pozycja alokacji" }] },
      "positionNo": 4,
      "valueItem": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-item-type", "code": "cost-gross-amount", "display": "Koszt brutto" }] }, "valueMoney": { "value": 1230, "currency": "PLN" } }
      ],
      "valueAllocation": [
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-type", "code": "KR", "display": "Rodzaj kosztów" }] }, "weights": [{ "value": "401-01-01", "display": "Konsultacja medyczna", "weight": 1 }] },
        { "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/allocation-type", "code": "KO", "display": "Ośrodek kosztów" }] }, "costCarriers": [{ "system": "https://api-erp.kamsoft.pl/ns/cost-carrier-item-type", "code": "area", "display": "Powierzchnia" }] }
      ]
    }
  ],
  "attribute": [
    { "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-attribute-type", "code": "total-net", "display": "Suma netto" }] }, "valueMoney": { "value": 1000, "currency": "PLN" } },
    { "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-attribute-type", "code": "total-vat", "display": "Suma VAT" }] }, "valueMoney": { "value": 230, "currency": "PLN" } },
    { "code": { "coding": [{ "system": "https://api-erp.kamsoft.pl/ns/document-attribute-type", "code": "total-gross", "display": "Suma brutto" }] }, "valueMoney": { "value": 1230, "currency": "PLN" } }
  ]
}
