Path: api/v1/jobs/{jobno}/stock
This API is JSON:API compliant.
This endpoint supports the following methods:
GET POST PATCH DELETE
This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.
The resource type for this endpoint is JobStock
The identifier is jobno-lineid
Relationships
A relationship links this JobStock to another resource. By default only the related resource's type and id are returned. Relationships marked Includable can be embedded in the response via the include query parameter (see Includes below). To set or change a relationship, send a resource identifier (type and id) for it. Postable means the relationship can be set when creating the resource (POST); Patchable means it can be changed when updating an existing resource (PATCH). Some relationships are Postable but not Patchable — they can be set at creation but not changed afterwards. A value sent for a relationship that is not Postable/Patchable in that context is not applied.
| Relationship | Type | Returns | Includable | Postable | Patchable |
|---|---|---|---|---|---|
| stock | Stock | array | ✗ | ✗ | ✗ |
Attributes
The JobStock resource type attributes are as follows:
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| adddate | string (DateTime in ISO format) | ✓ | The date and time the stock line was added. |
| addinit | string | ✓ | The initials of the user who added the stock line. |
| backorderQty | number | ✓ | The quantity supplied. Notes Updating the Qty Backorder does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added. Updating the quantity backorder has no impact on qantity ordered or quantity supplied. When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request |
| commissionAmount | number | The commission amount for this stock line. Note: Will not be returned in the response if value is null. |
|
| commissionFloor | number | The commission floor amount for this stock line. Note: Will not be returned in the response if value is null. |
|
| commissionPercentage | number | The commission percentage for this stock line. Note: Will not be returned in the response if value is null. |
|
| commissionSource | string | The commission source for this stock line. Valid values: NoCommission, ManualCommission, StockCommission, PromoCommission, SessionCommission. | |
| configNo | integer | ✓ | Stock attribute configuration number. Note: Will not be returned in the response if value is null. |
| costTotal | number | ✓ | The total cost for this stock line (cost × qty ordered × unit qty). |
| description | string | The stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock. | |
| discount | number | The discount amount applied to the unit price. | |
| hideOnInv | string | Controls how this line appears on the invoice. Valid values: Show, Price, Line. | |
| linePrice | number | ✓ | The line price. If Job is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive. |
| linePriceTF | number | ✓ | The line price exclusive of tax. |
| linePriceTP | number | ✓ | The line price inclusive of tax. |
| linkedPONo | integer | ✓ | Linked PONo. Note: Will not be returned in the response if value is null. |
| linkedPONoLineId | integer | ✓ | Linked PONo stock lineId. Note: Will not be returned in the response if value is null. |
| locationCode | string | ✓ | The stock location code. |
| manualCost | number | The manual cost override for this stock line. Set to null to revert to automatic cost. Note: Will not be returned in the response if value is null. |
|
| modifydate | string (DateTime in ISO format) | ✓ | The date and time the stock line was last modified. |
| modifyinit | string | ✓ | The initials of the user who last modified the stock line. |
| qty | number | The quantity ordered. Notes Updating the Qty does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added. Updating the quantity ordered has no impact on qantity supplied or backorder quantity. When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request |
|
| qtyPicked | number | ✓ | The quantity that has been picked for this stock line. Note: Will not be returned in the response if value is null. |
| serials | array of object | The serial numbers allocated to this stock line, each with its stock attributes. See the serials section below. |
|
| status | string | ✓ | The status of this stock line. |
| stockAttrs | array of object | The stock attributes (name/value pairs) configured for this stock line. See the stockAttrs section below. |
|
| stockCode | string | ✓ | The Jim2 stock code |
| stockId | integer | ✓ | The Jim2 stock number of the line's stock item. |
| suppliedQty | number | The quantity supplied. Notes Updating the Qty Supplied does NOT trigger a price recalculation using Jim2's pricing. If the caller needs to have Jim2 recalculate the price the stock line will have to be deleted and re-added. Updating the quantity supplied has no impact on qantity ordered or backorder quantity. When adding a stock post (POST), Jim2 will calculate pricing if no pricing is provided as part of the request |
|
| taxCode | string | ✓ | The tax code applied to this stock line. |
| unit | string | ✓ | The unit of measure for the stock line. |
| unitPrice | number | The unit price. If Job is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
|
| unitPriceTF | number | The unit price exlusive of tax. Note that if Job is calculating prices from tax paid amounts the actual price set may differ due to rounding. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
|
| unitPriceTP | number | The unit price inclusive of tax. Note that if Job is calculating prices from tax exclusive amounts the actual price set may differ due to rounding. It is highly recommended to set only one of unitPrice, unitPriceTF, or unitPriceTP - if multiple are set the last one processed wins. |
Attributes of each element in the serials array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| serialNo | string | A stock serial number. | |
| stockAttrs | array of object | Only applicable to stock that is serial and attributed on purchase or serial on sell. See the serials.stockAttrs section below. |
Attributes of each element in the stockAttrs array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| name | string | The attribute name. | |
| value | string | The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats. eg integer attributes values must be a whole number date attribute values must be a date is ISO format real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false"). |
Attributes of each element in the serials.stockAttrs array.
| Attribute | Type | Read-only | Description |
|---|---|---|---|
| name | string | The attribute name. | |
| value | string | The attribute value. Note, this is always send as a string, but the attribute type dictates the acceptable string formats. eg integer attributes values must be a whole number date attribute values must be a date is ISO format real attribute values must be a decimal string (with period as the decimal separator)checkbox values must be a boolan value ("true", or "false"). |
Path: api/v1/jobs/10/stock Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response. This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above). Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.
Example GET (Return all)
{
"data": [
{
"id": "10-1",
"type": "JobStock",
"attributes": {
"qty": 2.0,
"suppliedQty": 2.0,
"backorderQty": 1.0,
"qtyPicked": 1.0,
"unitPrice": 199.0,
"unitPriceTF": 199.0,
"unitPriceTP": 218.9,
"locationCode": "NSW",
"discount": 10.0,
"linePrice": 358.2,
"linePriceTF": 358.2,
"linePriceTP": 394.02,
"taxCode": "GST",
"manualCost": 120.0,
"status": "Booked",
"hideOnInv": "Show",
"commissionFloor": 50.0,
"commissionPercentage": 5.0,
"commissionAmount": 17.91,
"commissionSource": "StockCommission",
"costTotal": 240.0,
"configNo": 101,
"serials": [
{
"serialNo": "SN-100001",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
],
"addinit": "SYS",
"adddate": "2024-06-24T14:04:00",
"stockId": 7,
"stockCode": "MULTILEVEL.MANF",
"unit": "EACH",
"description": "Multilevel Manufacture",
"modifyinit": "SYS",
"modifydate": "2024-06-24T14:04:19",
"linkedPONo": 26,
"linkedPONoLineId": 1
},
"relationships": {
"stock": {
"data": {
"type": "Stock",
"id": "7"
}
}
}
},
{
"id": "10-2",
"type": "JobStock",
"attributes": {
"stockCode": "SAMSUNG.MON.27",
"description": "27\" QLED Samsung Monitor"
}
},
{
"id": "10-3",
"type": "JobStock",
"attributes": {
"stockCode": "SAMSUNG.MON.27",
"description": "27\"Red QLED Samsung Monitor"
}
}
]
}
Path: api/v1/jobs/10/stock/10-1 Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example GET (Return specific)
{
"data": {
"id": "10-1",
"type": "JobStock",
"attributes": {
"qty": 2.0,
"suppliedQty": 2.0,
"backorderQty": 1.0,
"qtyPicked": 1.0,
"unitPrice": 199.0,
"unitPriceTF": 199.0,
"unitPriceTP": 218.9,
"locationCode": "NSW",
"discount": 10.0,
"linePrice": 358.2,
"linePriceTF": 358.2,
"linePriceTP": 394.02,
"taxCode": "GST",
"manualCost": 120.0,
"status": "Booked",
"hideOnInv": "Show",
"commissionFloor": 50.0,
"commissionPercentage": 5.0,
"commissionAmount": 17.91,
"commissionSource": "StockCommission",
"costTotal": 240.0,
"configNo": 101,
"serials": [
{
"serialNo": "SN-100001",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
],
"addinit": "SYS",
"adddate": "2024-06-24T14:04:00",
"stockId": 7,
"stockCode": "MULTILEVEL.MANF",
"unit": "EACH",
"description": "Multilevel Manufacture",
"modifyinit": "SYS",
"modifydate": "2024-06-24T14:04:19",
"linkedPONo": 26,
"linkedPONoLineId": 1
},
"relationships": {
"stock": {
"data": {
"type": "Stock",
"id": "7"
}
}
},
"links": {
"self": "/api/v1/jobs/10/stock/10-1"
}
}
}
Path: api/v1/jobs/10/stock Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example POST
{
"data": {
"type": "JobStock",
"attributes": {
"stockCode": "MOUSE",
"description": "Optical mouse (special)",
"qty": 2.0,
"suppliedQty": 2.0,
"unitPriceTF": 25.00,
"discount": 0.0,
"manualCost": 12.00,
"hideOnInv": "Show",
"commissionFloor": 5.00,
"commissionPercentage": 2.5,
"commissionAmount": 1.25,
"commissionSource": "ManualCommission",
"serials": [
{
"serialNo": "serial1"
},
{
"serialNo": "serial2"
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "B,Black"
}
]
}
}
}
{
"data": {
"id": "10-4",
"type": "JobStock",
"attributes": {
"qty": 2.0,
"suppliedQty": 2.0,
"backorderQty": 0.0,
"qtyPicked": 2.0,
"unitPrice": 49.0,
"unitPriceTF": 49.0,
"unitPriceTP": 53.9,
"locationCode": "ACT",
"discount": 5.0,
"linePrice": 93.1,
"linePriceTF": 93.1,
"linePriceTP": 102.41,
"taxCode": "GST",
"manualCost": 25.0,
"status": "Booked",
"hideOnInv": "Show",
"commissionFloor": 20.0,
"commissionPercentage": 5.0,
"commissionAmount": 4.66,
"commissionSource": "StockCommission",
"costTotal": 50.0,
"configNo": 205,
"serials": [
{
"serialNo": "SN-200001",
"stockAttrs": [
{
"name": "Colour",
"value": "B,Black"
}
]
},
{
"serialNo": "SN-200002",
"stockAttrs": [
{
"name": "Colour",
"value": "B,Black"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "B,Black"
}
],
"addinit": "API",
"adddate": "2025-03-25T18:28:28.899892+11:00",
"stockId": 5,
"stockCode": "MOUSE",
"unit": "EACH",
"description": "Mouse",
"modifyinit": "API",
"modifydate": "2025-03-25T18:28:28.899892+11:00",
"linkedPONo": 27,
"linkedPONoLineId": 1
},
"relationships": {
"stock": {
"data": {
"type": "Stock",
"id": "5"
}
}
},
"links": {
"self": "/api/v1/jobs/10/stock/10-4"
}
}
}
Path: api/v1/jobs/10/stock/10-1 Request: Response: This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.
Example PATCH
{
"data": {
"id": "10-1",
"type": "JobStock",
"attributes": {
"description": "Widget assembly (special)",
"qty": 2.0,
"suppliedQty": 2.0,
"unitPriceTF": 100.00,
"discount": 5.0,
"manualCost": 42.50,
"hideOnInv": "Show",
"commissionFloor": 10.00,
"commissionPercentage": 5.0,
"commissionAmount": 5.00,
"commissionSource": "ManualCommission",
"serials": [
{
"serialNo": "serial1",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
]
}
}
}
{
"data": {
"id": "10-1",
"type": "JobStock",
"attributes": {
"qty": 2.0,
"suppliedQty": 2.0,
"backorderQty": 0.0,
"qtyPicked": 2.0,
"unitPrice": 199.0,
"unitPriceTF": 199.0,
"unitPriceTP": 218.9,
"locationCode": "NSW",
"discount": 10.0,
"linePrice": 358.2,
"linePriceTF": 358.2,
"linePriceTP": 394.02,
"taxCode": "GST",
"manualCost": 120.0,
"status": "Booked",
"hideOnInv": "Show",
"commissionFloor": 50.0,
"commissionPercentage": 5.0,
"commissionAmount": 17.91,
"commissionSource": "StockCommission",
"costTotal": 240.0,
"configNo": 101,
"serials": [
{
"serialNo": "SN-100001",
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
]
}
],
"stockAttrs": [
{
"name": "Colour",
"value": "R,Red"
},
{
"name": "Size",
"value": "27,TwentySeven"
}
],
"addinit": "SYS",
"adddate": "2024-08-23T11:43:00",
"stockId": 1,
"stockCode": "SAMSUNG.MON.27",
"unit": "EACH",
"description": "27\" QLED Samsung Monitor",
"modifyinit": "API",
"modifydate": "2025-03-25T18:26:16.8189395+11:00",
"linkedPONo": 26,
"linkedPONoLineId": 1
},
"relationships": {
"stock": {
"data": {
"type": "Stock",
"id": "1"
}
}
},
"links": {
"self": "/api/v1/jobs/10/stock/10-1"
}
}
}