Skip to main content

Sending a Work Order

There are two primary ways to send a work order:

  • Use AgSync IDs as partner information.
  • Use personal/client IDs as partner information.

In either case, one would need to follow the steps in the AgSync authentication document to allow the user to sign into AgSync and retrieve access token information to perform API calls listed below on their behalf.

A list of available measures used by AgSync is located at GET /api/measure. It is common practice for the system to map UOMs between what is used at the client and what is available in AgSync.

External products identifiers can be set in AgSync. These values are given and maintained in the Account Settings > Integrations > External Product list tab.

Although Crop choices can be received via the GET Crops method, most systems already have a list of crops. Also the crops within AgSync do not change often. It is suggested to contact apisupport@ravenind.com for a crop list and hardcode a mapping between the personal/client crop identifier and the AgSync crop identifier.

AgSync Order

Using IDs from AgSync, POST /api/order.

Partner Order

When submitting a partner order, IDs passed in are meant to be personal/client IDs. AgSync will search whether these IDs already exist in the Grower, Farm, or Field.

If a cross referenced ID is found, then the existing item is used, otherwise a new item will be created. Using a partner order requires a partner product list to be created.

GET Requester

This is the location of the retail facility which the grower is working with. AgSync needs to know this information. If there is not an equivalent item in the client system which is mapped to AgSync, one would need need to retrieve the list of available entries and force the user to choose a value.

  • If the partner ID location map is stored in AgSync, call GET /api/accounts/partners/{partnerAccountId} to get an account using personal/client. Otherwise, call GET /api/accounts to retrieve an available listing for the user.
  • Pass in location ID, if 404 is returned then either the user does not have access or the integration is not setup for the location specified.

GET Service Providers

Request via GET api/serviceproviders

  • From list of results returned, add selection in the personal/client system for choosing this value.
  • Upon choosing a service provider, load a selection box with the list of available operations for the user to choose from.
  • Enforce the user chooses both a service provider and an operation

Create Order

Request via POST /api/order/partner

  • Fill out IDs as personal/client IDs, using the location ID, Customer GUID, Farm GUID, Field GUID, above.
  • If the user chooses a zone, then pass it’s ID in the order.
  • Technically the supplier ID in AgSync matches the ProductLocation from the client system. If absent, this value will default to the retailer.
  • Fill out the Partner.OrderId as client work order id.

PUT Order

If one wanted to edit an order, the process would be the similar to that above however one would use the AgSync IDs instead of client IDs calling the PUT /api/order or PUT /api/order/partner endpoint.