Goods receipts

Goods received from a supplier: lines with the delivery note price and cost, before-and-after corrections. A reversal sets voided_at.

Loading the search index…

Goods receipts

Objects

GoodsReceipt

  • idintegerrequired

    ID of the record, unique among records of its kind in the store.

  • numberstring or nullrequired

    Receipt number; null on a receipt created before numbering.

  • supplier_idinteger or nullrequired

    Supplier ID (/v1/suppliers); null on a receipt without a supplier.

  • location_idintegerrequired

    Location the goods were received at (/v1/locations).

  • legal_entity_idinteger or nullrequired

    Buying legal entity of the store (/v1/legal-entities): its tax regime decides whether the purchase tax is recoverable; null on older receipts.

  • purchase_order_idinteger or nullrequired

    Purchase order the goods were received against (/v1/purchase-orders); null — received without an order.

  • received_atstring (date-time)required

    When the goods were received.

  • currencystringrequired

    Receipt currency, ISO 4217: delivery note prices, line totals and subtotals are in it.

  • exchange_ratestring or nullrequired

    Rate of the receipt currency to the store currency as a decimal string, captured on receipt; null on a receipt without a captured rate.

  • settlement_modestring or nullrequired

    How the store pays for the delivery: on_receipt — for what was received; on_sale — when sold, by a consignment settlement; null on older receipts.

    Values:
    on_receipton_salenull
  • supplier_documentobjectrequired

    Supplier delivery note as confirmed by staff.

    Fields · 3
    • type_codestring or nullrequired

      Document type code of the tax provider of the store country (in Argentina, the ARCA comprobante code); null — no document.

    • numberstring or nullrequired

      Delivery note number; null if not given.

    • datestring or nullrequired

      Delivery note date, YYYY-MM-DD; null if not given.

  • prices_include_taxboolean or nullrequired

    true — line prices include tax; false — they do not; null — not specified.

  • input_tax_treatmentstring or nullrequired

    Where the tax in the purchase price went: recoverable — it is credited, cost excludes tax; cost — nothing to credit it against, tax is part of cost; null — cost as entered.

    Values:
    recoverablecostnull
  • lines_subtotalinteger or nullrequired

    Value received: the sum of line_total in the receipt currency; null — the document has no prices.

  • payable_totalinteger or nullrequired

    Amount owed to the supplier in the receipt currency; null — unknown.

  • voided_atstring (date-time) or nullrequired

    When the receipt was reversed: goods left stock, the delivery debt was voided; null on an active receipt.

  • notestring or nullrequired

    Staff note; null if there is none.

  • linesarray of objectrequired

    Receipt lines; values are after corrections.

    Fields · 16
    • idintegerrequired

      ID of the record, unique among records of its kind in the store.

    • variant_idinteger or nullrequired

      Product variant ID (/v1/variants).

    • lot_idinteger or nullrequired

      Lot of the line (/v1/lots); null for a product without lots.

    • purchase_order_line_idinteger or nullrequired

      Purchase order line (lines[].id of the order) the line was received against; null without an order.

    • added_by_correction_idinteger or nullrequired

      Correction (corrections[].id) that added the line; null on a line from posting.

    • supplier_descriptionstring or nullrequired

      Item name as on the delivery note; null if not recorded.

    • supplier_quantitystring or nullrequired

      Quantity as on the delivery note, in supplier_unit, as a decimal string; null if not recorded.

    • supplier_unitstring or nullrequired

      Delivery note unit as written: "kg", "15 kg", "pcs"; null if not given.

    • unitstring or nullrequired

      Base unit of quantity and cost_per_quantity: pcs — pieces, g — grams, ml — milliliters.

    • quantitystring or nullrequired

      Quantity received into stock, a decimal string in the base unit.

    • unit_costinteger or nullrequired

      Delivery note price in the receipt currency per cost_per_quantity; null — no price.

    • cost_per_quantitystring or nullrequired

      Quantity in the base unit the price is for: "1000" on a weighed product means per kilogram.

    • line_totalinteger or nullrequired

      Line total in the receipt currency: price times the delivery note quantity; null without a price or delivery note quantity.

    • store_unit_cost_microinteger or nullrequired

      Line price in the store currency at the receipt rate per cost_per_quantity, in millionths of the minor unit; null without a price.

    • tax_rate_bpsinteger or nullrequired

      Tax rate the cost was computed with, in basis points; null — no tax treatment.

    • landed_unit_cost_microinteger or nullrequired

      Cost after the tax treatment that the line set on the item: store currency, per cost_per_quantity, in millionths of the minor unit; null without a price.

  • correctionsarray of objectrequired

    Corrections of the posted receipt in order: what was fixed and why.

    Fields · 8
    • idintegerrequired

      ID of the record, unique among records of its kind in the store.

    • numberstringrequired

      Correction number.

    • reasonstringrequired

      Why it was corrected, in the words of staff.

    • subtotal_beforeinteger or nullrequired

      lines_subtotal before the correction; null — there were no prices.

    • subtotal_afterinteger or nullrequired

      lines_subtotal after the correction; null — there are no prices.

    • consumed_varianceintegerrequired

      Price difference on goods that had already left stock, in the store currency: it went to the cost of goods sold.

    • linesarray of objectrequired

      Corrected lines, before and after.

      Fields · 11
      • goods_receipt_line_idintegerrequired

        Receipt line ID (lines[].id).

      • quantity_beforestring or nullrequired

        Received quantity before the correction, in the base unit.

      • quantity_afterstring or nullrequired

        Received quantity after the correction, in the base unit.

      • supplier_quantity_beforestring or nullrequired

        Delivery note quantity before the correction; null if there was none.

      • supplier_quantity_afterstring or nullrequired

        Delivery note quantity after the correction; null if there is none.

      • unit_cost_beforeinteger or nullrequired

        Delivery note price before the correction; null — no price.

      • unit_cost_afterinteger or nullrequired

        Delivery note price after the correction; null — no price.

      • store_unit_cost_before_microinteger or nullrequired

        Price in the store currency before the correction, in millionths of the minor unit.

      • store_unit_cost_after_microinteger or nullrequired

        Price in the store currency after the correction, in millionths of the minor unit.

      • consumed_quantitystring or nullrequired

        How much of the line had already left stock at the time of the correction.

      • consumed_varianceintegerrequired

        Price difference on what had left stock, in the store currency.

    • created_atstring (date-time)required

      When the correction was posted.

  • created_atstring (date-time)required

    When the record was created.

  • updated_atstring (date-time)required

    When the record last changed.

Endpoints

Goods receipts: deliveries from suppliers with lines, delivery note prices and corrections

get/goods-receipts

Scope: procurement:read

Parameters

Query

  • limitinteger

    Page size: up to 250 records; 50 by default.

    Minimum:
    1
    Maximum:
    250
  • cursorstring

    Opaque cursor: next_cursor of the previous page, or sync_cursor of the last page saved by the previous sync. The list goes in commit order, so the sync cursor later returns only what changed after it.

    Max length:
    4096
  • updated_sincestring (date-time)

    Only records changed after this moment, ISO 8601 with a time zone. A filter for the first sync; continue with the cursor.

    Pattern:
    ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,6})?(Z|[+-]\d{2}:\d{2})$
  • supplier_idinteger

    Only documents of this supplier.

    Minimum:
    1
  • purchase_order_idinteger

    Only goods receipts against this purchase order.

    Minimum:
    1

Responses

200Success

application/json

  • dataarray of GoodsReceiptrequired

    Records of the page.

  • deletedarray of objectrequired

    Records erased from the database since the cursor, as tombstones: only with include_deleted=true in the continuation by the sync cursor.

    Fields · 2
    • idintegerrequired

      ID of the erased record.

    • deleted_atstring (date-time)required

      When the record was erased.

  • next_cursorstring or nullrequired

    Cursor of the next page; null on the last page.

  • has_morebooleanrequired

    true when there is a next page.

  • sync_cursorstring or nullrequired

    On the last page — the cursor to continue from later: it returns only what changed after this page. null on other pages.

401The token is missing, invalid, expired or revoked

Headers

  • WWW-Authenticatestringrequired

    Authentication scheme (RFC 6750).

    Example:
    Bearer

application/problem+json

Returns Problem

403The plan, the IP address or the token scopes do not allow the request

Headers

  • WWW-Authenticatestring

    Authentication scheme (RFC 6750).

    Example:
    Bearer error="insufficient_scope", scope="locations:read"

application/problem+json

Returns ForbiddenProblem

410The sync cursor is older than the deletion retention period or was issued before the database was restored

application/problem+json

Returns Problem

422A parameter is invalid or unknown

application/problem+json

Returns ValidationProblem

429The rate limit is exhausted

Headers

  • Retry-Afterintegerrequired

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns RateLimitProblem

503The store is temporarily unavailable

Headers

  • Retry-Afterinteger

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns Problem

Errors of this endpoint

Common errors such as token, access, input validation and rate limit can come from any endpoint; they are listed in the catalog: Errors

Example request
curl "https://api.saleya.app/v1/goods-receipts" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "data": [
    {
      "id": 0,
      "number": "string",
      "supplier_id": 0,
      "location_id": 0,
      "legal_entity_id": 0,
      "purchase_order_id": 0,
      "received_at": "2026-01-15T12:00:00Z",
      "currency": "string",
      "exchange_rate": "string",
      "settlement_mode": "on_receipt",
      "supplier_document": {
        "type_code": "string",
        "number": "string",
        "date": "string"
      },
      "prices_include_tax": true,
      "input_tax_treatment": "recoverable",
      "lines_subtotal": 0,
      "payable_total": 0,
      "voided_at": "2026-01-15T12:00:00Z",
      "note": "string",
      "lines": [
        {
          "id": 0,
          "variant_id": 0,
          "lot_id": 0,
          "purchase_order_line_id": 0,
          "added_by_correction_id": 0,
          "supplier_description": "string",
          "supplier_quantity": "string",
          "supplier_unit": "string",
          "unit": "string",
          "quantity": "string",
          "unit_cost": 0,
          "cost_per_quantity": "string",
          "line_total": 0,
          "store_unit_cost_micro": 0,
          "tax_rate_bps": 0,
          "landed_unit_cost_micro": 0
        }
      ],
      "corrections": [
        {
          "id": 0,
          "number": "string",
          "reason": "string",
          "subtotal_before": 0,
          "subtotal_after": 0,
          "consumed_variance": 0,
          "lines": [
            {
              "goods_receipt_line_id": 0,
              "quantity_before": "string",
              "quantity_after": "string",
              "supplier_quantity_before": "string",
              "supplier_quantity_after": "string",
              "unit_cost_before": 0,
              "unit_cost_after": 0,
              "store_unit_cost_before_micro": 0,
              "store_unit_cost_after_micro": 0,
              "consumed_quantity": "string",
              "consumed_variance": 0
            }
          ],
          "created_at": "2026-01-15T12:00:00Z"
        }
      ],
      "created_at": "2026-01-15T12:00:00Z",
      "updated_at": "2026-01-15T12:00:00Z"
    }
  ],
  "deleted": [
    {
      "id": 0,
      "deleted_at": "2026-01-15T12:00:00Z"
    }
  ],
  "next_cursor": "string",
  "has_more": true,
  "sync_cursor": "string"
}

Goods receipt

get/goods-receipts/{goods_receipt}

Scope: procurement:read

Parameters

Path

  • goods_receiptintegerrequired

    Goods receipt ID.

Responses

200Success

application/json

Returns GoodsReceipt

401The token is missing, invalid, expired or revoked

Headers

  • WWW-Authenticatestringrequired

    Authentication scheme (RFC 6750).

    Example:
    Bearer

application/problem+json

Returns Problem

403The plan, the IP address or the token scopes do not allow the request

Headers

  • WWW-Authenticatestring

    Authentication scheme (RFC 6750).

    Example:
    Bearer error="insufficient_scope", scope="locations:read"

application/problem+json

Returns ForbiddenProblem

404The object does not exist or is not available to the app

application/problem+json

Returns Problem

422A parameter is invalid or unknown

application/problem+json

Returns ValidationProblem

429The rate limit is exhausted

Headers

  • Retry-Afterintegerrequired

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns RateLimitProblem

503The store is temporarily unavailable

Headers

  • Retry-Afterinteger

    Seconds to wait before retrying.

    Minimum:
    0

application/problem+json

Returns Problem

Common errors such as token, access, input validation and rate limit can come from any endpoint; they are listed in the catalog: Errors

Example request
curl "https://api.saleya.app/v1/goods-receipts/{goods_receipt}" \
  -H "Authorization: Bearer $SALEYA_API_TOKEN"
Example response · 200
{
  "id": 0,
  "number": "string",
  "supplier_id": 0,
  "location_id": 0,
  "legal_entity_id": 0,
  "purchase_order_id": 0,
  "received_at": "2026-01-15T12:00:00Z",
  "currency": "string",
  "exchange_rate": "string",
  "settlement_mode": "on_receipt",
  "supplier_document": {
    "type_code": "string",
    "number": "string",
    "date": "string"
  },
  "prices_include_tax": true,
  "input_tax_treatment": "recoverable",
  "lines_subtotal": 0,
  "payable_total": 0,
  "voided_at": "2026-01-15T12:00:00Z",
  "note": "string",
  "lines": [
    {
      "id": 0,
      "variant_id": 0,
      "lot_id": 0,
      "purchase_order_line_id": 0,
      "added_by_correction_id": 0,
      "supplier_description": "string",
      "supplier_quantity": "string",
      "supplier_unit": "string",
      "unit": "string",
      "quantity": "string",
      "unit_cost": 0,
      "cost_per_quantity": "string",
      "line_total": 0,
      "store_unit_cost_micro": 0,
      "tax_rate_bps": 0,
      "landed_unit_cost_micro": 0
    }
  ],
  "corrections": [
    {
      "id": 0,
      "number": "string",
      "reason": "string",
      "subtotal_before": 0,
      "subtotal_after": 0,
      "consumed_variance": 0,
      "lines": [
        {
          "goods_receipt_line_id": 0,
          "quantity_before": "string",
          "quantity_after": "string",
          "supplier_quantity_before": "string",
          "supplier_quantity_after": "string",
          "unit_cost_before": 0,
          "unit_cost_after": 0,
          "store_unit_cost_before_micro": 0,
          "store_unit_cost_after_micro": 0,
          "consumed_quantity": "string",
          "consumed_variance": 0
        }
      ],
      "created_at": "2026-01-15T12:00:00Z"
    }
  ],
  "created_at": "2026-01-15T12:00:00Z",
  "updated_at": "2026-01-15T12:00:00Z"
}