Index | Conventions

api/v1/jobs/{jobno}/stock

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.

NotePostable and Patchable describe what the API surface accepts. Whether a particular change is permitted also depends on the resource's current state and your permissions, which Jim2 enforces — a change that is not allowed is rejected with an error response (see the Conventions page).
RelationshipTypeReturnsIncludablePostablePatchable
stockStockarray

Attributes

The JobStock resource type attributes are as follows:

AttributeTypeRead-onlyDescription
adddatestring (DateTime in ISO format)The date and time the stock line was added.
addinitstringThe initials of the user who added the stock line.
backorderQtynumberThe 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
commissionAmountnumberThe commission amount for this stock line.
Note: Will not be returned in the response if value is null.
commissionFloornumberThe commission floor amount for this stock line.
Note: Will not be returned in the response if value is null.
commissionPercentagenumberThe commission percentage for this stock line.
Note: Will not be returned in the response if value is null.
commissionSourcestringThe commission source for this stock line. Valid values: NoCommission, ManualCommission, StockCommission, PromoCommission, SessionCommission.
configNointegerStock attribute configuration number.
Note: Will not be returned in the response if value is null.
costTotalnumberThe total cost for this stock line (cost × qty ordered × unit qty).
descriptionstringThe stock description. Only required if the default stock description needs to be overrridden. It is recommended this be set for special stock.
discountnumberThe discount amount applied to the unit price.
hideOnInvstringControls how this line appears on the invoice. Valid values: Show, Price, Line.
linePricenumberThe line price. If Job is calculating prices from tax paid amounts this will be tax inclusive, otherwise this will be tax exclusive.
linePriceTFnumberThe line price exclusive of tax.
linePriceTPnumberThe line price inclusive of tax.
linkedPONointegerLinked PONo.
Note: Will not be returned in the response if value is null.
linkedPONoLineIdintegerLinked PONo stock lineId.
Note: Will not be returned in the response if value is null.
locationCodestringThe stock location code.
manualCostnumberThe 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.
modifydatestring (DateTime in ISO format)The date and time the stock line was last modified.
modifyinitstringThe initials of the user who last modified the stock line.
qtynumberThe 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
qtyPickednumberThe quantity that has been picked for this stock line.
Note: Will not be returned in the response if value is null.
serialsarray of objectThe serial numbers allocated to this stock line, each with its stock attributes.
See the serials section below.
statusstringThe status of this stock line.
stockAttrsarray of objectThe stock attributes (name/value pairs) configured for this stock line.
See the stockAttrs section below.
stockCodestringThe Jim2 stock code
stockIdintegerThe Jim2 stock number of the line's stock item.
suppliedQtynumberThe 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
taxCodestringThe tax code applied to this stock line.
unitstringThe unit of measure for the stock line.
unitPricenumberThe 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.
unitPriceTFnumberThe 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.
unitPriceTPnumberThe 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.

serials

Attributes of each element in the serials array.

AttributeTypeRead-onlyDescription
serialNostringA stock serial number.
stockAttrsarray of objectOnly applicable to stock that is serial and attributed on purchase or serial on sell.
See the serials.stockAttrs section below.

stockAttrs

Attributes of each element in the stockAttrs array.

AttributeTypeRead-onlyDescription
namestringThe attribute name.
valuestringThe 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").

serials.stockAttrs

Attributes of each element in the serials.stockAttrs array.

AttributeTypeRead-onlyDescription
namestringThe attribute name.
valuestringThe 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").

Example GET (Return all)

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.

{
    "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"
            }
        }
    ]
}

Example GET (Return specific)

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.

{
    "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"
      }
    }
}

Example POST

Path: api/v1/jobs/10/stock

Request:

{
    "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"
                }
            ]
        }
    }
}

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.

{
    "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"
      }
    }
}

Example PATCH

Path: api/v1/jobs/10/stock/10-1

Request:

{
    "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"
                }
            ]
        }
    }
}

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.

{
    "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"
      }
    }
}