0.0.0 • Published 2 years ago

mos-execution-apis v0.0.0

Weekly downloads
-
License
Apache 2.0
Repository
github
Last release
2 years ago

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.

parameterrequiredtypedescription
partnumberrequiredstringproduct part number to use for the new unit. Example: "1047031-00-A".
actornamerequiredstringname of the primary actor (Equipment, User, System) performing the operation
processnamerequiredstringMOS Process on which to create the unit. Example: "BMX".
flownameoptionalstringProcess Flow to use for the new unit -- this will over-ride the default Process Flow defined for the given partnumber.
flowversionoptionalintegerProcess 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).
flowstepnameoptionalstringProcess Flow Step to start the new unit on -- this will over-ride the default starting Step defined for this Process.
optioncodesoptionalstring arrayarray 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).

parameterrequiredtypedescription
termrequiredstringsearch 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).

parameterrequiredtypedescription
parentrequiredstringparent process and part number
childrequiredstringchild process and part number
optiongroupsrequiredstringthe 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).

parameterrequiredtypedescription
parentrequiredstringparent process and part number
childrequiredstringchild process and part number
optiongroupsrequiredstringthe 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).

parameterrequiredtypedescription
parentrequiredstringparent process and part number
childrequiredstringchild process and part number
optiongroupsrequiredstringthe 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).

parameterrequiredtypedescription
partnumberrequiredstringproduct part number (e.g., "1009312-00-E")
taskcollectionnamerequiredstringthe task collection in which to search
optioncodesoptionalstringcomma-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).

parameterrequiredtypedescription
partnumberoptionalstringpart number filter.
slimoptionalbooleanreturns slim version without nc, lot, and audit data.
showoptionsoptionalbooleanreturns results with thing option codes array.
limitoptionalintegerlimits results to this number. Default is 0 no limit.
offsetoptionalintegerstarting 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

parameterrequiredtypedescription
partnumberoptionalstringwill filter available work by part number
flownameoptionalstringwill filter available work by flow
flowversionoptionalnumberwill filter available work by flow/flow version, if provided
limitoptionalnumberWill limit the number of card jobs returned
firstjobbypartoptionalbooleanIf 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.

parameterrequiredtypedescription
partnumberrequiredstringwill post by part number
cardjobidrequiredintegerwill post by card job ID
quantityrequiredintegerwill post by quantity
actornamerequiredstringwill 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).

parameterrequiredtypedescription
createdfromrequireddatetimestarting filter range for the thing creation date/time - format is RFC3339 date/time (e.g., "2017-04-01T07:00:00.000Z").
createdtorequireddatetimeending filter range for the thing creation date/time - format is RFC3339 date/time (e.g., "2017-04-01T07:00:00.000Z").
stateoptionalstringthing 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.

parameterrequiredtypedescription
thingnamerequiredstringunique thing identifier
typerequiredstringThe type of NC to be created. Valid types include: PRODUCT, PROCESS, EQUIPMENT, PART SHORTAGE, IT SYSTEM
symptomrequiredstringThe symptom code observed to create the NC. Valid symptoms include: FAILED, LEAK, LOOSE/NSP, MISSING, NOT TO SPEC, WRONG
stepnamerequiredstringrelated process step to assign to this NC
processnamerequiredstringprocess 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
descriptionoptionalstringdescription of the NC to be created
tasknameoptionalstringrelated Task to assign to this NC
ownernameoptionalstringrelated owner to assign to this NC - by default, the creating actor is used
parentoptionalstringrelated parent NC name to assign to this NC
openedbyoptionalstringactor name of the person opening this NC - by default, the creating actor is used
stepdownoptionalstringmark the related step as "DOWN" by passing "TRUE" - the default is "FALSE"
partnumberoptionalstringrelated part number to assign to this NC
quantityoptionalintegerrelated product quantity to assign to this NC - this defaults to 1
flownameoptionalstringflow 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
flowversionoptionalstringflow 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
flowstepnameoptionalstringflow 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.

parameterrequiredtypedescription
typerequiredstringThe type of NC to be created. Valid types include: PRODUCT, PROCESS, EQUIPMENT, PART SHORTAGE, IT SYSTEM
symptomrequiredstringThe symptom code observed to create the NC. Valid symptoms include: FAILED, LEAK, LOOSE/NSP, MISSING, NOT TO SPEC, WRONG
staterequiredstringnonconformance state - possible values include: OPEN, RESOLVED, CLOSED
descriptionoptionalstringdescription of the NC to be created
quantityoptionalintegerrelated product quantity to assign to this NC - this defaults to 1
ncactionsoptionalarrayarray 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).

parameterrequiredtypedescription
thingnamerequiredstringunique product thing identifier
stateoptionalstringnonconformance state - options are OPEN, CLOSED, RESOLVED.
stepnameoptionalstringfilter to NCs created at this step
stepstateoptionalstringfilter 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.

parametertypedescription
actorstringequipment or operator name
routestringRoute 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.

parameterrequiredtypedescription
routerequiredstringcurrently not a route ID pointing to an entity, this is just an integer representing a numbered route
actorrequiredstringactor 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.

parameterrequiredtypedescription
routerequiredstringRoute 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.

parametertypedescription
containertagstringpallet 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:

fieldtypedescription
idnumberunique pick item identifier
statusstringlifecycle status of the pick item; see picking overview for details
routeid,name,descriptionthe route for this pick item
partid,name,descriptionthe part to be picked
containertagstringThe container from which to pick. When picking for a job, this is the recommended container based on the source card that was reserved.
containerlengthnumberlength of the container
containerlengthuomstringlength units
containerheightnumberheight of the container
containerheightuomstringheight units
containerwidthnumberwidth of the container
containerwidthuomstringwidth units
weightnumberweight of the container, including contents
containertypestringthe name of the container type from which to pick
parentcontainertagstringIf the container that was picked has a parent container, this is the parent's tag. Used when picking containers onto a pallet.
actorstringif the pick item has been assigned to an actor, the actor name
quantityrequirednumberthe original desired quantity to be picked from the card at the destination
quantitytopicknumberWhat 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.
quantitypickednumberafter status progresses to Picked, the quantity that has been picked
pickfromlocationstringlocation name where the source card was identified or container resides
sourceslotnumberat the pick location, the starting slot where the container can be found
sourcenumslotnumberat the pick location, the number of slots the container occupies
pickedfromlocationstringlocation name where the pick actually was reported
delivertolocationstringlocation name where container should be delivered
deliveredlocationstringlocation name where the delivery was reported
destinationslotnumberat the delivery location, the starting slot where the container was delivered
destinationnumslotnumberat the delivery location, the number of slots the container occupied
fullcontainerpickbooleanindicates whether the source card quantity matches destination card quantity
lotstringlot code to be transferred to destination from source card
maxtopicknumbermaximum number of items to pick for this pick item, null or 0 means all were released
bubbleidnumbersome equipment requires a unique tag given to a set of pick items
orientationstringdesired orientation of the container at delivery (values and meaning TBD)
isdepalletizebooleanindicates this pick item is picking a pallet to be broken up into totes for destination cards
ispalletizebooleanindicates this pick item is putting single-part pallets together from totes
isautoreleasebooleanindicates this pick item should be auto-released after prior pick item is completed
isrepackbooleanindicates this pick item will be broken down into individual boxes
unpickablebooleanindicates this pick item will not be used in pick lists, but only to manage state for other screens (e.g., Load/Unload Trailer)
picktopalletbooleanindicates this pick item should prompt for the pallet on which it is placed
referencenumberstringoptional string equipment can send to reference info in their system
reasonstringoptional string equipment can send to indicate why an item was rejected or unaccepted
pickedondatetimedate/time the item was picked
deliveredondatetimedate/time the item was delivered
sourcecardidnumberunique identifier of the source (inventory) card that should be/was picked from
cardjobidnumberunique identifier of the job; can be null for pure container picks
asnacknowledgenumber1 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.

parameterrequiredtypedescriptionrelevant to status
statusrequiredstringAccepted, Unaccepted, Rejected, Picked, Unpicked, InTransit, Delivered
referencenumberoptionalstringequipment's identifier for this pick itemall
reasonrequiredstringreason why this pick item was rejected/unacceptedUnaccepted, Rejected
actoroptionalstringthe equipment or person taking this actionall
containertagrequiredstringthe label/QR code/RFID of the container pickedPicked
quantityoptionalnumberthe quantity actually picked from the containerPicked
pickedfromlocationrequiredstringthe name of the location where the container was pickedPicked
deliveredtolocationrequiredstringthe name of the location where the container was deliveredDelivered
destinationslotoptionalnumberthe starting slot where the container was deliveredDelivered
destinationnumslotoptionalnumberthe number of slots the container takes up at delivery locationDelivered
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.

parameterrequiredtypedescriptionrelevant to status
statusrequiredstringAccepted, Unaccepted, Rejected, Picked, Unpicked, InTransit, Delivered
referencenumberoptionalstringequipment's identifier for this pick itemall
reasonrequiredstringreason why this pick item was rejected/unacceptedUnaccepted, Rejected
actoroptionalstringthe equipment or person taking this actionall
containertagrequiredstringthe label/QR code/RFID of the container pickedPicked
quantityoptionalnumberthe quantity actually picked from the containerPicked
pickedfromlocationrequiredstringthe name of the location where the container was pickedPicked
deliveredtolocationrequiredstringthe name of the location where the container was deliveredDelivered
destinationslotoptionalnumberthe starting slot where the container was deliveredDelivered
destinationnumslotoptionalnumberthe number of slots the container takes up at delivery locationDelivered
containertagsoptionalstringcomma-separated labels/QR codes/RFID of the containers pickedPicked
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.

parameterrequiredtypedescription
cardidoptionalnumbercard ID to scrap by card
thingnameoptionalstringthing name to scrap by thing
containertagoptionalstringoptional container tag to scrap by container
quantityrequirednumberquantity to be scrapped
ncrequiredobjectrequired 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 and locationname
  • 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.

parameterrequiredtypedescription
actornamerequiredstringname of the primary actor (Equipment, User, System) performing the operation
quantityrequiredfloatquantity to consume
partnumberoptionalstringpart number to consume, to be used with locationname
locationnameoptionalstringlocation name from which to consume, to be used with partnumber
containertagoptionalstringunique container tag identifier (e.g., the bar code on the container)
loopidoptionalintegerunique loop ID
consumestackoptionalbooleanif 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.

parameterrequiredtypedescription
actornamerequiredstringname of the primary actor (Equipment, User, System) performing the operation
cardidoptionalintegermaterial card ID - containertag is an alternative input
containertagoptionalstringunique 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.

parameterrequiredtypedescription
actornamerequiredstringname of the primary actor (Equipment, User, System) performing the operation
pallettagrequiredstringunique 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 and locationname
  • 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.

parameterrequiredtypedescription
actornamerequiredstringname of the primary actor (Equipment, User, System) performing the operation
partnumberoptionalstringpart number to consume, to be used with locationname
locationnameoptionalstringlocation name to consume from, to be used with partnumber
containertagoptionalstringunique container tag identifier (e.g. the barcode on the container)
loopidoptionalintegerunique loop ID
forceemptyoptionalbooleanwill 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.

parameterrequiredtypedescription
locationnamerequiredstringthe 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.

parameterrequiredtypedescription
numcardrequirednumberThe number of RO's to create.
priorityoptionalbooleanSet true to make the RO's have priority flag turned on. Default false.
mfgordernumberoptionalstringOnly 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

parameterrequiredtypedescription
locationnamerequiredstringLocation name where sequence calculation is to be performed.
stepnamerequiredstringStep name where sequence calculation is to be performed, e.g. 1MN1-050.
countrequirednumericNumber 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.

parameterrequiredtypedescription
quantityrequiredfloatabsolute quantity now present of this part
partnumberrequiredstringpart number to be set
locationnamerequiredstringlocation 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 and locationname
  • 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.

parameterrequiredtypedescription
deltarequiredfloatQuantity to adjust the counter by.
partnumberoptionalstringPart number to identify the loop, to be used with locationname
locationnameoptionalstringLocation name to identify the loop, to be used with partnumber
loopidoptionalintegerUnique 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 and locationname
  • 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

parameterrequiredtypedescription
partnumberoptionalstringPart number to identify the loop, to be used with locationname
locationnameoptionalstringLocation name to identify the loop, to be used with partnumber
loopidoptionalintegerUnique 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

parameterrequiredtypedescription
partnumberoptionalstringPart number filter.
locationnameoptionalstringLocation name filter.
siteoptionalstringSite 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.

parameterrequiredtypedescription
IDrequirednumberthe loop ID

Fields in a card response include:

fieldtypedescription
idnumberunique card identifier
cyclenonumbercycle number, increased every time card goes to the begin cycle
loopidnumberunique identifier of the card's loop
partidnumberunique identifier of the card's part
partnumberstringTesla part number held in the card
partdescriptionstringdescription of the part held in the card
labelstringcurrent content label or container tag for the card
statusnumber1=BeginCycle, 2=Released, 3=InProcess, 4=InTransit, 5=AtDock, 6=OnHand, 7=Inspection
statustringstringstatus decoded as a string per above list
locationobjectID, name, description of the card's current location
quantityonhandnumberwhen status = OnHand, the quantity available to be used in the card; for other statuses, this quantity is in process
quantityreservednumberquantity that pick items holding reservations have reserved
quantityconsumednumbermost recent quantity consumed (not total)
iscurrentconsumptionbooleanflag indicating this card is actively being consumed for its loop
istempbooleanflag indicating this card is temporary and will live a number of lives or expire by date
lifecountnumberhow many lives remain for this card, if it is temporary
expiresondatetimeif not null, date/time this card will be deleted, if it is temporary
donotusebooleanflag indicating there is a problem with this card; set by skipping a pick
qcholdbooleanflag indicating there is a quality hold on the card
unusablebooleandonotuse 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.

parameterrequiredtypedescription
IDrequirednumberthe location ID, part ID, or loop ID
typerequiredstringthe 'Location', 'Part', 'Loop', or 'Trailer'

Fields in the response include:

fieldtypedescription
partnumberstringTesla part number
partdescriptionnull.StringThe part description
cardlocationnull.StringThe location name for the card
locdescriptionnull.StringThe description of the location
locationtypestringThe type of the location
availablequantitynull.FloatQuantity on-hand summed across all cards
cardstatusstringOnHand
trailernostringTrailer 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.

parameterrequiredtypedescription
IDoptionalnumberthe location ID, part ID, or loop ID
typerequiredstringthe 'Location', 'Part', 'Loop', or 'Trailer'
nameoptionalstringthe trailer number

Fields in the response include:

fieldtypedescription
loopidnumberunique identifier of the loop
loopnamestringname of the loop
partidnumberunique identifier of the part
partnumberstringTesla part number
locnamestringThe location name for the loop
locdescstringThe description of the location
partdescriptionstringThe part description
locnamestringthe location name for the loop
loopcardquantitynumbercard quantity defined on the loop
cardcountnumbernumber of cards
actualonhandqtynumberquantity on-hand summed across all cards
totalquantitynumbertotal quantity on-hand for the loop, for all cards
rygpercentagenumberRED, YELLOW, GREEN percentage
rygflagstringRED, YELLOW, GREEN status
trailernonull.StringThe 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.

parameterrequiredtypedescription
siterequiredstringrequired site name
locationoptionalstringoptional warehouse or zone name
partnumberoptionalstringoptional part number
expiresinrequirednumberrequired expires in days, pass -1 for getting all records
yellowlevelrequirednumberoptional yellow if expires in n days
cardidoptionalnumberoptional 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").

parameterrequiredtypedescription
includepermissionoptionalbooleanIf set to true the permissons will be included in the response.
typeoptionalstringA 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.

parametertypedescription
allactivebooleanif true, return Released, Accepted, Picked, InTransit pick items
inprocessbooleanif true, return Accepted, Picked, InTransit pick items
modestringif "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.

parameterrequiredtypedescription
groupbybubbleoptionalbooleanspecial 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:

fieldtypedescription
idnumberunique card identifier
cyclenonumbercycle number, increased every time card goes into begin cycle
loopidnumberunique identifier of the card's loop
partidnumberunique identifier of the card's part
partnumberstringTesla part number held in the card
partdescriptionstringdescription of the part held in the card
labelstringcurrent content label or container tag for the card
statusnumber1=BeginCycle, 2=Released, 3=InProcess, 4=InTransit, 5=AtDock, 6=OnHand, 7=Inspection
statustringstringstatus decoded as a string per above list
locationobjectID, name, description of the card's current location
quantityonhandnumberwhen status = OnHand, the quantity available to be used in the card; for other statuses, this quantity is In Process
quantityreservednumberquantity that pick items holding reservations have reserved
quantityconsumednumbermost recent quantity consumed (not total)
iscurrentconsumptionbooleanflag indicating this card is actively being consumed for its loop
istempbooleanflag indicating this card is temporary and will live a number of lives or expire by date
lifecountnumberquantity of lives remaining for this card, if it is temporary
expiresondatetimeif not null, date/time this card will be deleted, if it is temporary
donotusebooleanflag indicating there is a problem with this card, set by skipping a pick
qcholdbooleanflag indicating there is a quality hold on the card
unusablebooleandonotuse 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.

parameterrequiredtypedescription
containertagrequiredstringthe tag of the container to split from
destinationsrequiredarrayarray of containertag/quantity pairs as per split card
allowzerooptionalbooleanallow quantity on source card to reach zero (default false)
allowconsolidateoptionalbooleanif 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.

parameterrequiredtypedescription
cardidoptionalnumbercard ID to report MRB by card
thingnameoptionalstringthing name to report MRB by thing
containertagoptionalstringoptional container tag to report MRB by container
mrbncsrequiredobject arrayrequired 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:

lotpositionquantity
L115
L268
L3209

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:

positionslot
1, 5, 9L3
10, 13, 15404 error
16, 19, 23L2
24, 26, 28L1

QUERY PARAMETERS

Query parameters are passed as a query string in the URL.

parameterrequiredtypedescription
positionrequirednumber1-relative position to find lot
hightolowoptionalbooleanif 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.

parameterrequiredtypedescription
lotrequiredstringthe lot code of the lot being added
quantityrequirednumberhow many of the lot is being added
positionoptionalnumberoptional position within the container
partoptionalobjecteither "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.

parameterrequiredtypedescription
lotrequiredstringthe lot code to remove
positionoptionalnumber1-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:

fieldtypedescription
idnumberunique card thing table identifier
cardidnumberunique card table identifier
cyclenonumbercycle number; increased every time card goes into begin cycle
lotstringthe lot code itself
partobjectID, part number, description for the lot's part
positionnumberoptional 1-relative position where this lot starts
quantitynumberquantity 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.

fieldtypedescription
partidnumberunique part ID
loopnamestringname for a particular loop
quantitynumberon-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.

parameterrequiredtypedescription

| retur

0.0.0

2 years ago