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
}
}
]
}
}
}Goods In: Receipts
Create a goods in receipt
Create a new goods in receipt (purchase order/ASN) to receive inventory into the warehouse. Include line items using the lines_changes array.
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
| Field | Required | Description |
|---|---|---|
account_id | Yes | Stock account ID (owner of incoming stock) |
warehouse_id | Yes | Destination warehouse ID |
reference | No | Your PO/ASN reference number |
expected_date_of_arrival | No | Expected delivery date (ISO 8601) |
supplier_id | No | Supplier/vendor ID |
lines_changes | No | Array of line operations (ADD/UPDATE/REMOVE) |
Address
An optional address can be provided indata.relationships.address (not in data.attributes). See the example above for the correct JSON:API relationships structure.
Line Item Operations
| Operation | Description |
|---|---|
ADD | Add a new line with attributes |
UPDATE | Update existing line (requires id) |
REMOVE | Remove line (requires id) |
Authorizations
OAuth 2.0 authentication. Use the client credentials or authorization code flow to obtain an access token.
The subdomain/tenant name identifying which tenant's data to access. Required for all API requests.
Body
application/json
Show child attributes
Show child attributes
Response
Goods in receipt created successfully
Show child attributes
Show child attributes
⌘I

