Przejdź do treści

Przykłady cen produktu (ProductPricing)

Przykłady ProductPricing: osadzony w contained produktu; postać samodzielna i koperta zbiorcza są poza zakresem API.ERP (brak endpointu). System kodów: price-type, product-pricing-context.

Reguły contained: DomainResource §3.


1. Ceny w contained — ProductDefinition

Typowy przypadek: ProductPricing w contained ProductDefinition. Lokalne id (pp-retail); bez identifier i product.

{
  "resourceType": "ProductDefinition",
  "id": "pd-good-001",
  "meta": { "lastModified": "2026-06-01T10:00:00Z" },
  "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/product-type", "code": "good" }] },
  "status": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/status", "code": "active" }] },
  "identifier": [
    { "system": "https://api-erp.kamsoft.pl/vs/company", "value": "TOW-001" }
  ],
  "name": "Środek czyszczący 5L",
  "attribute": [
    {
      "code": { "coding": [{ "code": "unit-of-measure" }] },
      "valueCodeableConcept": [{ "coding": [{ "code": "szt" }] }]
    },
    {
      "code": { "coding": [{ "code": "vat-rate" }] },
      "valueCodeableConcept": [{ "coding": [{ "code": "23" }] }]
    }
  ],
  "contained": [
    {
      "resourceType": "ProductPricing",
      "id": "pp-retail",
      "status": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/status", "code": "active" }] },
      "context": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/product-pricing-context", "code": "sale", "display": "Sprzedaż" }] },
      "period": { "start": "2026-01-01", "end": "2026-12-31" },
      "price": [
        {
          "type": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/price-type", "code": "unit-price-net" }] },
          "amount": { "value": 49.99, "currency": "PLN" }
        },
        {
          "type": { "coding": [{ "code": "promotional" }] },
          "amount": { "value": 39.99, "currency": "PLN" },
          "period": { "end": "2026-03-31" }
        }
      ],
      "vatInclusion": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/vat-inclusion", "code": "exclusive" }] }
    }
  ]
}

Referencja do cen z pozycji dokumentu: ProductDefinition/pd-good-001#pp-retail.


2. Ceny partii w contained — Product

Cena wyprzedaży partii — ProductPricing w contained ProductDefinition (prod-batch-001).

{
  "resourceType": "Product",
  "id": "prod-batch-001",
  "productDefinition": { "reference": "ProductDefinition/pd-good-001", "display": "Środek czyszczący 5L" },
  "identifier": [
    { "system": "https://api-erp.kamsoft.pl/vs/company", "value": "PART-2025-02-001" }
  ],
  "attribute": [
    {
      "code": { "coding": [{ "code": "batch-number" }] },
      "valueString": "PART-2025-02-001"
    },
    {
      "code": { "coding": [{ "code": "expiry-date" }] },
      "valueString": "2026-06-30"
    }
  ],
  "contained": [
    {
      "resourceType": "ProductPricing",
      "id": "pp-clearance",
      "status": { "coding": [{ "code": "active" }] },
      "context": { "coding": [{ "code": "sale" }] },
      "price": [
        {
          "type": { "coding": [{ "code": "promotional" }] },
          "amount": { "value": 29.99, "currency": "PLN" },
          "period": { "end": "2026-06-30" }
        }
      ],
      "vatInclusion": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/vat-inclusion", "code": "exclusive" }] }
    }
  ]
}

3. Zasób samodzielny (Bundle / rejestr cen)

Gdy ProductPricing występuje jako osobny element contained (postać samodzielna poza zakresem API.ERP): pole product (wymagane), opcjonalnie identifier.

{
  "resourceType": "ProductPricing",
  "id": "pp-pd-good-001-retail",
  "identifier": [{ "system": "https://api-erp.kamsoft.pl/vs/company", "value": "PRICE-TOW-001-RETAIL" }],
  "product": {
    "reference": "ProductDefinition/pd-good-001",
    "type": "ProductDefinition",
    "display": "Środek czyszczący 5L"
  },
  "status": { "coding": [{ "code": "active" }] },
  "context": { "coding": [{ "code": "sale" }] },
  "period": { "start": "2026-01-01", "end": "2026-12-31" },
  "price": [
    {
      "type": { "coding": [{ "code": "unit" }] },
      "amount": { "value": 49.99, "currency": "PLN" }
    }
  ], 
  "vatInclusion": { "coding": [{ "system": "https://api-erp.kamsoft.pl/vs/vat-inclusion", "code": "exclusive" }] }
}

5. Odniesienia