Skip to main content
POST
/
api
/
goods_in_receipts
Create a goods in receipt
curl --request POST \
  --url https://clarus-api.com/api/goods_in_receipts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Clarus-Subdomain: <api-key>' \
  --data '
{
  "data": {
    "type": "goods_in_receipts",
    "attributes": {
      "account_id": 1,
      "warehouse_id": 1,
      "reference": "PO-001",
      "expected_date_of_arrival": "2024-01-15T10:00:00Z",
      "lines_changes": [
        {
          "type": "ADD",
          "attributes": {
            "product_id": 123,
            "expected_quantity": 100
          }
        }
      ]
    },
    "relationships": {
      "address": {
        "data": {
          "type": "addresses",
          "attributes": {
            "name": "Warehouse Receiving",
            "address_1": "100 Industrial Park Way",
            "address_3": "Manchester",
            "postcode": "M1 1AA",
            "country_code": "GB",
            "email_address": "[email protected]",
            "phone_number": "+44 20 7946 0958"
          }
        }
      }
    }
  }
}
'
{
  "data": {
    "id": 123,
    "type": "goods_in_receipts",
    "attributes": {
      "account_id": 123,
      "warehouse_id": 123,
      "reference": "<string>",
      "supplier_id": 123,
      "expected_date_of_arrival": "2023-11-07T05:31:56Z",
      "actual_date_of_arrival": "2023-11-07T05:31:56Z",
      "external_system_reference1": "<string>",
      "external_system_reference2": "<string>",
      "external_system_reference3": "<string>",
      "notes": "<string>",
      "string1": "<string>",
      "string2": "<string>",
      "string3": "<string>",
      "string4": "<string>",
      "string5": "<string>",
      "integer1": 123,
      "integer2": 123,
      "integer3": 123,
      "integer4": 123,
      "integer5": 123,
      "datetime1": "2023-11-07T05:31:56Z",
      "datetime2": "2023-11-07T05:31:56Z",
      "datetime3": "2023-11-07T05:31:56Z",
      "datetime4": "2023-11-07T05:31:56Z",
      "datetime5": "2023-11-07T05:31:56Z",
      "boolean1": true,
      "boolean2": true,
      "boolean3": true,
      "boolean4": true,
      "boolean5": true,
      "lines_changes": [
        {
          "id": 123,
          "attributes": {
            "product_id": 123,
            "expected_quantity": 1,
            "expected_configurations_quantity": 1,
            "alt_line_note": "<string>",
            "alt_line_number": "<string>",
            "alt_line_reference": "<string>",
            "alt_product_code": "<string>",
            "external_system_reference1": "<string>",
            "external_system_reference2": "<string>",
            "external_system_reference3": "<string>",
            "string1": "<string>",
            "string2": "<string>",
            "string3": "<string>",
            "string4": "<string>",
            "string5": "<string>",
            "integer1": 123,
            "integer2": 123,
            "integer3": 123,
            "integer4": 123,
            "integer5": 123,
            "datetime1": "2023-11-07T05:31:56Z",
            "datetime2": "2023-11-07T05:31:56Z",
            "datetime3": "2023-11-07T05:31:56Z",
            "datetime4": "2023-11-07T05:31:56Z",
            "datetime5": "2023-11-07T05:31:56Z",
            "boolean1": true,
            "boolean2": true,
            "boolean3": true,
            "boolean4": true,
            "boolean5": true
          }
        }
      ]
    }
  }
}

Request Structure

{
  "data": {
    "type": "goods_in_receipts",
    "attributes": {
      "account_id": 1,
      "warehouse_id": 1,
      "reference": "PO-2024-001",
      "expected_date_of_arrival": "2024-01-15T10:00:00Z",
      "supplier_id": 5,
      "lines_changes": [
        {
          "type": "ADD",
          "attributes": {
            "product_id": 123,
            "expected_quantity": 100,
            "batch_number": "BATCH-001",
            "expiry_date": "2025-01-15"
          }
        }
      ]
    },
    "relationships": {
      "address": {
        "data": {
          "type": "addresses",
          "attributes": {
            "name": "Supplier Co.",
            "address_1": "50 Factory Road",
            "address_3": "Birmingham",
            "postcode": "B1 1AA",
            "country_code": "GB",
            "email_address": "[email protected]",
            "phone_number": "+44 20 7946 0958"
          }
        }
      }
    }
  }
}

Key Fields

FieldRequiredDescription
account_idYesStock account ID (owner of incoming stock)
warehouse_idYesDestination warehouse ID
referenceNoYour PO/ASN reference number
expected_date_of_arrivalNoExpected delivery date (ISO 8601)
supplier_idNoSupplier/vendor ID
lines_changesNoArray of line operations (ADD/UPDATE/REMOVE)

Address

An optional address can be provided in data.relationships.address (not in data.attributes). See the example above for the correct JSON:API relationships structure.

Line Item Operations

OperationDescription
ADDAdd a new line with attributes
UPDATEUpdate existing line (requires id)
REMOVERemove line (requires id)

Authorizations

Authorization
string
header
required

OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.

X-Clarus-Subdomain
string
header
required

The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.

Body

application/json
data
object
required

Response

Goods in receipt created successfully

data
object