Page 1 of 1

Cost centre ID for AssignedTo=Stock

Posted: Fri Oct 10, 2025 4:42 am
by tmeier
When a PO is issued for a particular cost centre the vendorOrders API endpoint (api/v1.0/companies/0/vendorOrders/<vendorOrder>) shows the cost centre ID

Code: Select all

    "AssignedTo": {
        "ID": 34514,
        "CostCenter": {
            "ID": 119,
            "Name": "Sales Aluminium"
        },
        "Name": "102660-34514 Sales Aluminium",
        "Job": 102660,
        "Section": 30010
    },
however if the PO is issued for stock the AssignedTo object is empty; i.e.

Code: Select all

    "AssignedTo": {},
    "Stage": "Approved",
    "Status": {
        "ID": 24,
        "Name": "Purchase Orders : Sent to Supplier"
    },
However in order to create a receipt for the order (/api/v1.0/companies/{companyID}/vendorOrders/{vendorOrderID}/receipts/) we need the cost centre ID.

Is there an endpoint (similar to the catalogs endpoint) I can lookup the ID (for stock) because the code needs to default to the ID if it's not returned via the API. Along the same lines are there other cost centers that don't come through via the API in which case this becomes a challenge to auto-assign

Re: Cost centre ID for AssignedTo=Stock

Posted: Tue Oct 14, 2025 12:52 am
by SimproAPITeam
Catalog is not required when assigned to stock. You can POST a receipt with an empty body if you want.

https://developer.simprogroup.com/apido ... 3510cb72d8
^ Based on your screen shot you already have this page

To my understanding if a catalogue is included it will expect a cost center but if you do not include a catalogue you should be able to post a receipt fine.

Hope this help.