Transfers

7 articles Maxim By Maxim

Transfers

Transfers: moving materials or products from one storage location to another. Via the API you can create, edit and delete transfers, change their status, and get a list and a transfer's details. Method paths are given relative to the base API URL; the rules common to all methods (authorization, request format, partial editing, pagination) are described in API Overview and Common Rules. Methods | Method | What it does | |---|---| | v1/transfers/add | Creates a transfer | | v1/transfers/edit | Updates a transfer | | v1/transfers/delete | Deletes a transfer | | v1/transfers/update_status | Changes the transfer status | | v1/transfers/get_list | Returns the list of transfers | | v1/transfers/get_entry | Returns a transfer with its lines |

Creating a Transfer

Creates a transfer of materials or products between storage locations. v1/transfers/add.php Parameters | Field | Type | Required | Description | |---|---|---|---| | source_storage_id | int | Yes | Storage location items are moved from | | target_storage_id | int | Yes | Storage location items are moved to | | materials | array | materials or products | Materials to move: id or sku and amount | | products | array | materials or products | Products to move: id or sku and amount | | num | string | No | Number. Default the next one in order | | date | string | No | Transfer date, YYYY-MM-DD. Default today | | notes | string | No | Notes | materials and products line: | Field | Type | Required | Description | |---|---|---|---| | id | int | id or sku | Material or product ID | | sku | string | id or sku | SKU | | amount | float | Yes | Quantity, greater than 0 | Lines are passed in one array only: a transfer moves either materials or products. The transfer type is determined by the filled array. The storage locations must differ and must store items of the transferred type. A new transfer is created with the status from the Default status for new transfers setting. Example request { "source_storage_id": 3998, "target_storage_id": 4001, "date": "2026-10-06", "products": [ { "id": 512, "amount": 5 }, { "sku": "P-CHAIR-01", "amount": 20 } ], "notes": "To the Main St store" } Example response { "success": true, "transfer_id": 6967, "num": "31", "status": 0 } The response returns the ID, number and status code of the new transfer. Errors | Error | Reason | |---|---| | No source_storage_id in input | A required field is missing (instead of source_storage_id, the field's name) | | A transfer moves either materials or products. Create separate transfers | Both materials and products were passed | | No products or materials in input | No line was passed | | Products is not an array | products is not an array (same for materials) | | Line 0 of products must be an object | The line is not an object (instead of 0, the line number) | | SKU or id not set for product 0 | The line has neither id nor sku | | Product with id 512 not found | Product not found or deleted (for a SKU: Product with SKU "P-CHAIR-01" not found) | | Amount must be greater than 0 for product with id 512 | Quantity is not a number or not above 0 after rounding | | Storage ID is not set | A storage location equal to 0 or empty | | Storage ID not found | Storage location not found or deleted | | Source and target storage locations must be different | The same storage location was passed | | Storage location 4001 does not store products | The storage location does not store items of this type (for materials: does not store materials) | | Date is not a valid date in format YYYY-MM-DD | Invalid date format |

Editing a Transfer

Updates a transfer. Only the fields you pass are changed, the rest stay as they were. See Common Rules for partial editing. v1/transfers/edit.php Parameters | Field | Type | Required | Description | |---|---|---|---| | transfer_id | int | Yes | Transfer ID | | materials | array | No | Materials to move: id or sku and amount | | products | array | No | Products to move: id or sku and amount | | source_storage_id | int | No | Storage location items are moved from | | target_storage_id | int | No | Storage location items are moved to | | num | string | No | Number | | date | string | No | Transfer date, YYYY-MM-DD | | notes | string | No | Notes | If materials or products is passed, the lines are replaced as a whole. Lines are passed in one array only, as in v1/transfers/add; to change the transfer type, pass the lines in the other array. If neither array is passed, the lines are unchanged. The status is not changed by this method; use v1/transfers/update_status. The storage locations are validated only if storage locations or lines are passed. So a transfer whose storage location was later deleted can be edited as long as you do not pass storage locations or lines. Example request { "transfer_id": 6967, "target_storage_id": 4005, "notes": "To the Gagarin St store" } Example response { "success": true } Errors | Error | Reason | |---|---| | No transfer_id in input | transfer_id is missing | | Transfer not found or access denied | Transfer not found or deleted | | A transfer moves either materials or products. Create separate transfers | Both materials and products were passed | | No products or materials in input | The line arrays were passed but empty | | Product with id 512 not found | Product not found or deleted | | Amount must be greater than 0 for product with id 512 | Quantity is not a number or not above 0 after rounding | | Storage ID is not set | A storage location equal to 0 or empty | | Storage ID not found | Storage location not found or deleted | | Source and target storage locations must be different | The storage locations are the same | | Storage location 4005 does not store products | The storage location does not store items of this type | | Date is not a valid date in format YYYY-MM-DD | Invalid date format | Other line errors are the same as in v1/transfers/add.

Deleting a Transfer

Deletes a transfer. v1/transfers/delete.php Parameters | Field | Type | Required | Description | |---|---|---|---| | transfer_id | int | Yes | Transfer ID | Deletion cannot be undone. The items are returned to the source storage location and removed from the target one. Example request { "transfer_id": 6967 } Example response { "success": true } Errors | Error | Reason | |---|---| | No transfer_id in input | transfer_id is missing | | Transfer not found or access denied | Transfer not found or already deleted |

Changing the Transfer Status

Changes the transfer status. The status determines whether the items are deducted from the source and added to the target storage location. v1/transfers/update_status.php Parameters | Field | Type | Required | Description | |---|---|---|---| | transfer_id | int | Yes | Transfer ID | | status | int | Yes | New status: 0 — Plan, 1 — Sent, 2 — Received | Example request { "transfer_id": 6967, "status": 2 } Example response { "success": true } Errors | Error | Reason | |---|---| | No transfer_id in input | A required field is missing (instead of transfer_id, the field's name) | | Invalid status value. Must be one of: 0, 1, 2 | Invalid status code | | Transfer not found or access denied | Transfer not found or deleted |

Retrieving a List of Transfers

Returns the company's transfers, from newest to oldest: by date, and within one date by ID. Lines are not included in the list; they are returned by v1/transfers/get_entry. v1/transfers/get_list.php Parameters | Field | Type | Required | Description | |---|---|---|---| | storage_id | int | No | Only transfers where this storage location is the source or the target | | date_from | string | No | Transfers from this date inclusive, YYYY-MM-DD | | date_to | string | No | Transfers up to this date inclusive, YYYY-MM-DD | | status | int | No | Status: 0 Plan, 1 Sent, 2 Received | | limit | int | No | Page size, from 1 to 1000 | | offset | int | No | How many records to skip | Without limit the whole list is returned. See Common Rules for pagination. Response An array transfers with the transfer's fields: | Field | Type | Description | |---|---|---| | id | int | Transfer ID | | num | string | Number | | date | string | Transfer date, YYYY-MM-DD | | status | int | Status: 0 Plan, 1 Sent, 2 Received | | source_storage_id | int | Source storage location | | source_storage_name | string | Source storage location name | | target_storage_id | int | Target storage location | | target_storage_name | string | Target storage location name | | cost | float | Cost of what was transferred | | price | float | Value of the products at their sale price. 0 for a material transfer | | amount | float | Total quantity. null if the items have different units | | lines | int | Number of lines | | notes | string | Notes | The total field holds the total number of transfers matching the filters. Example request { "storage_id": 4001, "status": 1, "limit": 100, "offset": 0 } Example response { "success": true, "transfers": [ { "id": 6967, "num": "31", "date": "2026-10-06", "status": 1, "source_storage_id": 3998, "source_storage_name": "Main", "target_storage_id": 4001, "target_storage_name": "Store", "cost": 61500, "price": 125000, "amount": 25, "lines": 2, "notes": "To the Main St store" } ], "total": 1 } Errors | Error | Reason | |---|---| | Date is not a valid date in format YYYY-MM-DD | Invalid date_from or date_to | | Invalid status value. Must be a number | status is not a number | | Invalid limit value. Must be between 1 and 1000 | Invalid limit | | Offset requires limit | offset passed without limit |

Retrieving a Transfer

Returns a transfer with its lines. v1/transfers/get_entry.php Parameters | Field | Type | Required | Description | |---|---|---|---| | transfer_id | int | Yes | Transfer ID | Response An object transfer with the transfer's fields: | Field | Type | Description | |---|---|---| | id | int | Transfer ID | | num | string | Number | | date | string | Transfer date, YYYY-MM-DD | | status | int | Status: 0 Plan, 1 Sent, 2 Received | | source_storage_id | int | Source storage location | | source_storage_name | string | Source storage location name | | target_storage_id | int | Target storage location | | target_storage_name | string | Target storage location name | | cost | float | Cost of what was transferred | | price | float | Value of the products at their sale price. 0 for a material transfer | | amount | float | Total quantity. null if the items have different units | | lines | int | Number of lines | | notes | string | Notes | And lines in two arrays: materials and products. Only the array of the type the transfer moves is filled; the other comes empty. | Field | Type | Description | |---|---|---| | id | int | Material or product ID | | sku | string | SKU | | name | string | Name | | amount | float | Quantity | | unit | string | Unit of measure | | cost | float | Line cost | | position | int | Line number, from 0 | The lines from the response can be sent to v1/transfers/edit unchanged. Example request { "transfer_id": 6967 } Example response { "success": true, "transfer": { "id": 6967, "num": "31", "date": "2026-10-06", "status": 1, "source_storage_id": 3998, "source_storage_name": "Main", "target_storage_id": 4001, "target_storage_name": "Store", "cost": 61500, "price": 125000, "amount": 25, "lines": 2, "notes": "To the Main St store", "materials": [], "products": [ { "id": 512, "sku": "P-TABLE-01", "name": "Dining table", "amount": 5, "unit": "pcs", "cost": 30500, "position": 0 }, { "id": 540, "sku": "P-CHAIR-01", "name": "Chair", "amount": 20, "unit": "pcs", "cost": 31000, "position": 1 } ] } } Errors | Error | Reason | |---|---| | No transfer_id in input | transfer_id is missing | | Transfer not found or access denied | Transfer not found or deleted |