{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "Purchase Receives", "description": "A new purchase receive can a be created.To create Purchase receive, URL parameter purchaseorder_id is needed.", "definitions": { "gendoc-attributes-schema": { "$ref": "#/components/schemas/purchase_receive-response" }, "purchase_receive-response": { "type": "object", "properties": { "purchaseorder_id": { "$ref": "#/components/schemas/purchaseorder_id" }, "purchaseorder_number": { "$ref": "#/components/schemas/purchaseorder_number" }, "receive_id": { "$ref": "#/components/schemas/receive_id" }, "receive_number": { "$ref": "#/components/schemas/receive_number" }, "date": { "$ref": "#/components/schemas/date" }, "vendor_id": { "$ref": "#/components/schemas/vendor_id" }, "vendor_name": { "$ref": "#/components/schemas/vendor_name" }, "contact_persons": { "$ref": "#/components/schemas/contact_persons" }, "notes": { "$ref": "#/components/schemas/notes" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "billing_address": { "$ref": "#/components/schemas/billing_address" }, "shipping_address": { "$ref": "#/components/schemas/shipping_address" }, "created_time": { "$ref": "#/components/schemas/created_time" }, "last_modified_time": { "$ref": "#/components/schemas/last_modified_time" } } }, "purchaseorder_id": { "description": "Unique ID generated by the server for the Purchase Order.", "type": "string", "example": 4815000000044972 }, "purchaseorder_number": { "description": "Purchase Order number.", "type": "string", "example": "PO-00002" }, "receive_id": { "description": "Unique ID generated by the server for the Purchase Receive. This is used as identifier.", "type": "string", "example": 4815000000045035 }, "receive_number": { "description": "Number of the Purchase Receive.", "type": "string", "example": "PR-00002" }, "date": { "description": "Date of Purchase Receive", "type": "string", "example": "2015-05-28" }, "vendor_id": { "description": "Unique ID generated by the server for the vendor.", "type": "string", "example": 4815000000044080 }, "vendor_name": { "description": "Name of the vendor.", "type": "string", "example": "Molly" }, "contact_person_id": { "description": "Unique ID generated by the server for the contact person", "type": "string", "example": 4815000000044080 }, "contact_persons": { "description": "Array of contact person IDs.", "type": "array", "items": { "type": "object", "properties": { "contact_person_id": { "$ref": "#/components/schemas/contact_person_id" } } }, "example": 4815000000044080 }, "notes": { "description": "Purchase Receive notes.", "type": "string", "example": "Sample Note." }, "customfield_id": { "type": "string", "description": "Unique identifier of the custom field", "example": "46000000012845" }, "value": { "description": "Value of the Custom Field", "type": "string", "example": "Normal" }, "custom_fields": { "description": "Custom fields for a purchasereceive.", "type": "array", "items": { "type": "object", "properties": { "customfield_id": { "$ref": "#/components/schemas/customfield_id" }, "label": { "$ref": "#/components/schemas/label" }, "value": { "$ref": "#/components/schemas/value" } } } }, "line_item_id": { "description": "Unique ID generated by the server for each line item. This is used as an identifier.", "type": "string", "example": 4815000000044897 }, "item_id": { "description": "Unique ID generated by the server for the item. This is used as an identifier.", "type": "string", "example": 4815000000044100 }, "name": { "description": "Name of the line item.", "type": "string", "example": "Laptop-white/15inch/dell" }, "description": { "description": "Description of the line item.", "type": "string", "example": "Just a sample description." }, "item_order": { "description": "The order of the line items, starts from 0 by default.", "type": "integer", "example": 0 }, "quantity": { "description": "Quantity of the line item.", "type": "number", "format": "double", "example": 2 }, "unit": { "description": "Unit of line item.", "type": "string", "example": "qty" }, "label": { "description": "Label of the Custom Field", "type": "string" }, "item_custom_fields": { "type": "array", "description": "List of custom fields associated with the line item", "items": { "type": "object", "properties": { "label": { "$ref": "#/components/schemas/label" }, "value": { "$ref": "#/components/schemas/value" } } } }, "line_items": { "description": "Number of line items for purchase receive. Each line item contains line_item_id, item_id, name, description, item_order, quantity and unit.", "type": "array", "items": { "type": "object", "properties": { "line_item_id": { "$ref": "#/components/schemas/line_item_id" }, "item_id": { "$ref": "#/components/schemas/item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "item_order": { "$ref": "#/components/schemas/item_order" }, "quantity": { "$ref": "#/components/schemas/quantity" }, "unit": { "$ref": "#/components/schemas/unit" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches-response" }, "storages": { "$ref": "#/components/schemas/storages-response" } } } }, "serial_numbers": { "description": "Serial numbers for the line item. Applicable only for items with serial tracking enabled.", "type": "array", "items": { "type": "string", "example": "TC-IO-09" } }, "batches": { "description": "Batches for the line item. Create a new batch using batch_number or reference an existing batch using batch_id. Applicable only for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "in_quantity" ], "properties": { "batch_id": { "description": "Unique identifier of a batch. Use when adding inward quantity to an existing batch or updating a batch.", "type": "string", "example": "6780203000001066789" }, "batch_number": { "description": "Batch number. Required when creating a new batch.", "type": "string", "example": "BTC-TL-890" }, "external_batch_number": { "description": "External batch number from the manufacturer. Applicable when creating a new batch.", "type": "string", "example": "MFR-TL-890" }, "manufacturer_date": { "description": "Manufacturing date of the batch. Applicable when creating a new batch.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch. Applicable when creating a new batch.", "type": "string", "example": "2026-12-24" }, "in_quantity": { "description": "Inward quantity for the batch.", "type": "number", "format": "float", "example": 2 }, "storages": { "description": "Bin/storage locations allocated for stock received against this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "required": [ "storage_id", "in_quantity" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000001066003" }, "in_quantity": { "description": "Inward quantity into the bin.", "type": "number", "format": "float", "example": 2 } } } } } } }, "storages": { "description": "Bin/storage locations allocated for the line item. Applicable only for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "storage_id", "in_quantity" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000000093226" }, "in_quantity": { "description": "Inward quantity into the bin.", "type": "number", "format": "float", "example": 2 }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "TC-IO-09" } } } } }, "batches-update": { "description": "Batches for the line item. Create a new batch using batch_number or reference an existing batch using batch_id. Applicable only for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "in_quantity" ], "properties": { "batch_id": { "description": "Unique identifier of a batch. Use when adding inward quantity to an existing batch or updating a batch.", "type": "string", "example": "6780203000001066789" }, "batch_number": { "description": "Batch number. Required when creating a new batch.", "type": "string", "example": "BTC-TL-890" }, "external_batch_number": { "description": "External batch number from the manufacturer. Applicable when creating a new batch.", "type": "string", "example": "MFR-TL-890" }, "manufacturer_date": { "description": "Manufacturing date of the batch. Applicable when creating a new batch.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch. Applicable when creating a new batch.", "type": "string", "example": "2026-12-24" }, "in_quantity": { "description": "Inward quantity for the batch.", "type": "number", "format": "float", "example": 2 }, "batch_in_id": { "description": "Unique identifier of the batch record. Applicable only when updating an existing batch entry.", "type": "string", "example": "6780203000001066797" }, "storages": { "description": "Bin/storage locations allocated for stock received against this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "required": [ "storage_id", "in_quantity" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000001066003" }, "storage_in_id": { "description": "Unique identifier of the storage record. Applicable only when updating an existing storage entry.", "type": "string", "example": "6780203000001066792" }, "in_quantity": { "description": "Inward quantity into the bin.", "type": "number", "format": "float", "example": 2 } } } } } } }, "storages-update": { "description": "Bin/storage locations allocated for the line item. Applicable only for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "required": [ "storage_id", "in_quantity" ], "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000000093226" }, "storage_in_id": { "description": "Unique identifier of the storage record. Applicable only when updating an existing storage entry.", "type": "string", "example": "6780203000001066795" }, "in_quantity": { "description": "Inward quantity into the bin.", "type": "number", "format": "float", "example": 2 }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "TC-IO-09" } } } } }, "batches-response": { "description": "Batches tracked for the line item. Returned for items with batch tracking enabled.", "type": "array", "items": { "type": "object", "properties": { "batch_id": { "description": "Unique identifier of the batch.", "type": "string", "example": "6780203000001066789" }, "batch_number": { "description": "Batch number.", "type": "string", "example": "BTC-TL-890" }, "external_batch_number": { "description": "External batch number from the manufacturer.", "type": "string", "example": "MFR-TL-890" }, "manufacturer_date": { "description": "Manufacturing date of the batch.", "type": "string", "example": "2026-05-12" }, "expiry_date": { "description": "Expiration date of the batch.", "type": "string", "example": "2026-12-24" }, "in_quantity": { "description": "Inward quantity recorded for the batch.", "type": "number", "format": "float", "example": 2 }, "batch_in_id": { "description": "Unique identifier of the batch entry on the line item.", "type": "string", "example": "6780203000001066797" }, "storages": { "description": "Bin/storage locations from which stock was received for this batch.", "type": "array", "x-node_available_in": [ "Batch with Bin tracked items" ], "items": { "type": "object", "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000001066003" }, "storage_name": { "description": "Display name of the bin/storage location.", "type": "string", "example": "Bin A1" }, "in_quantity": { "description": "Inward quantity recorded against the bin.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item.", "type": "string", "example": "6780203000001066792" } } } } } } }, "storages-response": { "description": "Bin/storage locations tracked for the line item. Returned for items with bin tracking enabled.", "type": "array", "items": { "type": "object", "properties": { "storage_id": { "description": "Unique identifier of the bin/storage location.", "type": "string", "example": "6780203000000093226" }, "storage_name": { "description": "Display name of the bin/storage location.", "type": "string", "example": "Bin A2" }, "in_quantity": { "description": "Inward quantity recorded against the bin.", "type": "number", "format": "float", "example": 2 }, "storage_in_id": { "description": "Unique identifier of the storage entry on the line item.", "type": "string", "example": "6780203000001066795" }, "serial_numbers": { "description": "Serial numbers allocated to this bin.", "type": "array", "x-node_available_in": [ "Serial with Bin tracked items" ], "items": { "type": "string", "example": "TC-IO-09" } }, "item_custom_fields": { "$ref": "#/components/schemas/item_custom_fields" } } } }, "address": { "description": "Name of the street of the customer's billing address.", "type": "string", "example": "No:234,90 Church Street" }, "city": { "description": "Name of the city of the customer's billing address.", "type": "string", "example": "New York City" }, "state": { "description": "Name of the state of the customer's billing address.", "type": "string", "example": "New York" }, "zip": { "description": "Zip code of the customer's billing address.", "type": "string", "example": 10048 }, "country": { "description": "Name of the country of the customer's billing address.", "type": "string", "example": "U.S.A" }, "fax": { "description": "Fax number of the customer's billing address.", "type": "string", "example": "324-524242" }, "billing_address": { "description": "Customer's billing address. It contains - address, city, state, zip, country and fax.", "type": "array", "items": { "type": "object", "properties": { "address": { "$ref": "#/components/schemas/address" }, "city": { "$ref": "#/components/schemas/city" }, "state": { "$ref": "#/components/schemas/state" }, "zip": { "$ref": "#/components/schemas/zip" }, "country": { "$ref": "#/components/schemas/country" }, "fax": { "$ref": "#/components/schemas/fax" } } } }, "shipping_address": { "description": "Customer's shipping address. It contains - address, city, state, zip, country and fax.", "type": "array", "items": { "type": "object", "properties": { "address": { "$ref": "#/components/schemas/address" }, "city": { "$ref": "#/components/schemas/city" }, "state": { "$ref": "#/components/schemas/state" }, "zip": { "$ref": "#/components/schemas/zip" }, "country": { "$ref": "#/components/schemas/country" }, "fax": { "$ref": "#/components/schemas/fax" } } } }, "created_time": { "description": "Time at which the Purchase Receive was created.", "type": "string", "example": "2015-05-28T00:00:00+00:00" }, "last_modified_time": { "description": "Time at which the Purchase Order details were last modified.", "type": "string", "example": "2015-05-28T00:00:00+00:00" }, "create-a-purchase-receive-request": { "required": [ "receive_number", "line_items" ], "type": "object", "properties": { "receive_number": { "$ref": "#/components/schemas/receive_number" }, "date": { "$ref": "#/components/schemas/date" }, "notes": { "$ref": "#/components/schemas/notes" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "line_items": { "description": "Number of line items for purchase receive.", "type": "array", "items": { "type": "object", "properties": { "line_item_id": { "$ref": "#/components/schemas/line_item_id" }, "item_id": { "$ref": "#/components/schemas/item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "item_order": { "$ref": "#/components/schemas/item_order" }, "quantity": { "$ref": "#/components/schemas/quantity" }, "unit": { "$ref": "#/components/schemas/unit" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches" }, "storages": { "$ref": "#/components/schemas/storages" } } } } } }, "create-a-purchase-receive-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "purchase_receive": { "$ref": "#/components/schemas/purchase_receive-response" } } }, "retrieve-a-purchase-receive-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "purchase_receive": { "type": "object", "properties": { "purchaseorder_id": { "$ref": "#/components/schemas/purchaseorder_id" }, "purchaseorder_number": { "$ref": "#/components/schemas/purchaseorder_number" }, "receive_id": { "$ref": "#/components/schemas/receive_id" }, "receive_number": { "$ref": "#/components/schemas/receive_number" }, "date": { "$ref": "#/components/schemas/date" }, "vendor_id": { "$ref": "#/components/schemas/vendor_id" }, "vendor_name": { "$ref": "#/components/schemas/vendor_name" }, "contact_persons": { "$ref": "#/components/schemas/contact_persons" }, "notes": { "$ref": "#/components/schemas/notes" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "billing_address": { "$ref": "#/components/schemas/billing_address" }, "shipping_address": { "$ref": "#/components/schemas/shipping_address" }, "created_time": { "$ref": "#/components/schemas/created_time" }, "last_modified_time": { "$ref": "#/components/schemas/last_modified_time" } } } } }, "update-a-purchase-receive-request": { "required": [ "receive_number", "line_items" ], "type": "object", "properties": { "receive_number": { "$ref": "#/components/schemas/receive_number" }, "date": { "$ref": "#/components/schemas/date" }, "notes": { "$ref": "#/components/schemas/notes" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "line_items": { "description": "Number of line items for purchase receive.", "type": "array", "items": { "type": "object", "properties": { "line_item_id": { "$ref": "#/components/schemas/line_item_id" }, "item_id": { "$ref": "#/components/schemas/item_id" }, "name": { "$ref": "#/components/schemas/name" }, "description": { "$ref": "#/components/schemas/description" }, "item_order": { "$ref": "#/components/schemas/item_order" }, "quantity": { "$ref": "#/components/schemas/quantity" }, "unit": { "$ref": "#/components/schemas/unit" }, "serial_numbers": { "$ref": "#/components/schemas/serial_numbers" }, "batches": { "$ref": "#/components/schemas/batches-update" }, "storages": { "$ref": "#/components/schemas/storages-update" } } } } } }, "update-a-purchase-receive-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true }, "purchase_receive": { "type": "object", "properties": { "purchaseorder_id": { "$ref": "#/components/schemas/purchaseorder_id" }, "purchaseorder_number": { "$ref": "#/components/schemas/purchaseorder_number" }, "receive_id": { "$ref": "#/components/schemas/receive_id" }, "receive_number": { "$ref": "#/components/schemas/receive_number" }, "date": { "$ref": "#/components/schemas/date" }, "vendor_id": { "$ref": "#/components/schemas/vendor_id" }, "vendor_name": { "$ref": "#/components/schemas/vendor_name" }, "contact_persons": { "$ref": "#/components/schemas/contact_persons" }, "notes": { "$ref": "#/components/schemas/notes" }, "custom_fields": { "$ref": "#/components/schemas/custom_fields" }, "line_items": { "$ref": "#/components/schemas/line_items" }, "billing_address": { "$ref": "#/components/schemas/billing_address" }, "shipping_address": { "$ref": "#/components/schemas/shipping_address" }, "created_time": { "$ref": "#/components/schemas/created_time" }, "last_modified_time": { "$ref": "#/components/schemas/last_modified_time" } } } } }, "delete-a-purchase-receive-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "The Purchase Receive has been deleted.", "readOnly": true } } }, "approval-action-response": { "type": "object", "properties": { "code": { "type": "integer", "example": 0, "readOnly": true }, "message": { "type": "string", "example": "success", "readOnly": true } } }, "reject-request": { "type": "object", "properties": { "reason": { "description": "Reason for rejecting the purchase receive. Max-length [500].", "type": "string", "example": "Items received do not match the purchase order." } } } } }