Cost Ledger

The cost ledger resource.

Basehttps://rest.carbon.ms/costLedger
GET/costLedger

List cost ledgers

Retrieve a paginated list of cost ledgers. Filter, order, and select columns with PostgREST query parameters.

Query parameters

selectstring

Comma-separated columns to return. Defaults to all.

orderstring

Column to sort by, e.g. `createdAt.desc`.

limitinteger

Maximum rows to return.

offsetinteger

Rows to skip, for pagination.

GEThttps://rest.carbon.ms/costLedger
curl --request GET \
  --url 'https://rest.carbon.ms/costLedger?select=*&limit=10' \
  --header 'Authorization: Bearer <api-key>'
Response
[
  {
    "id": "abc123def456",
    "entryNumber": 0,
    "postingDate": "2026-01-01",
    "itemLedgerType": "string",
    "costLedgerType": "string",
    "adjustment": true,
    "quantity": 10,
    "cost": 0
  }
]
GET/costLedger

Retrieve a cost ledger

Fetch a single cost ledger by filtering on `id`.

Query parameters

idstring

Match on the cost ledger's `id`, e.g. `eq.{id}`.

GEThttps://rest.carbon.ms/costLedger
curl --request GET \
  --url 'https://rest.carbon.ms/costLedger?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
Response
{
  "id": "abc123def456",
  "entryNumber": 0,
  "postingDate": "2026-01-01",
  "itemLedgerType": "string",
  "costLedgerType": "string",
  "adjustment": true,
  "quantity": 10,
  "cost": 0
}
POST/costLedger

Create a cost ledger

Create a new cost ledger.

Body parameters

entryNumbernumberrequired
postingDatedaterequired
itemLedgerTypeitemLedgerTyperequired
costLedgerTypecostLedgerTyperequired
adjustmentbooleanrequired
documentTypeitemLedgerDocumentType
documentIdstring
externalDocumentIdstring
itemIdstring
quantitynumberrequired
costnumberrequired
nominalCostnumberrequired
companyIdstringrequired

References company.id

supplierIdstring

References supplier.id

remainingQuantitynumberrequired
POSThttps://rest.carbon.ms/costLedger
curl --request POST \
  --url https://rest.carbon.ms/costLedger \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"entryNumber":0,"postingDate":"2026-01-01","itemLedgerType":"string","costLedgerType":"string","adjustment":true,"quantity":10,"cost":0,"nominalCost":0,"companyId":"xyz789","remainingQuantity":10}'
Response
{
  "id": "abc123def456",
  "entryNumber": 0,
  "postingDate": "2026-01-01",
  "itemLedgerType": "string",
  "costLedgerType": "string",
  "adjustment": true,
  "quantity": 10,
  "cost": 0
}
PATCH/costLedger

Update a cost ledger

Update an existing cost ledger, matched on `id`.

Body parameters

entryNumbernumberrequired
postingDatedaterequired
itemLedgerTypeitemLedgerTyperequired
costLedgerTypecostLedgerTyperequired
adjustmentbooleanrequired
documentTypeitemLedgerDocumentType
documentIdstring
externalDocumentIdstring
itemIdstring
quantitynumberrequired
costnumberrequired
nominalCostnumberrequired
companyIdstringrequired

References company.id

supplierIdstring

References supplier.id

remainingQuantitynumberrequired
PATCHhttps://rest.carbon.ms/costLedger
curl --request PATCH \
  --url 'https://rest.carbon.ms/costLedger?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>' \
  --header 'Content-Type: application/json' \
  --header 'Prefer: return=representation' \
  --data '{"entryNumber":0}'
Response
{
  "id": "abc123def456",
  "entryNumber": 0,
  "postingDate": "2026-01-01",
  "itemLedgerType": "string",
  "costLedgerType": "string",
  "adjustment": true,
  "quantity": 10,
  "cost": 0
}
DELETE/costLedger

Delete a cost ledger

Delete a cost ledger, matched on `id`. Returns 204 No Content.

Query parameters

idstring

The `id` of the cost ledger to delete, e.g. `eq.{id}`.

DELETEhttps://rest.carbon.ms/costLedger
curl --request DELETE \
  --url 'https://rest.carbon.ms/costLedger?id=eq.%7Bid%7D' \
  --header 'Authorization: Bearer <api-key>'
204 No Content