mos-execution-apis v0.0.0
MOS Execution APIs
Browser and node module for making API requests against MOS Execution APIs.
Please note: This module uses Popsicle to make API requests. Promises must be supported or polyfilled on all target environments.
Installation
npm install mos-execution-apis --save
bower install mos-execution-apis --save
Usage
Node
var MosExecutionApis = require('mos-execution-apis');
var client = new MosExecutionApis();
Browsers
<script src="mos-execution-apis/index.js">
<script>
var client = new window.MosExecutionApis();
</script>
Options
You can set options when you initialize a client or at any time with the options
property. You may also override options for a single request by passing an object as the second argument of any request method. For example:
var client = new MosExecutionApis({ ... });
client.options = { ... };
client.resource('/').get(null, {
baseUri: 'http://example.com',
headers: {
'Content-Type': 'application/json'
}
});
Base URI
You can override the base URI by setting the baseUri
property, or initializing a client with a base URI. For example:
new MosExecutionApis({
baseUri: 'https://example.com'
});
Base URI Parameters
If the base URI has parameters inline, you can set them by updating the baseUriParameters
property. For example:
client.options.baseUriParameters.version = 'v1';
Resources
All methods return a HTTP request instance of Popsicle, which allows the use of promises (and streaming in node).
resources.ping
Ping the system.
var resource = client.resources.ping;
GET
Ping the MOS system to check availability and build details.
resource.get().then(function (res) { ... });
resources.thing
Create a thing.
var resource = client.resources.thing;
POST
Create a new serialized production unit on the given Process.
If no Process Flow, Flow version, or Flow Step are given, the default configuration is used for the given part number (and option codes, if applicable).
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
partnumber | required | string | product part number to use for the new unit. Example: "1047031-00-A". |
actorname | required | string | name of the primary actor (Equipment, User, System) performing the operation |
processname | required | string | MOS Process on which to create the unit. Example: "BMX". |
flowname | optional | string | Process Flow to use for the new unit -- this will over-ride the default Process Flow defined for the given partnumber. |
flowversion | optional | integer | Process Flow version to use for the new unit -- this will over-ride the default Process Flow version defined for the given partnumber (which is necessary for using non-Production flow versions). |
flowstepname | optional | string | Process Flow Step to start the new unit on -- this will over-ride the default starting Step defined for this Process. |
optioncodes | optional | string array | array of option codes to define the "variable configuration" of the given partnumber (e.g. ["TRA1","TR01","BP00"] ). |
resource.post().then(function (res) { ... });
Body
application/json
resources.thing.thingname(thingname)
- thingname string
Get details for a thing.
var resource = client.resources.thing.thingname(thingname);
GET
Get details for the given thing.
You can search for existing things using the endpoints below:
- /thing/search - search for things with a search term
- /thing/step/{stepname} - get all things in a step
- /part/{partnumber}/things - get things by part number
resource.get().then(function (res) { ... });
resources.thing.search
Search for things.
var resource = client.resources.thing.search;
GET
Search for things using a search term.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g., /search?term=battery).
parameter | required | type | description |
---|---|---|---|
term | required | string | search term for the thing name and description |
resource.get().then(function (res) { ... });
resources.thing.sequencedwipparents
Retrieves the sequenced WIP parents
var resource = client.resources.thing.sequencedwipparents;
GET
Retrieves the sequenced WIP parents.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g. /sequencedwipparents?parent=1MN2:1065600-00-B&child=1FS1:1103547-00-A&optiongroups=DRIVE_MODE).
parameter | required | type | description |
---|---|---|---|
parent | required | string | parent process and part number |
child | required | string | child process and part number |
optiongroups | required | string | the option groups to include option codes for in response |
resource.get().then(function (res) { ... });
resources.thing.sequencedconsumedchildren
Retrieves the sequenced consumed children
var resource = client.resources.thing.sequencedconsumedchildren;
GET
Retrieves the sequenced Consumed Children.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g. /sequencedconsumedchildren?parent=1MN2:1065600-00-B&child=1FS1:1103547-00-A&optiongroups=DRIVE_MODE).
parameter | required | type | description |
---|---|---|---|
parent | required | string | parent process and part number |
child | required | string | child process and part number |
optiongroups | required | string | the option groups to include option codes for in response |
resource.get().then(function (res) { ... });
resources.thing.sequencedwipchildren
Retrieves the sequenced WIP children
var resource = client.resources.thing.sequencedwipchildren;
GET
Retrieves the sequenced WIP Children.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g. /sequencedwipchildren?parent=1MN2:1065600-00-B&child=1FS1:1103547-00-A&optiongroups=DRIVE_MODE).
parameter | required | type | description |
---|---|---|---|
parent | required | string | parent process and part number |
child | required | string | child process and part number |
optiongroups | required | string | the option groups to include option codes for in response |
resource.get().then(function (res) { ... });
resources.thing.partoptiontask
Get tasks by part number and option codes.
var resource = client.resources.thing.partoptiontask;
GET
Fetch the applicable tasks configured for the given part number and option-code rules (if applicable). This API endpoint returns tasks that are defined outside of a Process - instead, they are defined within a Task Collection.
Once you get a task, you can start it and complete it with the endpoints /thing/{thingname}/starttask
and /thing/{thingname}/completetask
, respectively.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g., /tasks?processname=BMX).
parameter | required | type | description |
---|---|---|---|
partnumber | required | string | product part number (e.g., "1009312-00-E") |
taskcollectionname | required | string | the task collection in which to search |
optioncodes | optional | string | comma-separated list of option codes in a single string, needed for variable configured parts (e.g., "XKCD,MGMT") |
resource.get().then(function (res) { ... });
resources.thing.step.stepname(stepname)
- stepname string
Get all things at a step.
var resource = client.resources.thing.step.stepname(stepname);
GET
Returns all things at the given Step.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g., ?slim=true&partnumber=foo).
parameter | required | type | description |
---|---|---|---|
partnumber | optional | string | part number filter. |
slim | optional | boolean | returns slim version without nc, lot, and audit data. |
showoptions | optional | boolean | returns results with thing option codes array. |
limit | optional | integer | limits results to this number. Default is 0 no limit. |
offset | optional | integer | starting point to return from results. Default 0 from the start of the results. |
resource.get().then(function (res) { ... });
resources.thing.thingoptioncode
Bulk updates option codes for things.
var resource = client.resources.thing.thingoptioncode;
PUT
Updates one or more option codes for one or more things.
resource.put().then(function (res) { ... });
Body
application/json
resources.process.processname(processname).work
Get or start available work for a process.
var resource = client.resources.process.processname(processname).work;
GET
Gets available work for this process - i.e., check to see which products need to be made next. This is "card job" oriented - the response returns a list of card jobs that are available for work. Each card job is for a particular part number and available quantity.
The returned card jobs should be ordered by the required in-process time or manually adjusted priority. Automated equipment can safely pick the first card job in the array if only one can be processed.
If the part to be made is a kit part, the element "kitparts" in the response will detail the component parts and quantities that go into making each kit.
URL PARAMETERS
parameter | required | type | description |
---|---|---|---|
partnumber | optional | string | will filter available work by part number |
flowname | optional | string | will filter available work by flow |
flowversion | optional | number | will filter available work by flow/flow version, if provided |
limit | optional | number | Will limit the number of card jobs returned |
firstjobbypart | optional | boolean | If true, will only return the first job for each part |
Start work: To start work on one of the returned card jobs, you can call to endpoint POST /process/{processname}/work
to accept work and generate new production things.
resource.get().then(function (res) { ... });
POST
Start work on a process for a given card job and part number. You can start work on one or many things with this request using the quantity
field. This call will create new production things and respond with a list of new thing names on which to work. This will also move that card quantity of work from "available" to "inprocess" in the given card job.
Getting available work: You can fetch available card job work for a process with the GET /process/{processname}/work
.
Finishing work: Work for a thing is finished when the PUT /thing/{thingname}/finishthing
is called at the end of its production, which moves it into MMS inventory.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
partnumber | required | string | will post by part number |
cardjobid | required | integer | will post by card job ID |
quantity | required | integer | will post by quantity |
actorname | required | string | will post by actor name |
resource.post().then(function (res) { ... });
Body
application/json
resources.part.partnumber(partnumber).things
Get things by part number.
var resource = client.resources.part.partnumber(partnumber).things;
GET
Get a list of things in MOS by part number. This list must be limited to a specific date/time range given by the query parameters listed below. The thing list can be filtered further with optional query parameters.
To find which part numbers are made on a particular process, you can use the GET /process/{id}/part
endpoint.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g., /things?state=WIP).
parameter | required | type | description |
---|---|---|---|
createdfrom | required | datetime | starting filter range for the thing creation date/time - format is RFC3339 date/time (e.g., "2017-04-01T07:00:00.000Z"). |
createdto | required | datetime | ending filter range for the thing creation date/time - format is RFC3339 date/time (e.g., "2017-04-01T07:00:00.000Z"). |
state | optional | string | thing state to which to filter - possible states include: WIP (things in WIP, before consumption), CONSUMED (things consumed into a parent), SCRAP (things scrapped) |
resource.get().then(function (res) { ... });
Query Parameters
resource.get({ ... });
- search string
with valid searchable fields: createdfrom, createdto, state
resources.nonconformance
Create a nonconformance for a thing.
var resource = client.resources.nonconformance;
POST
Create a nonconformance for a given thing (production unit) on a specified Step. If no Step is given, the current Step is assigned.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
thingname | required | string | unique thing identifier |
type | required | string | The type of NC to be created. Valid types include: PRODUCT, PROCESS, EQUIPMENT, PART SHORTAGE, IT SYSTEM |
symptom | required | string | The symptom code observed to create the NC. Valid symptoms include: FAILED, LEAK, LOOSE/NSP, MISSING, NOT TO SPEC, WRONG |
stepname | required | string | related process step to assign to this NC |
processname | required | string | process where the NC should be created (as part of a fully-specified process/flow/version/step) - if not given, the current process step is used |
description | optional | string | description of the NC to be created |
taskname | optional | string | related Task to assign to this NC |
ownername | optional | string | related owner to assign to this NC - by default, the creating actor is used |
parent | optional | string | related parent NC name to assign to this NC |
openedby | optional | string | actor name of the person opening this NC - by default, the creating actor is used |
stepdown | optional | string | mark the related step as "DOWN" by passing "TRUE" - the default is "FALSE" |
partnumber | optional | string | related part number to assign to this NC |
quantity | optional | integer | related product quantity to assign to this NC - this defaults to 1 |
flowname | optional | string | flow where the NC should be created (as part of a fully-specified process/flow/version/step) - if not given, the current process step is used |
flowversion | optional | string | flow version where the NC should be created (as part of a fully-specified process/flow/version/step) - if not given, the current process step is used |
flowstepname | optional | string | flow step where the NC should be created (as part of a fully-specified process/flow/version/step) - if not given, the current process step is used |
resource.post().then(function (res) { ... });
Body
application/json
resources.nonconformance.ncname(ncname)
- ncname string
Fetch/modify an existing nonconformance.
var resource = client.resources.nonconformance.ncname(ncname);
GET
Get the nonconformance details for the specified NC.
resource.get().then(function (res) { ... });
PUT
Update the given nonconformance, i.e., to add or edit an NC action.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
type | required | string | The type of NC to be created. Valid types include: PRODUCT, PROCESS, EQUIPMENT, PART SHORTAGE, IT SYSTEM |
symptom | required | string | The symptom code observed to create the NC. Valid symptoms include: FAILED, LEAK, LOOSE/NSP, MISSING, NOT TO SPEC, WRONG |
state | required | string | nonconformance state - possible values include: OPEN, RESOLVED, CLOSED |
description | optional | string | description of the NC to be created |
quantity | optional | integer | related product quantity to assign to this NC - this defaults to 1 |
ncactions | optional | array | array of NC actions tied to this NC |
resource.put().then(function (res) { ... });
Body
application/json
resources.nonconformance.search
Search for nonconformances.
var resource = client.resources.nonconformance.search;
GET
Search for nonconformances for a given thing, using the query parameters below to filter results.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g., /search?thingname=TFR1709300000G&state=OPEN).
parameter | required | type | description |
---|---|---|---|
thingname | required | string | unique product thing identifier |
state | optional | string | nonconformance state - options are OPEN , CLOSED , RESOLVED . |
stepname | optional | string | filter to NCs created at this step |
stepstate | optional | string | filter to NCs with the given step state |
resource.get().then(function (res) { ... });
Query Parameters
resource.get({ ... });
- search string
with valid searchable fields: thingname, ncstate, stepstate and stepname
resources.picklist
Get manual pick items for a route.
var resource = client.resources.picklist;
GET
Returns manual pick items for a route and actor. Items are auto-accepted by this request and any CardJobs and Cards are set to InProcess/PickScheduled.
If "max to pick" is set for the route step:
- Only that many items will be returned by the call
- Items will be assigned to the actor so that work can be allocated to different operators
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | type | description |
---|---|---|
actor | string | equipment or operator name |
route | string | Route name or route ID. If there are multiple manual route steps in a route, the specific sequence number can be specified with a ".N" at the end of the name, e.g., "HW36-Tote-To-Shipping.2." |
resource.get().then(function (res) { ... });
resources.picklist.ship
Indicate manual picking is completed for a route.
var resource = client.resources.picklist.ship;
POST
For manual pick items, indicates the operator has finished picking for this route and is in transit; returns the shipped pick items. Any accepted pick items that were not picked are returned to Released status.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
route | required | string | currently not a route ID pointing to an entity, this is just an integer representing a numbered route |
actor | required | string | actor name |
resource.post().then(function (res) { ... });
Body
application/json
resources.picklist.delivery
Get manual items to be delivered for a route.
var resource = client.resources.picklist.delivery;
GET
Return manual pick items for a route and actor that are In Transit.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
route | required | string | Route name or route ID. If there are multiple manual route steps in a route, the specific sequence number can be specified with a ".N" at the end of the name, e.g., "HW36-Tote-To-Shipping.2." |
resource.get().then(function (res) { ... });
resources.picklist.deliverforpallet.containertag.containertag(containertag)
- containertag string
Gets all the child pickitems for the pallet container.
var resource = client.resources.picklist.deliverforpallet.containertag.containertag(containertag);
GET
Returns manual child pick items for a pallet container having routestep deliverfrompallet.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | type | description |
---|---|---|
containertag | string | pallet container tag |
resource.get().then(function (res) { ... });
resources.pickitem.pickitemid(pickitemid)
- pickitemid string
Get information about a pickitem/set its status.
var resource = client.resources.pickitem.pickitemid(pickitemid);
GET
Return information about an existing pick item by ID.
Pick item response entity details:
field | type | description |
---|---|---|
id | number | unique pick item identifier |
status | string | lifecycle status of the pick item; see picking overview for details |
route | id,name,description | the route for this pick item |
part | id,name,description | the part to be picked |
containertag | string | The container from which to pick. When picking for a job, this is the recommended container based on the source card that was reserved. |
containerlength | number | length of the container |
containerlengthuom | string | length units |
containerheight | number | height of the container |
containerheightuom | string | height units |
containerwidth | number | width of the container |
containerwidthuom | string | width units |
weight | number | weight of the container, including contents |
containertype | string | the name of the container type from which to pick |
parentcontainertag | string | If the container that was picked has a parent container, this is the parent's tag. Used when picking containers onto a pallet. |
actor | string | if the pick item has been assigned to an actor, the actor name |
quantityrequired | number | the original desired quantity to be picked from the card at the destination |
quantitytopick | number | What the actor is being asked to pick. Usually, this is the same as the quantity required, but if the source card has insufficient quantity, equals the quantity in the source card. |
quantitypicked | number | after status progresses to Picked, the quantity that has been picked |
pickfromlocation | string | location name where the source card was identified or container resides |
sourceslot | number | at the pick location, the starting slot where the container can be found |
sourcenumslot | number | at the pick location, the number of slots the container occupies |
pickedfromlocation | string | location name where the pick actually was reported |
delivertolocation | string | location name where container should be delivered |
deliveredlocation | string | location name where the delivery was reported |
destinationslot | number | at the delivery location, the starting slot where the container was delivered |
destinationnumslot | number | at the delivery location, the number of slots the container occupied |
fullcontainerpick | boolean | indicates whether the source card quantity matches destination card quantity |
lot | string | lot code to be transferred to destination from source card |
maxtopick | number | maximum number of items to pick for this pick item, null or 0 means all were released |
bubbleid | number | some equipment requires a unique tag given to a set of pick items |
orientation | string | desired orientation of the container at delivery (values and meaning TBD) |
isdepalletize | boolean | indicates this pick item is picking a pallet to be broken up into totes for destination cards |
ispalletize | boolean | indicates this pick item is putting single-part pallets together from totes |
isautorelease | boolean | indicates this pick item should be auto-released after prior pick item is completed |
isrepack | boolean | indicates this pick item will be broken down into individual boxes |
unpickable | boolean | indicates this pick item will not be used in pick lists, but only to manage state for other screens (e.g., Load/Unload Trailer) |
picktopallet | boolean | indicates this pick item should prompt for the pallet on which it is placed |
referencenumber | string | optional string equipment can send to reference info in their system |
reason | string | optional string equipment can send to indicate why an item was rejected or unaccepted |
pickedon | datetime | date/time the item was picked |
deliveredon | datetime | date/time the item was delivered |
sourcecardid | number | unique identifier of the source (inventory) card that should be/was picked from |
cardjobid | number | unique identifier of the job; can be null for pure container picks |
asnacknowledge | number | 1 if equipment has acknowledged asn (seen begin cycle item) |
resource.get().then(function (res) { ... });
POST
Update the status of an existing pick item.
The post body indicates which status to which the pick item should be set and includes additional information needed for that status.
Problem Reasons
The following reasons are valid strings in the reason
field:
- PartMissing - when the part could not be found
- ContainerDamaged - when the container specified was damaged
- NotReachable - the container could not physically be picked
- WrongRevision - (needs definition)
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description | relevant to status |
---|---|---|---|---|
status | required | string | Accepted, Unaccepted, Rejected, Picked, Unpicked, InTransit, Delivered | |
referencenumber | optional | string | equipment's identifier for this pick item | all |
reason | required | string | reason why this pick item was rejected/unaccepted | Unaccepted, Rejected |
actor | optional | string | the equipment or person taking this action | all |
containertag | required | string | the label/QR code/RFID of the container picked | Picked |
quantity | optional | number | the quantity actually picked from the container | Picked |
pickedfromlocation | required | string | the name of the location where the container was picked | Picked |
deliveredtolocation | required | string | the name of the location where the container was delivered | Delivered |
destinationslot | optional | number | the starting slot where the container was delivered | Delivered |
destinationnumslot | optional | number | the number of slots the container takes up at delivery location | Delivered |
resource.post().then(function (res) { ... });
Body
application/json
resources.pickitem.sequence
delivers a sequenced pick item or items
var resource = client.resources.pickitem.sequence;
PUT
delivers sequenced pick items for the following scenarios: 1) Container with more than one serial --> Fascia 2) Container with one serial --> IP 3) No container --> Battery pack
resource.put().then(function (res) { ... });
Body
application/json
resources.pickitem.bycontainerorstack.containertag(containertag)
- containertag string
Update pick item status by container or stack.
var resource = client.resources.pickitem.bycontainerorstack.containertag(containertag);
POST
Update the status of an existing pick item by container tag.
The post body indicates which status to which the pick item should be set and includes additional information needed for that status.
Problem Reasons
The following reasons are valid strings in the reason
field:
- PartMissing - when the part could not be found
- ContainerDamaged - when the container specified was damaged
- NotReachable - the container could not physically be picked
- WrongRevision - (needs definition)
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description | relevant to status |
---|---|---|---|---|
status | required | string | Accepted, Unaccepted, Rejected, Picked, Unpicked, InTransit, Delivered | |
referencenumber | optional | string | equipment's identifier for this pick item | all |
reason | required | string | reason why this pick item was rejected/unaccepted | Unaccepted, Rejected |
actor | optional | string | the equipment or person taking this action | all |
containertag | required | string | the label/QR code/RFID of the container picked | Picked |
quantity | optional | number | the quantity actually picked from the container | Picked |
pickedfromlocation | required | string | the name of the location where the container was picked | Picked |
deliveredtolocation | required | string | the name of the location where the container was delivered | Delivered |
destinationslot | optional | number | the starting slot where the container was delivered | Delivered |
destinationnumslot | optional | number | the number of slots the container takes up at delivery location | Delivered |
containertags | optional | string | comma-separated labels/QR codes/RFID of the containers picked | Picked |
resource.post().then(function (res) { ... });
Body
application/json
resources.mrb.scrap
Scrap thing. If the location name is sent as a query parameter (?locationname=XXYYX) then a loop will be created if not found for the configured MRB location.
var resource = client.resources.mrb.scrap;
POST
Scrap can be done either by card ID, thing name, or container tag. To scrap, at least one (card ID, thing name, container tag) should be provided with a nonconformance object.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description | |
---|---|---|---|---|
cardid | optional | number | card ID to scrap by card | |
thingname | optional | string | thing name to scrap by thing | |
containertag | optional | string | optional container tag to scrap by container | |
quantity | required | number | quantity to be scrapped | |
nc | required | object | required nonconformance object to scrap (refer to nonconformance for object reference) |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.consume
Consume material from a replenishment loop location.
var resource = client.resources.loop.consume;
POST
Consume the given inventory material from a "replenishment loop" location. This endpoint allows users to incrementally consume material, based on the given quantity. Another option is to consume an entire replenishment "card" (e.g., a container) using POST /loop/consume
if the resolution of incremental consumption is not needed.
This consumption drives material replenishment to that location, since MOS uses "pull-based" material replenishment. This API endpoint is meant to be used by automated equipment to enable automated material consumption during production.
Defining a card location: Typical use would provide one of the following sets of inputs (described below) to uniquely define the card from which material is being consumed.
partnumber
andlocationname
containertag
(e.g., bar code on a container)loopid
Technical Detail: This transaction decrements the inventory quantity from the oldest on-hand card available in the loop. That card is also marked so that isconsumptioncard=true
. The system will have only one card marked as isconsumptioncard
at any point in time. Once the on-hand card quantity goes to zero, that card will be released for replenishment. If the replenishment process requires more than one card to be grouped (Jobsize) then the card will wait in Begin cycle until the jobsize is reached. If the card is a temporary card or end-of-life card, that card will be destroyed, and a replenishment signal will not be sent to the source.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
actorname | required | string | name of the primary actor (Equipment, User, System) performing the operation |
quantity | required | float | quantity to consume |
partnumber | optional | string | part number to consume, to be used with locationname |
locationname | optional | string | location name from which to consume, to be used with partnumber |
containertag | optional | string | unique container tag identifier (e.g., the bar code on the container) |
loopid | optional | integer | unique loop ID |
consumestack | optional | boolean | if true and containertag ID's a stack, consume all containers in the stack |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.consumecard
Consume an entire card from a replenishment loop location.
var resource = client.resources.loop.consumecard;
POST
Consume an entire replenishment "card" from a "replenishment loop" location. This is a way to consume an entire container, as opposed to incrementally tracking consumption via POST /loop/consume
.
This consumption drives material replenishment to that location, since MOS uses "pull-based" material replenishment. This API endpoint is meant to be used by automated equipment to enable automated material consumption of containers during production.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
actorname | required | string | name of the primary actor (Equipment, User, System) performing the operation |
cardid | optional | integer | material card ID - containertag is an alternative input |
containertag | optional | string | unique container tag identifier (e.g., the bar code on the container) |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.consumepallet
Consumes an entire pallet with child containers or stacks
var resource = client.resources.loop.consumepallet;
POST
Consume an entire pallet that has child container(s) or stack(s). This is a way to consume all the stacks at once, as opposed to incrementally tracking stack consumption via POST /loop/consume
.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
actorname | required | string | name of the primary actor (Equipment, User, System) performing the operation |
pallettag | required | string | unique pallet tag identifier (e.g. the barcode on the pallet) |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.eject
Eject a card onto empty, residual, or MRB route
var resource = client.resources.loop.eject;
POST
Ejects a container onto one of three routes defined for the loop. The empty route is used if the identified container is attached to an empty card. The residual route is used if the card still has material in it. The MRB route is used if the card had MRB reported against it. The card must be in On Hand status.
The container can be identified through any of these parameters
partnumber
andlocationname
loopid
containertag
(e.g. barcode on a container)
If the container tag is not provided, the active consumption card on the loop identified by loop id or partnumber/locationname
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
actorname | required | string | name of the primary actor (Equipment, User, System) performing the operation |
partnumber | optional | string | part number to consume, to be used with locationname |
locationname | optional | string | location name to consume from, to be used with partnumber |
containertag | optional | string | unique container tag identifier (e.g. the barcode on the container) |
loopid | optional | integer | unique loop ID |
forceempty | optional | boolean | will force the container on the empty route |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.createlocationro
Create an RO at a specific location
var resource = client.resources.loop.createlocationro;
POST
This API will create a replenishment order (RO) at a given location name. It expects there to be one active loop at that location. If there is more than one (e.g. during part pedigree changes) it will use the first one and expect part pedigree logic to pick the correct part. The RO card is returned.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
locationname | required | string | the name of the location where RO should be created |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.loopid(loopid).createro
Creates one or more RO's for a loop ID
var resource = client.resources.loop.loopid(loopid).createro;
POST
This API will create one or more replenishment orders (RO) in a loop.
BODY PARAMETERS
Body parameters are passed as the POSTed body in the request.
parameter | required | type | description |
---|---|---|---|
numcard | required | number | The number of RO's to create. |
priority | optional | boolean | Set true to make the RO's have priority flag turned on. Default false. |
mfgordernumber | optional | string | Only allowed if numcard is 1. Manufacturing order to be associated with the RO |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.locationpartsequence
Returns the sequence of parts to be used at a location
var resource = client.resources.loop.locationpartsequence;
GET
Returns the sequence of part counts required at a location and step. This API requires a thing to be at the step at the location. If there is no thing at that step then error code 1100 will be returned. The client should call back after a wait period to get new information. Note that prior information is valid until the next takt time as it only changes as each thing enters/exits the step.
The data returned include the current thing name at the location and an array of (PartNumber, LengthOfRun, Quantity) items indicating in order the parts that will be needed at that location for the upcoming manufacturing sequence. The LengthOfRun is the number of things (e.g. vehicles) for that part. Quantity is the number of parts per thing (vehicle) which comes from the BOM.
QUERY PARAMETERS
Query parameters are passed in the URL
parameter | required | type | description |
---|---|---|---|
locationname | required | string | Location name where sequence calculation is to be performed. |
stepname | required | string | Step name where sequence calculation is to be performed, e.g. 1MN1-050. |
count | required | numeric | Number of things in the manufacturing sequence to examine, e.g. 500 in GA for the next 500 vehicles |
resource.get().then(function (res) { ... });
resources.loop.setquantity
Sets the absolute quantity on a virtual kanban loop
var resource = client.resources.loop.setquantity;
POST
Sets the absolute quantity of material in a loop, typically through measuring. The loop must be defined as a Virtual Kanban. The typical sequence of events will be:
- Start with a permanent on hand card with quantity 100
- Measurement taken, call SetQuantity with 90; card quantity is adjusted
- Measurement taken, call SetQuantity with 80; card quantity is adjusted
- Virtual loop order at quantity is 85, so the system will
- Convert the existing card to temporary
- Create a new permanent card that is Released to the supplier
- Measurement taken, call SetQuantity with 70; temp card quantity is adjusted
- Measurement taken, call SetQuantity with 60; temp card quantity is adjusted
- Material arrives, call SetQuantity with 155
- Released permanent card is put On Hand with quantity 155
- Temporary card (was QOH 60) is deleted
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
quantity | required | float | absolute quantity now present of this part |
partnumber | required | string | part number to be set |
locationname | required | string | location name to be set |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.adjustcounter
Adjusts a countdown loop counter up or down
var resource = client.resources.loop.adjustcounter;
POST
Adjusts the counter on a loop with type CountDown. Can be used to adjust the counter UP or DOWN. If adjusting down, MOS will reduce the counter to zero and place a replishment order as many times as necessary to use up the entire delta provided.
Example:
- Loop card quantity is 15
- Current counter is at 6
- AdjustCounter is called with -25
MOS will reduce the counter from 6 to zero and place one order. The counter gets reset to 15 (card quantity). Then since there is still -19 to apply, the counter is reduced from 15 to zero and another order is placed. The counter will end up at 11 (15 card quantity - 4 remaining from the delta argument.)
The loop can be identified by either
partnumber
andlocationname
loopid
If the identified loop is not of type CountDown, an error is returned.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
delta | required | float | Quantity to adjust the counter by. |
partnumber | optional | string | Part number to identify the loop, to be used with locationname |
locationname | optional | string | Location name to identify the loop, to be used with partnumber |
loopid | optional | integer | Unique loop ID to identify the loop |
resource.post().then(function (res) { ... });
Body
application/json
resources.loop.counter
Gets the current counter for a countdown loop
var resource = client.resources.loop.counter;
GET
Returns the counter on a loop with type CountDown.
The loop can be identified by either
partnumber
andlocationname
loopid
If the identified loop is not of type CountDown, an error is returned.
URL PARAMETERS
URL parameters are passed in url in key=value&key2=value2 format
parameter | required | type | description |
---|---|---|---|
partnumber | optional | string | Part number to identify the loop, to be used with locationname |
locationname | optional | string | Location name to identify the loop, to be used with partnumber |
loopid | optional | integer | Unique loop ID to identify the loop |
resource.get().then(function (res) { ... });
resources.loop.countdowncounters
Gets a filtered list of countdown counters
var resource = client.resources.loop.countdowncounters;
GET
Returns countdown loop counters filtered by part, location, and site. The parameters are combined together as one filter, e.g. if partnumber and site are provided, only loops with both that part and site will be included.
URL PARAMETERS
URL parameters are passed in url in key=value&key2=value2 format
parameter | required | type | description |
---|---|---|---|
partnumber | optional | string | Part number filter. |
locationname | optional | string | Location name filter. |
site | optional | string | Site filter. |
resource.get().then(function (res) { ... });
resources.loop.id(ID).recallablecard
Return all recallable cards for the specified loop.
var resource = client.resources.loop.id(ID).recallablecard;
GET
Return all recallable cards for a loop.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
ID | required | number | the loop ID |
Fields in a card response include:
field | type | description |
---|---|---|
id | number | unique card identifier |
cycleno | number | cycle number, increased every time card goes to the begin cycle |
loopid | number | unique identifier of the card's loop |
partid | number | unique identifier of the card's part |
partnumber | string | Tesla part number held in the card |
partdescription | string | description of the part held in the card |
label | string | current content label or container tag for the card |
status | number | 1=BeginCycle, 2=Released, 3=InProcess, 4=InTransit, 5=AtDock, 6=OnHand, 7=Inspection |
statustring | string | status decoded as a string per above list |
location | object | ID, name, description of the card's current location |
quantityonhand | number | when status = OnHand, the quantity available to be used in the card; for other statuses, this quantity is in process |
quantityreserved | number | quantity that pick items holding reservations have reserved |
quantityconsumed | number | most recent quantity consumed (not total) |
iscurrentconsumption | boolean | flag indicating this card is actively being consumed for its loop |
istemp | boolean | flag indicating this card is temporary and will live a number of lives or expire by date |
lifecount | number | how many lives remain for this card, if it is temporary |
expireson | datetime | if not null, date/time this card will be deleted, if it is temporary |
donotuse | boolean | flag indicating there is a problem with this card; set by skipping a pick |
qchold | boolean | flag indicating there is a quality hold on the card |
unusable | boolean | donotuse or qchold |
resource.get().then(function (res) { ... });
resources.loop.inventoryreport.bytrailer
Returns on-hand inventory report by trailer
var resource = client.resources.loop.inventoryreport.bytrailer;
GET
Returns on-hand inventory report by trailer
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
ID | required | number | the location ID, part ID, or loop ID |
type | required | string | the 'Location', 'Part', 'Loop', or 'Trailer' |
Fields in the response include:
field | type | description |
---|---|---|
partnumber | string | Tesla part number |
partdescription | null.String | The part description |
cardlocation | null.String | The location name for the card |
locdescription | null.String | The description of the location |
locationtype | string | The type of the location |
availablequantity | null.Float | Quantity on-hand summed across all cards |
cardstatus | string | OnHand |
trailerno | string | Trailer the card came from |
resource.get().then(function (res) { ... });
resources.loop.ryginventoryreport
Returns RYG inventory report by loop, part, location, or trailer
var resource = client.resources.loop.ryginventoryreport;
GET
Return RYG inventory report by location.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
ID | optional | number | the location ID, part ID, or loop ID |
type | required | string | the 'Location', 'Part', 'Loop', or 'Trailer' |
name | optional | string | the trailer number |
Fields in the response include:
field | type | description |
---|---|---|
loopid | number | unique identifier of the loop |
loopname | string | name of the loop |
partid | number | unique identifier of the part |
partnumber | string | Tesla part number |
locname | string | The location name for the loop |
locdesc | string | The description of the location |
partdescription | string | The part description |
locname | string | the location name for the loop |
loopcardquantity | number | card quantity defined on the loop |
cardcount | number | number of cards |
actualonhandqty | number | quantity on-hand summed across all cards |
totalquantity | number | total quantity on-hand for the loop, for all cards |
rygpercentage | number | RED, YELLOW, GREEN percentage |
rygflag | string | RED, YELLOW, GREEN status |
trailerno | null.String | The trailer number |
resource.get().then(function (res) { ... });
resources.loop.materialexpirationreport
Returns material expiration report by site, part, warehouse, zone, or cardid
var resource = client.resources.loop.materialexpirationreport;
GET
Return material expiration inventory report for parts with shelf life by site/location/part.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
site | required | string | required site name |
location | optional | string | optional warehouse or zone name |
partnumber | optional | string | optional part number |
expiresin | required | number | required expires in days, pass -1 for getting all records |
yellowlevel | required | number | optional yellow if expires in n days |
cardid | optional | number | optional card id |
resource.get().then(function (res) { ... });
resources.actor
Get all actors
var resource = client.resources.actor;
GET
Get all actors provides details on actors, their role, and optionally permisions.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL (e.g. /actor?includepermission=true&type="actor,equipment").
parameter | required | type | description |
---|---|---|---|
includepermission | optional | boolean | If set to true the permissons will be included in the response. |
type | optional | string | A comma separated list of actor type to include. One or more of user,equipment,system |
resource.get().then(function (res) { ... });
resources.actor.actor(actor).picklist
Get released actor pick items or Post to autoaccept released items.
var resource = client.resources.actor.actor(actor).picklist;
GET
Return an array of pick items for the actor, typically a piece of equipment like ASRS or AGV. By default, returns pick items with status Released. This represents the work that the actor is being asked to do.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL. NOTE: only one may be used.
parameter | type | description |
---|---|---|
allactive | boolean | if true, return Released, Accepted, Picked, InTransit pick items |
inprocess | boolean | if true, return Accepted, Picked, InTransit pick items |
mode | string | if "asn," return BeginCycle pick items as an "advanced look" at what will be released |
resource.get().then(function (res) { ... });
POST
Auto accept and return an array of pick items for the actor, typically a piece of equipment like ASRS or AGV. Examine items in Released state for the actor in "time required" order and auto-accept them, up to "max to pick" if that field is non-zero on the route step for each pick item, otherwise all of them.
Items auto-accepted through this API will have a bubble ID assigned to them that represents the group of items. Some equipment (e.g., Dematic) has a special format for the response that is triggered by settinggroupbybubble=true
parameter. Otherwise, the response is an array of pick items.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
groupbybubble | optional | boolean | special format where pick items are grouped by bubble ID as a numeric |
resource.post().then(function (res) { ... });
Body
application/json
resources.actor.actorid(actorid).rolename(rolename)
- rolename string
Set the role for existing actor by id.
var resource = client.resources.actor.actorid(actorid).rolename(rolename);
PUT
Set an actor's role.
QUERY PARAMETERS
n/a
resource.put().then(function (res) { ... });
Body
application/json
resources.actorpermision.actorid(actorid).permissionshortname(permissionshortname)
- permissionshortname string
Set a permission for existing actor by id.
var resource = client.resources.actorpermision.actorid(actorid).permissionshortname(permissionshortname);
POST
Add a permission to an actor by id using the permisson short name (3 characters maximum)
QUERY PARAMETERS
n/a
resource.post().then(function (res) { ... });
Body
application/json
DELETE
Delete a permission from an actor by id using the permisson short name (3 characters maximum)
QUERY PARAMETERS
n/a
resource.delete().then(function (res) { ... });
Body
application/json
resources.card.id(ID)
- ID string
Get a card by ID.
var resource = client.resources.card.id(ID);
GET
Return basic information about a card.
Fields in a card response include:
field | type | description |
---|---|---|
id | number | unique card identifier |
cycleno | number | cycle number, increased every time card goes into begin cycle |
loopid | number | unique identifier of the card's loop |
partid | number | unique identifier of the card's part |
partnumber | string | Tesla part number held in the card |
partdescription | string | description of the part held in the card |
label | string | current content label or container tag for the card |
status | number | 1=BeginCycle, 2=Released, 3=InProcess, 4=InTransit, 5=AtDock, 6=OnHand, 7=Inspection |
statustring | string | status decoded as a string per above list |
location | object | ID, name, description of the card's current location |
quantityonhand | number | when status = OnHand, the quantity available to be used in the card; for other statuses, this quantity is In Process |
quantityreserved | number | quantity that pick items holding reservations have reserved |
quantityconsumed | number | most recent quantity consumed (not total) |
iscurrentconsumption | boolean | flag indicating this card is actively being consumed for its loop |
istemp | boolean | flag indicating this card is temporary and will live a number of lives or expire by date |
lifecount | number | quantity of lives remaining for this card, if it is temporary |
expireson | datetime | if not null, date/time this card will be deleted, if it is temporary |
donotuse | boolean | flag indicating there is a problem with this card, set by skipping a pick |
qchold | boolean | flag indicating there is a quality hold on the card |
unusable | boolean | donotuse or qchold |
resource.get().then(function (res) { ... });
resources.card.split
Split quantity from a single card into other containers by container
var resource = client.resources.card.split;
POST
Splits quantity from an existing on-hand card into multiple containers. The containers cannot be attached to cards, they must be empty.
BODY PARAMETERS
The body of split card by container request has the source container and an array of container/quantity objects for the destination containers.
parameter | required | type | description |
---|---|---|---|
containertag | required | string | the tag of the container to split from |
destinations | required | array | array of containertag/quantity pairs as per split card |
allowzero | optional | boolean | allow quantity on source card to reach zero (default false) |
allowconsolidate | optional | boolean | if true, then splitting into a non-empty container (of the same part number) is allowed (default false) |
resource.post().then(function (res) { ... });
Body
application/json
resources.card.mrb
Report MRB.
var resource = client.resources.card.mrb;
POST
MRB can be reported either by card ID, thingname, or container tag. To create MRB, at least one (cardid, thingname, containertag) should be provided with array of nonconformance object.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description | |
---|---|---|---|---|
cardid | optional | number | card ID to report MRB by card | |
thingname | optional | string | thing name to report MRB by thing | |
containertag | optional | string | optional container tag to report MRB by container | |
mrbncs | required | object array | required nonconformance object to report MRB (refer to nonconformance for object reference) |
resource.post().then(function (res) { ... });
Body
application/json
resources.card.lot.bycontainer.containertag(containertag)
- containertag string
Get a single lot by position in a card using container tag or add a lot.
var resource = client.resources.card.lot.bycontainer.containertag(containertag);
GET
Return information about a single lot in a card by position.
Lots with no position are ignored in the calculation.
Consider the following lot information:
lot | position | quantity |
---|---|---|
L1 | 1 | 5 |
L2 | 6 | 8 |
L3 | 20 | 9 |
In this case there is a gap (empty spots on a tray, for example).
A call to get lot by position 4 would return L1. A call with position 18 would return a 404 error since there is no lot at that position.
The parameter hightolow allows calculation of lot from the end of the lot positions to the beginning. This is useful when loading lots into a container from the bottom to top and then picking from the top of the container. In the example above, the last position is 28 which would correspond to position 1 when this flag is true. For this example, the following positions would give these results:
positions | lot |
---|---|
1, 5, 9 | L3 |
10, 13, 15 | 404 error |
16, 19, 23 | L2 |
24, 26, 28 | L1 |
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
position | required | number | 1-relative position to find lot |
hightolow | optional | boolean | if true, start from the end of all lot positions |
resource.get().then(function (res) { ... });
POST
Add a new lot to a card.
BODY PARAMETERS
Input parameters are passed in the raw post body as JSON fields.
parameter | required | type | description |
---|---|---|---|
lot | required | string | the lot code of the lot being added |
quantity | required | number | how many of the lot is being added |
position | optional | number | optional position within the container |
part | optional | object | either "id" or "partnumber" should be provided |
resource.post().then(function (res) { ... });
Body
application/json
DELETE
Remove a lot from a card by the lot code and optional position. If position is not given, all instances of that lot code will be removed.
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|---|---|---|
lot | required | string | the lot code to remove |
position | optional | number | 1-relative, always from low to high |
resource.delete().then(function (res) { ... });
Body
application/json
resources.card.lots.bycontainertag.containertag(containertag)
- containertag string
Get all of a card's lots using container tag.
var resource = client.resources.card.lots.bycontainertag.containertag(containertag);
GET
Return information about the lots in a card. Lot information is stored in the CardThing table with type "LOT." Typically, a lot is of the same part as the card, but it is possible with kitted parts to have lots of different parts. It is also possible to have multiple lots of the same part in a card.
Lot position is an optional field, but can be used to track where this lot starts and ends (using quantity) on a tray or a magazine. Position is 1-relative.
Fields in a card lot include:
field | type | description |
---|---|---|
id | number | unique card thing table identifier |
cardid | number | unique card table identifier |
cycleno | number | cycle number; increased every time card goes into begin cycle |
lot | string | the lot code itself |
part | object | ID, part number, description for the lot's part |
position | number | optional 1-relative position where this lot starts |
quantity | number | quantity of this lot in the card or at the position if provided |
resource.get().then(function (res) { ... });
resources.card.onhandforparts
Return the onhand quantities for all loops associated with a list of part IDs.
var resource = client.resources.card.onhandforparts;
POST
Accept an array of part IDs as input, and return an array containing all the loops for that part, along with the on-hand quantity for each loop.
field | type | description |
---|---|---|
partid | number | unique part ID |
loopname | string | name for a particular loop |
quantity | number | on-hand quantity for this loop |
resource.post().then(function (res) { ... });
Body
application/json
resources.card.forloop.id(ID)
- ID string
Get all the cards for the loop id
var resource = client.resources.card.forloop.id(ID);
GET
Get Cards for loop returns all the cards associated with that loop. If returnemptyarray is not given and there no cards found for that loop it will return error 404, but if given and set to true it will return 200 with empty cardlist
QUERY PARAMETERS
Query parameters are passed as a query string in the URL.
parameter | required | type | description |
---|
| retur
2 years ago