Back to top

Scale Tickets Translator API Spec

Media Type

To ensure all response are returned as JSON, pass the following Accept header on all requests.

Accept: application/json

Authorization

The Authorization header should be sent with the token on all requests except for the initial request to retrieve a token.

When a user logs out the token can be deleted.

Authorization: Bearer <token>

Response Codes

The common HTTP Response Status Codes are used.

Common success states:

  • 200 (OK) - GET and PUT methods

  • 201 (Created) - POST methods

  • 202 (Accepted) - The request has been accepted for processing

  • 204 (No content) - DELETE methods.

Error States

When something goes wrong, the response status code can be 4xx if the error is related to the request data or 5xx if it’s a server issue.

Common error states:

  • 400 (Bad request) - The request contained invalid data

  • 401 (Unauthorized) - The user is not authenticated

  • 403 (Forbidden) - The user is authenticated, but not authorized to view the given content

  • 404 (Not found) - The request content does not exist

  • 406 (Not acceptable) - The request content does not exist

  • 415 (Unsupported media type) - The Content-Type header is not defined on POST/PUT or the request body is not JSON

  • 419 (Authentication timeout) - The user has passed a known token but it has expired

  • 422 (Unprocessable Entity) - The syntax for the call is correct but the request contains invalid data

  • 500 (Internal server error) - The server had an error that prevents the request from succeeding

Date Format

All dates returned via this API will be in ISO 8601 format.

Single Item

Single items are represented as an object inside data.

{
  "data" : {
    "id" : 1,
    "bool" : true,
    "string" : "some string"
  }
}

Collection

Collections are represented as an array of objects inside data.

{
  "data" : [
    {
      "id" : 1,
      "bool" : true,
      "string" : "some string"
    },
    {
       "id" : 2,
       "bool" : false,
       "string" : "some string"
    }
  ]
}

Metadata

Metadata can be passed along with any request to include additional information about the request or data that is not directly part of the resource object.

{
  "data" : {
    "id" : 1,
      "bool" : true,
      "string" : "some string"
  },
  "meta" : {
    "some_random_meta" : ""
  }
}

Pagination

Some collections may be paginated. When this is the case, the pagination metadata will be added to help the client fetch and display data.

{
  "data": [
    {
      "id": 1,
      "bool": true,
      "string": "some string"
    }
  ],
  "meta": {
    "pagination": {
      "total": 1,
      "count": 1,
      "per_page": 10,
      "current_page": 1,
      "total_pages": 1,
      "links": []
    }
  }
}

Includes

Some resources may contain include resources. These are relational resources attached to the requested resource. Make note of the data wrapper around the included resource. This wrapper can also contain metadata just like a top-level requests.

{
  "data" : {
    "id" : 1,
    "bool" : true,
    "string" : "some string",
    "relation" : {
      "data": {
        "id": 100,
        "name": "Peter Parker"
      }
    }
  }
}

Errors

When the server returns a 4xx error, the response body will contain the following structure:

{
  "error": {
    "code": "",
    "message": "",
    "more" : {
      "additional": "information relating to the error, depends on 'code'"
    }
  },
  "meta": {
    "some_random_meta" : ""
  }
}

Validation Errors

When the server kicks back a 422 error, that means the information passed is invalid. The following structure will be the response:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "You have validation errors in your submission",
    "validationMessages": {
      "first_name": [{
        "message": "The first name field is required."
      }],
      "last_name": [{
        "message": "The last name field is required."
      }],
      "email": [{
        "message": "The email field is required."
      },{
        "message": "The email must be a valid email address."
      },{
        "message": "The email has already been taken."
      }]
    }
  }
}

5xx errors are often thrown directly by the web server and JSON data cannot be guaranteed to contain a JSON body. For this reason, the body should not be parsed and a generic message should be shown to the user.


Meta

Resources that return information about the translator.

Meta Collection

List All Meta Data
GET/meta

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/meta
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "features": {
    "verification": {
      "version": "1.0.0",
      "authentication": {
        "auto": [
          "email",
          "phone"
        ],
        "alternate": [
          {
            "key": "username",
            "type": "string",
            "description": "Your username.",
            "display_name": "Username"
          },
          {
            "key": "password",
            "type": "string",
            "description": "Your password.",
            "display_name": "Password"
          }
        ]
      }
    },
    "company": {
      "version": "1.0.0"
    },
    "elevators": {
      "version": "1.0.0"
    },
    "contracts": {
      "version": "1.0.0"
    },
    "tickets": {
      "version": "1.0.0"
    }
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "features": {
      "type": "object",
      "properties": {
        "verification": {
          "type": "object",
          "properties": {
            "version": {
              "type": "string"
            },
            "authentication": {
              "type": "object",
              "properties": {
                "auto": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                    "minItems": 1
                },
                "alternate": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": ["key","type","description","display_name"],
                    "properties": {
                      "key": {
                        "Description": "The key the value is assigned to when it's sent back to the API.",
                        "type": "string"
                      },
                      "type": {
                        "Description": "The type of the value that is transmitted",
                        "enum": ["string","integer","number"],
                        "type": "string"
                      },
                      "description": {
                        "Description": "A text description of the field that may be presented as help text to users.",
                        "type": "string"
                      },
                      "display_name": {
                        "Description": "The name that is shown to users.",
                        "type": "string"
                      },
                    }
                  },
                  "minItems": 1
                }
              }
            }
          }
        },
        "company": {
          "type": "object",
          "properties": {
            "version": {
              "Description": "The current version of the company feature used by this translator.",
              "type": "string"
            }
          }
        },
        "elevators": {
          "type": "object",
          "properties": {
            "version": {
              "Description": "The current version of the elevators feature used by your translator.",
              "type": "string"
            }
          }
        },
        "contracts": {
          "type": "object",
          "properties": {
            "version": {
              "Description": "The current version of the contracts feature used by your translator.",
              "type": "string"
            }
          }
        },
        "tickets": {
          "type": "object",
          "properties": {
            "version": {
              "Description": "The current version of the tickets feature used by your translator.",
              "type": "string"
            }
          }
        }
      }
    }
  }
}

Verify

Resources that verify a user’s identity in the translator.

Auto-Verify Collection

Verify a user with their phone number
GET/auto-verify{?type,identifier}

Checks to see if one or more users exists with the provided identifier and returns their user IDs.

The response attributes:

  • id - The unique user ID.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/auto-verify?type=phone&identifier=8567679903
URI Parameters
HideShow
type
string (required) Example: phone

The identifier’s type either “phone” or “email”.

identifier
string (required) Example: 8567679903

The value used to identify the user. When the type is “phone” this must be a phone number. When the type is email it must be an email address.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data" : [
    {
      "id" : "1",
    },
    {
      "id" : "2",
    }
  ],
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "Description": "The unique user ID.",
            "type": "string"
          }
        },
        "required": ["id"],
        "minItems": 0
      }
    },
    "meta": {
      "required": [
        "version"
      ],
      "properties": {
        "version": {
         "Description": "The current version of the elevators feature used by your translator.",
         "type": "string"
        }
      }
    }
  },
  "required": ["data", "meta"],
}

Verify Collection

Verify a user with custom fields
PUT/verify

Checks to see if one or more users exists with the provided custom fields and returns their user IDs.

Example URI

PUT https://scale-tickets-translator-api-spec.myriadapps.com/api/verify
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "key": "username",
      "value": "Hephaestus"
    },
    {
      "key": "password",
      "value": "Hammer&Anvil!"
    }
  ],
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "Description": "The key used to identify the value.",
            "type": "string"
          },
          "value": {
            "Description": "The value associated with the key.",
            "type": "string"
          }
        },
        "required": [
          "key",
          "value"
        ]
      }
    },
    "meta": {
      "required": [
        "version"
      ],
      "properties": {
        "version": {
          "Description": "The current version of the elevators feature used by your translator.",
          "type": "string"
        }
      }
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data" : [
    {
      "id" : "1",
    },
    {
       "id" : "2",
    }
  ],
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "Description": "The unique user ID.",
            "type": "string"
          }
        },
        "required": ["id"],
        "minItems": 0
      }
    }
  },
  "meta": {
    "required": [
      "version"
    ],
    "properties": {
      "version": {
       "Description": "The current version of the verify feature used by your translator.",
       "type": "string"
      }
    }
  },
  "required": ["data", "meta"]
}

Company

Resources that return information about the company the translator returns data for.

Company Collection

List the Company Data
GET/company

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/company
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "address_line_1": "1432 1st St. S.",
    "address_line_2": "",
    "branding_image": "https://upload.wikimedia.org/wikipedia/commons/1/14/Eleusinian_hydria_Antikensammlung_Berlin_1984.46_n2.jpg",
    "city": "Athens",
    "email": "demeter@example.com",
    "fax": "9143459935",
    "name": "Demeter",
    "phone": "8567679903",
    "state": "ND",
    "website": "http://myriadmobile.com/scale-tickets/",
    "zip_code": "58490"
  },
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "meta": {
    "required": [
      "version"
    ],
    "properties": {
      "version": {
        "Description": "The current version of the company feature used by this translator.",
        "type": "string"
      }
    }
  },
  "properties": {
    "data": {
      "properties": {
        "address_line_1": {
          "Description": "The address of your company's main office.",
          "type": "string"
        },
        "address_line_2": {
          "Description": "The address of your company's main office.",
          "type": "string"
        },
        "branding_image": {
          "Description": "A URL pointing at your company's logo.",
          "type": "string"
        },
        "city": {
          "Description": "The city where your company's main office is located.",
          "type": "string"
        },
        "email": {
          "Description": "The email address farmers use to contact your company.",
          "type": "string"
        },
        "fax": {
          "Description": "The fax number farmers use to contact your company.",
          "type": "string"
        },
        "name": {
          "Description": "Your company's name.",
          "type": "string"
        },
        "phone": {
          "Description": "The phone number farmers use to contact your company.",
          "type": "string"
        },
        "state": {
          "Description": "The state where your company's main office is located.",
          "type": "string"
        },
        "website": {
          "Description": "Your company's website.",
          "type": "string"
        }
      },
      "required": [
        "address_line_1",
        "address_line_2",
        "branding_image",
        "city",
        "email",
        "fax",
        "name",
        "phone",
        "state",
        "website",
        "zip_code"
      ],
      "type": "object"
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}

Elevators

Resources that return information about the company’s elevators.

Elevator Collection

List the Elevator Data
GET/elevators{?last_returned_id}

This request returns all of the elevators from the translator. If all of the elevators can’t be returned in a single request then “has_more_records” will be set to true in the “meta” section. Subsequent requests require the “last_returned_id” in order to retrieve the next list of elevators.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/elevators?last_returned_id=454
URI Parameters
HideShow
last_returned_id
integer (optional) Example: 454

The ID to start the next page at. The value is exclusive meaning it won’t be in the list returned.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "id": "456",
      "name": "Persephone",
      "address_line_1": "1432 1st St. S.",
      "address_line_2": "",
      "city": "Athens",
      "state": "ND",
      "zip_code": "57483",
      "phone": "8567679903",
      "fax": "9143459935",
      "email": "persephone@example.com",
      "website": "http://myriadmobile.com/scale-tickets/",
      "market_data": [
        {
          "basis_price": -0.61,
          "crop_type": "corn",
          "current_bid": 3.51,
          "delivery_date": "2016-06-30",
          "format": "CYM",
          "symbol": "C6N",
          "futures_price": 412,
          "futures_change": 7.2
        },
        {
          "basis_price": -0.65,
          "crop_type": "spring_wheat",
          "current_bid": 4.7,
          "delivery_date": "2016-05-31",
          "format": "CYM",
          "symbol": "MW6N",
          "futures_price": 697,
          "futures_change": -8.2
        },
        {
          "basis_price": -0.34,
          "crop_type": "malting_barley",
          "current_bid": 3.53,
          "delivery_date": "2016-11-31",
          "format": "CYM",
          "symbol": "BGX16",
          "futures_price": 387,
          "futures_change": -3.2
        }
      ]
    },
    {
      "id": "480",
      "name": "Arion",
      "address_line_1": "3425 2nd St. S.",
      "address_line_2": "",
      "city": "Sparta",
      "state": "ND",
      "zip_code": "39857",
      "phone": "8567679903",
      "fax": "9143459935",
      "email": "sparta@example.com",
      "website": "http://myriadmobile.com/scale-tickets/",
      "market_data": [
        {
          "crop_type": "corn",
          "symbol": "C6N",
          "delivery_date": "2016-07-31",
          "current_bid": 3.23,
          "format": "CYM",
          "basis_price": -0.54,
          "futures_price": 412,
          "futures_change": 7.2
        },
        {
          "crop_type": "flax",
          "delivery_date": "2016-07-31",
          "current_bid": 4.7,
          "basis_price": 0
        },
        {
          "basis_price": -1.04,
          "crop_type": "soybeans",
          "current_bid": 9.88,
          "delivery_date": "2016-07-31",
          "format": "CYM",
          "symbol": "S6N",
          "futures_price": 1091.4,
          "futures_change": 13
        }
      ]
    }
  ],
  "meta": {
    "has_more_records": false,
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "type": "array",
      "minItems": 0,
      "items": {
        "type": "object",
        "required": [
          "address_line_1",
          "address_line_2",
          "city",
          "email",
          "fax",
          "id",
          "market_data",
          "name",
          "phone",
          "state",
          "website",
          "zip_code"
        ],
        "properties": {
          "address_line_1": {
            "Description": "The first line of the elevator's address.",
            "type": "string"
          },
          "address_line_2": {
            "Description": "The first line of the elevator's address.",
            "type": "string"
          },
          "city": {
            "Description": "The city the elevator is located in.",
            "type": "string"
          },
          "email": {
            "Description": "The email address farmers must send emails to.",
            "type": "string"
          },
          "fax": {
            "Description": "The number farmers must to send faxes to.",
            "type": "string"
          },
          "id": {
            "Description": "The unique ID of the elevator.",
            "type": "string"
          },
          "market_data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "basis_price",
                "crop_type",
                "current_bid",
                "delivery_date"
              ],
              "properties": {
                "crop_type": {
                  "Description": "One of the available crop types.",
                  "type": "string",
                  "enum": [
                    "canola",
                    "corn",
                    "feed_barley",
                    "flax",
                    "malting_barley",
                    "peas",
                    "soybeans",
                    "spring_wheat",
                    "sunflower_hi-oleic",
                    "sunflower_oil",
                    "wheat_seed",
                    "winter_wheat"
                  ]
                },
                "basis_price": {
                  "Description": "The amount in dollars the elevators spends to transport a bushel.",
                  "type": "number"
                },
                "current_bid": {
                  "Description": "The amount in dollars the elevator is currently paying for a bushel.",
                  "type": "number"
                },
                "delivery_date": {
                  "Description": "The date the crops must be delivered by to get the current bid price.",
                  "type": "string"
                },
                "format": {
                  "Description": "The format of the symbol.",
                  "type": "string",
                  "enum": [
                    "CYM",
                    "CMY"
                  ]
                },
                "futures_change": {
                  "Description": "The amount, in dollars, the futures price has changed since the last accepted futures price.",
                  "type": "number"
                },
                "futures_price": {
                  "Description": "The current futures price, in dollars, the elevator has accepted for the crop.",
                  "type": "number"
                },
                "symbol": {
                  "Description": "The stock ticker symbol for the crop and delivery date.",
                  "type": "string"
                }
              }
            }
          },
          "name": {
            "Description": "The name of the elevator",
            "type": "string"
          },
          "phone": {
            "Description": "The number farmers must call to contact the elevator.",
            "type": "string"
          },
          "state": {
            "Description": "The state the elevator is located in.",
            "type": "string"
          },
          "website": {
            "Description": "Your company's website.",
            "type": "string"
          },
          "zip_code": {
            "Description": "The elevator's zip code.",
            "type": "string"
          }
        }
      }
    },
    "meta": {
      "properties": {
        "has_more_records": {
          "Description": "When this is true you should make another request to get the rest of the records.",
          "type": "boolean"
        },
        "version": {
          "Description": "The current version of the company feature used by this translator.",
          "type": "string"
        }
      }
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}

Elevator

List the Data for an Elevator
GET/elevators/{id}

This request returns data for a single elevator from the translator. The elevator is identified by the ID passed in the URL.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/elevators/456
URI Parameters
HideShow
id
integer (required) Example: 456

The ID of the elevator to retrieve.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "id": "456",
    "name": "Persephone",
    "address_line_1": "1432 1st St. S.",
    "address_line_2": "",
    "city": "Athens",
    "state": "ND",
    "zip_code": "57483",
    "phone": "8567679903",
    "fax": "9143459935",
    "email": "persephone@example.com",
    "website": "http://myriadmobile.com/scale-tickets/",
    "market_data": [
      {
        "basis_price": -0.61,
        "crop_type": "corn",
        "current_bid": 3.51,
        "delivery_date": "2016-06-30",
        "format": "CYM",
        "symbol": "C6N",
        "futures_price": 412,
        "futures_change": 7.2
      },
      {
        "basis_price": -0.65,
        "crop_type": "spring_wheat",
        "current_bid": 4.7,
        "delivery_date": "2016-05-31",
        "format": "CYM",
        "symbol": "MW6N",
        "futures_price": 697,
        "futures_change": -8.2
      },
      {
        "basis_price": -0.34,
        "crop_type": "malting_barley",
        "current_bid": 3.53,
        "delivery_date": "2016-11-31",
        "format": "CYM",
        "symbol": "BGX16",
        "futures_price": 387,
        "futures_change": -3.2
      }
    ]
  },
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "id",
        "name",
        "address_line_1",
        "address_line_2",
        "city",
        "state",
        "zip_code",
        "phone",
        "fax",
        "email",
        "website",
        "market_data"
      ],
      "properties": {
        "id": {
          "Description": "The unique ID of the elevator.",
          "type": "string"
        },
        "name": {
          "Description": "The name of the elevator",
          "type": "string"
        },
        "address_line_1": {
          "Description": "The first line of the elevator's address.",
          "type": "string"
        },
        "address_line_2": {
          "Description": "The first line of the elevator's address.",
          "type": "string"
        },
        "city": {
          "Description": "The city the elevator is located in.",
          "type": "string"
        },
        "state": {
          "Description": "The state the elevator is located in.",
          "type": "string"
        },
        "zip_code": {
          "Description": "The elevator's zip code.",
          "type": "string"
        },
        "phone": {
          "Description": "The number farmers must call to contact the elevator.",
          "type": "string"
        },
        "fax": {
          "Description": "The number farmers must to send faxes to.",
          "type": "string"
        },
        "email": {
          "Description": "The email address farmers must send emails to.",
          "type": "string"
        },
        "website": {
          "Description": "Your company's website.",
          "type": "string"
        },
        "market_data": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "basis_price",
              "crop_type",
              "current_bid",
              "delivery_date"
            ],
            "properties": {
              "crop_type": {
                "Description": "One of the available crop types.",
                "type": "string",
                "enum": [
                  "canola",
                  "corn",
                  "feed_barley",
                  "flax",
                  "malting_barley",
                  "peas",
                  "soybeans",
                  "spring_wheat",
                  "sunflower_hi-oleic",
                  "sunflower_oil",
                  "wheat_seed",
                  "winter_wheat"
                ]
              },
              "basis_price": {
                "Description": "The amount in dollars the elevators spends to transport a bushel.",
                "type": "number"
              },
              "current_bid": {
                "Description": "The amount in dollars the elevator is currently paying for a bushel.",
                "type": "number"
              },
              "delivery_date": {
                "Description": "The date the crops must be delivered by to get the current bid price.",
                "type": "string"
              },
              "format": {
                "Description": "The format of the symbol.",
                "type": "string",
                "enum": [
                  "CYM",
                  "CMY"
                ]
              },
              "futures_change": {
                "Description": "The amount, in dollars, the futures price has changed since the last accepted futures price.",
                "type": "number"
              },
              "futures_price": {
                "Description": "The current futures price, in dollars, the elevator has accepted for the crop.",
                "type": "number"
              },
              "symbol": {
                "Description": "The stock ticker symbol for the crop and delivery date.",
                "type": "string"
              }
            }
          }
        },
        "meta": {
          "required": [
            "version"
          ],
          "properties": {
            "version": {
              "Description": "The current version of the elevators feature used by your translator.",
              "type": "string"
            }
          }
        }
      }
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}

Contracts

Resources that return information about the company’s contracts.

Contracts Collection

List All Contracts
GET/contracts{?user_id,last_returned_id,updated_at}

Retrieves a collection of contracts.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/contracts?user_id=1004&last_returned_id=3&updated_at=2016-07-10T04:10:23+0000
URI Parameters
HideShow
user_id
integer (required) Example: 1004

The user ID of the party who signed the contract.

last_returned_id
integer (optional) Example: 3

The ID to start the next page at. The value is exclusive meaning it won’t be in the list returned.

updated_at
string (optional) Example: 2016-07-10T04:10:23+0000

The value to start the page at. Values are returned in ascending order. This value is inclusive. This means that if your request has a value of “2016-07-10T04:10:23+0000” contracts updated at that time and after will be returned.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "basis_cost": -0.25,
      "basis_cost_locked": false,
      "bid": 2.182,
      "completed": false,
      "created_at": "2015-07-10T21:13:12+0000",
      "crop_type": "spring_wheat",
      "delivery_period_end": "2015-08-31T00:00:00Z",
      "delivery_period_start": "2015-08-01T00:00:00Z",
      "elevator_id": "345",
      "futures_price": 243.2,
      "futures_price_locked": false,
      "id": "4",
      "is_price_later_contract": false,
      "quantity_submitted": 500.45,
      "quantity_measure": "amount",
      "quantity_contracted": 10000,
      "updated_at": "2015-07-10T21:13:12+0000",
      "user_id": "1004"
    },
    {
      "basis_cost": -0.25,
      "basis_cost_locked": true,
      "bid": 2.182,
      "completed": false,
      "created_at": "2015-07-11T21:13:12+0000",
      "crop_type": "spring_wheat",
      "delivery_period_end": "2015-08-31T00:00:00Z",
      "delivery_period_start": "2015-08-01T00:00:00Z",
      "elevator_id": "156",
      "futures_price": 243.2,
      "futures_price_locked": true,
      "id": "5",
      "is_price_later_contract": false,
      "quantity_submitted": 500.45,
      "quantity_measure": "amount",
      "quantity_contracted": 10000,
      "updated_at": "2015-07-15T21:13:12+0000",
      "user_id": "1004"
    }
  ],
  "meta": {
    "has_more_records": false,
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "items": {
        "properties": {
          "addendum": {
            "Description": "A string of JSON data that is used to passed additional data about the contract that is not currently supported by the API directly.",
            "type": "string"
          },
          "basis_cost": {
            "Description": "The cost, in dollars, to store the agreed to crop at the time the contract was signed.",
            "type": "number"
          },
          "basis_cost_locked": {
            "Description": "Whether or not the basis cost has been locked.",
            "type": "boolean"
          },
          "bid": {
            "Description": "The bid price, in dollars, the contract is paying for a bushel of the agreed to crop.",
            "type": "number"
          },
          "completed": {
            "Description": "Whether or not the contract has been fulfilled.",
            "type": "boolean"
          },
          "created_at": {
            "Description": "The date/time(ISO8601) the scale ticket was created at.",
            "type": "string"
          },
          "crop_type": {
            "Description": "The type of the crop.",
            "type": "string",
            "enum": [
              "canola",
              "corn",
              "durum_wheat",
              "feed_barley",
              "flax",
              "green_peas",
              "malting_barley",
              "oats",
              "peas",
              "soybeans",
              "spring_wheat",
              "sunflower_bird_food",
              "sunflower_oil",
              "sunflower_oil_higho",
              "sunflowers",
              "wheat_seed",
              "winter_wheat",
              "yellow_peas"
            ]
          },
          "delivery_period_end": {
            "Description": "The end of the delivery period.",
            "type": "string"
          },
          "delivery_period_start": {
            "Description": "The start of the delivery period.",
            "type": "string"
          },
          "elevator_id": {
            "Description": "The ID of the elevator where the crop is stored.",
            "type": "string"
          },
          "futures_price": {
            "Description": "The futures price, in cents, for a bushel of the agreed to crop at the time the contract was signed.",
            "type": "number"
          },
          "futures_price_locked": {
            "Description": "Whether or not the futures price has been locked.",
            "type": "boolean"
          },
          "id": {
            "Description": "The unique ID of the contract.",
            "type": "string"
          },
          "is_price_later_contract": {
            "Description": "Whether or not the contract is going to be priced later. Generally this happens when farmers wants to store their crops until the futures price gets higher.",
            "type": "boolean"
          },
          "quantity_contracted": {
            "Description": "The total amount of the agreed to crop that is expected to be delivered in order to satisfy the contract.",
            "type": "number"
          },
          "quantity_measure": {
            "Description": "Whether or not the quantity is weight or an amount such as bushels.",
            "enum": [
              "amount",
              "weight"
            ],
            "type": "string"
          },
          "quantity_submitted": {
            "Description": "The quantity of the agreed to crop submitted so far.",
            "type": "number"
          },
          "updated_at": {
            "Description": "The date/time(ISO8601) the scale ticket was updated at.",
            "type": "string"
          },
          "user_id": {
            "Description": "The user ID of the party who signed the contract.",
            "type": "string"
          }
        },
        "required": [
          "basis_cost",
          "basis_cost_locked",
          "bid",
          "completed",
          "created_at",
          "crop_type",
          "delivery_period_end",
          "delivery_period_start",
          "elevator_id",
          "futures_price",
          "futures_price_locked",
          "id",
          "is_price_later_contract",
          "quantity_contracted",
          "quantity_measure",
          "quantity_submitted",
          "updated_at",
          "user_id"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "meta": {
      "properties": {
        "cursor": {
          "Description": "The attributes of the object are the parameters that need to be used to retrieve the next set of records when 'has_more_records' is true.",
          "type": "object"
        },
        "has_more_records": {
          "Description": "Whether or not the more requests need to be made to retrieve the rest of the records.",
          "type": "boolean"
        },
        "version": {
          "Description": "The current version of the contracts feature used by your translator.",
          "type": "string"
        }
      },
      "required": [
        "has_more_records",
        "version"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ]
}

Contract

List the Data for a Contract
GET/contracts/{id}

Retrieves the data for a contract.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/contracts/4
URI Parameters
HideShow
id
integer (required) Example: 4

The ID of the contract to retrieve.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "basis_cost": -0.25,
    "basis_cost_locked": false,
    "bid": 2.182,
    "completed": false,
    "created_at": "2015-07-10T21:13:12+0000",
    "crop_type": "spring_wheat",
    "delivery_period_end": "2015-08-31T00:00:00Z",
    "delivery_period_start": "2015-08-01T00:00:00Z",
    "elevator_id": "345",
    "futures_price": 243.2,
    "futures_price_locked": false,
    "id": "4",
    "is_price_later_contract": false,
    "quantity_submitted": 500.45,
    "quantity_measure": "amount",
    "quantity_contracted": 10000,
    "updated_at": "2015-07-10T21:13:12+0000",
    "user_id": "1004"
  },
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "properties": {
        "addendum": {
          "Description": "A string of JSON data that is used to passed additional data about the contract that is not currently supported by the API directly.",
          "type": "string"
        },
        "basis_cost": {
          "Description": "The cost, in dollars, to store the agreed to crop at the time the contract was signed.",
          "type": "number"
        },
        "basis_cost_locked": {
          "Description": "Whether or not the basis cost has been locked.",
          "type": "boolean"
        },
        "bid": {
          "Description": "The bid price, in dollars, the contract is paying for a bushel of the agreed to crop.",
          "type": "number"
        },
        "completed": {
          "Description": "Whether or not the contract has been fulfilled.",
          "type": "boolean"
        },
        "created_at": {
          "Description": "The date/time(ISO8601) the scale ticket was created at.",
          "type": "string"
        },
        "crop_type": {
          "Description": "The type of the crop.",
          "type": "string",
          "enum": [
            "canola",
            "corn",
            "durum_wheat",
            "feed_barley",
            "flax",
            "green_peas",
            "malting_barley",
            "oats",
            "peas",
            "soybeans",
            "spring_wheat",
            "sunflower_bird_food",
            "sunflower_oil",
            "sunflower_oil_higho",
            "sunflowers",
            "wheat_seed",
            "winter_wheat",
            "yellow_peas"
          ]
        },
        "delivery_period_end": {
          "Description": "The end of the delivery period.",
          "type": "string"
        },
        "delivery_period_start": {
          "Description": "The start of the delivery period.",
          "type": "string"
        },
        "elevator_id": {
          "Description": "The ID of the elevator where the crop is stored.",
          "type": "string"
        },
        "futures_price": {
          "Description": "The futures price, in cents, for a bushel of the agreed to crop at the time the contract was signed.",
          "type": "number"
        },
        "futures_price_locked": {
          "Description": "Whether or not the futures price has been locked.",
          "type": "boolean"
        },
        "id": {
          "Description": "The unique ID of the contract.",
          "type": "string"
        },
        "is_price_later_contract": {
          "Description": "Whether or not the contract is going to be priced later. Generally this happens when farmers wants to store their crops until the futures price gets higher.",
          "type": "boolean"
        },
        "quantity_contracted": {
          "Description": "The total amount of the agreed to crop that is expected to be delivered in order to satisfy the contract.",
          "type": "number"
        },
        "quantity_measure": {
          "Description": "Whether or not the quantity is weight or an amount such as bushels.",
          "enum": [
            "amount",
            "weight"
          ],
          "type": "string"
        },
        "quantity_submitted": {
          "Description": "The quantity of the agreed to crop submitted so far.",
          "type": "number"
        },
        "update_at": {
          "Description": "The date/time(ISO8601) the scale ticket was updated at.",
          "type": "string"
        },
        "user_id": {
          "Description": "The user ID of the party who signed the contract.",
          "type": "string"
        }
      },
      "required": [
        "basis_cost",
        "basis_cost_locked",
        "bid",
        "completed",
        "created_at",
        "crop_type",
        "delivery_period_end",
        "delivery_period_start",
        "elevator_id",
        "futures_price",
        "futures_price_locked",
        "id",
        "is_price_later_contract",
        "quantity_contracted",
        "quantity_measure",
        "quantity_submitted",
        "updated_at",
        "user_id"
      ],
      "type": "object"
    },
    "meta": {
      "properties": {
        "version": {
          "Description": "The current version of the contracts feature used by your translator.",
          "type": "string"
        }
      },
      "required": [
        "version"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ]
}

Scale Tickets

Resources that return information about the translator’s scale tickets.

Scale Tickets Collection

List the Scale Tickets
GET/scaleTickets{?user_id,last_returned_id,updated_at}

Retrieves a collection of scale tickets.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/scaleTickets?user_id=4545&last_returned_id=8570&updated_at=2016-07-10T04:10:23+0000
URI Parameters
HideShow
user_id
string (required) Example: 4545

The ID of the user to request scale tickets for.

last_returned_id
string (optional) Example: 8570

The ID to start the page at. Values are returned in ascending order. The value is exclusive meaning it won’t be in the list returned.

updated_at
string (optional) Example: 2016-07-10T04:10:23+0000

The value to start the page at. Values are returned in ascending order. This value is inclusive. This means that if your request has a value of “2016-07-10T04:10:23+0000” scale tickets updated at that time and after will be returned.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "contract_id": "234",
      "created_at": "2016-07-10T21:13:12+0000",
      "crop_type": "malting_barley",
      "dock_amount": 8.31,
      "grader": "Josh Mendelssohn",
      "gross_amount": 1187.08,
      "gross_weight": 81780,
      "id": "5000550",
      "net_amount": 1178.77,
      "net_weight": 56980,
      "remarks": {
        "moisture": 12.7,
        "protein": 11.1,
        "sb": 6,
        "tw": 50
      },
      "sample_number": "FA4245421",
      "shrink_amount": 0,
      "splits": [
        {
          "user_id": "4545",
          "name": "Olson Farms LLC.",
          "percentage": 0.5
        },
        {
          "user_id": "4334",
          "name": "Dawn Martin",
          "percentage": 0.5
        }
      ],
      "tare_weight": 24780,
      "truck_driver": "Jensen",
      "truck_license": "PAK1769",
      "truck_name": "Red Triaxle",
      "updated_at": "2016-07-10T21:13:12+0000",
      "user_id": "4545",
      "weigh_in": "2016-07-10T04:13:12+0000",
      "weigh_master": "Frank Henderson",
      "weigh_out": "2016-07-10T05:01:12+0000"
    },
    {
      "contract_id": "235",
      "created_at": "2016-07-10T21:13:12+0000",
      "crop_type": "soybeans",
      "dock_amount": 4.42,
      "grader": "Josh Mendelssohn",
      "gross_amount": 863,
      "gross_weight": 79200,
      "id": "1206182",
      "net_amount": 878.58,
      "net_weight": 52980,
      "remarks": {
        "moisture": 11.5,
        "protein": 11.1,
        "sb": 6,
        "tw": 57.4
      },
      "sample_number": "FA4245421",
      "shrink_amount": 0,
      "splits": [
        {
          "user_id": "4545",
          "name": "Olson Farms LLC.",
          "percentage": 0.5
        },
        {
          "user_id": "4334",
          "name": "Dawn Martin",
          "percentage": 0.5
        }
      ],
      "tare_weight": 26220,
      "truck_driver": "Jensen",
      "truck_license": "TU11594",
      "truck_name": "Red Triaxle",
      "updated_at": "2016-07-15T21:13:12+0000",
      "user_id": "4545",
      "weigh_in": "2016-07-09T03:03:12+0000",
      "weigh_master": "Frank Henderson",
      "weigh_out": "2016-07-09T03:22:12+0000"
    }
  ],
  "meta": {
    "has_more_records": false,
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "items": {
        "minItems": 0,
        "properties": {
          "addendum": {
            "Description": "A string of JSON data that is used to passed additional data about the contract that is not currently supported by the API directly.",
            "type": "string"
          },
          "contract_id": {
            "Description": "The ID of this scale ticket's contract",
            "type": "string"
          },
          "created_at": {
            "Description": "The date/time(ISO8601) the scale ticket was created at.",
            "type": "string"
          },
          "crop_type": {
            "Description": "One of the available crop types.",
            "type": "string",
            "enum": [
              "canola",
              "corn",
              "durum_wheat",
              "feed_barley",
              "flax",
              "green_peas",
              "malting_barley",
              "oats",
              "peas",
              "soybeans",
              "spring_wheat",
              "sunflower_bird_food",
              "sunflower_oil",
              "sunflower_oil_higho",
              "sunflowers",
              "wheat_seed",
              "winter_wheat",
              "yellow_peas"
            ]
          },
          "dock_amount": {
            "Description": "The amount docked from the gross.",
            "type": "number"
          },
          "grader": {
            "Description": "The grader's name.",
            "type": "string"
          },
          "gross_amount": {
            "Description": "The total amount delivered.",
            "type": "number"
          },
          "gross_weight": {
            "Description": "The weight of the goods and the truck in pounds.",
            "type": "number"
          },
          "id": {
            "Description": "The unique ID of the scale ticket.",
            "type": "string"
          },
          "moisture": {
            "Description": "The amount of moisture in the sample.",
            "type": "number"
          },
          "net_amount": {
            "Description": "The amount after compensating for shrink and other factors.",
            "type": "number"
          },
          "net_weight": {
            "Description": "The weight of the goods.",
            "type": "number"
          },
          "remarks": {
            "properties": {
              "bugs": {
                "Description": "The amout of bugs in the sample.",
                "type": "number"
              },
              "cc": {
                "Description": "The amount of cracked corn in the sample.",
                "type": "number"
              },
              "damage": {
                "Description": "The total amount of damaged product in the sample.",
                "type": "number"
              },
              "dockage": {
                "Description": "Dockage or non-wheat materials and under developed kernels in the sample.",
                "type": "number"
              },
              "dkt": {
                "Description": "The total damaged kernels in the sample.",
                "type": "number"
              },
              "fm": {
                "Description": "Broken and foreign material in the sample.",
                "type": "number"
              },
              "fn": {
                "Description": "Falling number value.",
                "type": "number"
              },
              "grade": {
                "Description": "The grade of the sample.",
                "type": "number"
              },
              "htdmg": {
                "Description": "The amount of heat damaged product in the sample.",
                "type": "number"
              },
              "moisture": {
                "Description": "The moisture content of the sample.",
                "type": "number"
              },
              "musty": {
                "Description": "A measure of the mustiness of the sample.",
                "type": "number"
              },
              "sour": {
                "Description": "A measure of the sourness of the sample.",
                "type": "number"
              },
              "splits": {
                "Description": "The number of split kernels or seeds in the sample.",
                "type": "number"
              },
              "defects": {
                "Description": "The total number of defects in the sample.",
                "type": "number"
              },
              "tw": {
                "Description": "The test weight or volumetric weight.",
                "type": "number"
              }
            }
          },
          "sample_number": {
            "Description": "The sample's number or code.",
            "type": "string"
          },
          "shrink_amount": {
            "Description": "The amount expected to be lost when the grain shrinks.",
            "type": "number"
          },
          "splits": {
            "Description": "The percentages owned by each grower on the ticket.",
            "items": {
              "minItems": 0,
              "properties": {
                "name": {
                  "Description": "The name of the user who owns a portion of the ticket.",
                  "type": "string"
                },
                "percentage": {
                  "Description": "The percentage of the ticket owned by the user.",
                  "type": "number"
                },
                "user_id": {
                  "Description": "The unique identifier of the user who owns a portion of the ticket.",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "percentage",
                "user_id"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "tare_weight": {
            "Description": "The weight of the truck.",
            "type": "number"
          },
          "truck_driver": {
            "Description": "The driver's name.",
            "type": "string"
          },
          "truck_license": {
            "Description": "The license number of the driver that made the drop off.",
            "type": "string"
          },
          "truck_name": {
            "Description": "The truck's code.",
            "type": "string"
          },
          "update_at": {
            "Description": "The date/time(ISO8601) the scale ticket was updated at.",
            "type": "string"
          },
          "user_id": {
            "Description": "The unique identifer of the use who owns the ticket.",
            "type": "string"
          },
          "weigh_in": {
            "Description": "The timestamp of when the truck was weighed in.",
            "type": "string"
          },
          "weigh_master": {
            "Description": "The weigh master's name.",
            "type": "string"
          },
          "weigh_out": {
            "Description": "The timestamp of when the truck was weighed out.",
            "type": "string"
          }
        },
        "required": [
          "contract_id",
          "created_at",
          "crop_type",
          "dock_amount",
          "grader",
          "gross_amount",
          "gross_weight",
          "id",
          "net_amount",
          "net_weight",
          "remarks",
          "sample_number",
          "shrink_amount",
          "splits",
          "tare_weight",
          "truck_driver",
          "truck_license",
          "truck_name",
          "user_id",
          "updated_at",
          "weigh_in",
          "weigh_master",
          "weigh_out"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "meta": {
      "properties": {
        "cursor": {
          "Description": "The attributes of the object are the parameters that need to be used to retrieve the next set of records when 'has_more_records' is true.",
          "type": "object"
        },
        "has_more_records": {
          "Description": "Whether or not the more requests need to be made to retrieve the rest of the records.",
          "type": "boolean"
        },
        "version": {
          "Description": "The current version of the scale tickets feature used by your translator.",
          "type": "string"
        }
      },
      "required": [
        "has_more_records",
        "version"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}

Scale Ticket

Returns a Scale Ticket
GET/scaleTickets/{id}

Retrieves the scale ticket requested from the translator.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/scaleTickets/5000550
URI Parameters
HideShow
id
string (required) Example: 5000550

The ID of the scale ticket to request.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": {
    "contract_id": "235",
    "created_at": "2016-07-10T21:13:12+0000",
    "crop_type": "malting_barley",
    "dock_amount": 8.31,
    "grader": "Josh Mendelssohn",
    "gross_amount": 1187.08,
    "gross_weight": 81780,
    "id": "5000550",
    "net_amount": 1178.77,
    "net_weight": 56980,
    "remarks": {
      "moisture": 11.5,
      "protein": 11.1,
      "sb": 6,
      "tw": 57.4
    },
    "sample_number": "FA4245421",
    "shrink_amount": 0,
    "splits": [
      {
        "user_id": "4545",
        "name": "Olson Farms LLC.",
        "percentage": 0.5
      },
      {
        "user_id": "4334",
        "name": "Dawn Martin",
        "percentage": 0.5
      }
    ],
    "tare_weight": 24780,
    "truck_driver": "Jensen",
    "truck_license": "PAK1769",
    "truck_name": "Red Triaxle",
    "updated_at": "2016-07-10T21:13:12+0000",
    "weigh_in": "2016-07-10T04:13:12+0000",
    "weigh_master": "Frank Henderson",
    "weigh_out": "2016-07-10T05:01:12+0000"
  },
  "meta": {
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "properties": {
        "addendum": {
          "Description": "A string of JSON data that is used to passed additional data about the contract that is not currently supported by the API directly.",
          "type": "string"
        },
        "contract_id": {
          "Description": "The ID of this scale ticket's contract",
          "type": "string"
        },
        "created_at": {
          "Description": "The date/time(ISO8601) the scale ticket was created at.",
          "type": "string"
        },
        "crop_type": {
          "Description": "One of the available crop types.",
          "type": "string",
          "enum": [
            "canola",
            "corn",
            "durum_wheat",
            "feed_barley",
            "flax",
            "green_peas",
            "malting_barley",
            "oats",
            "peas",
            "soybeans",
            "spring_wheat",
            "sunflower_bird_food",
            "sunflower_oil",
            "sunflower_oil_higho",
            "sunflowers",
            "wheat_seed",
            "winter_wheat",
            "yellow_peas"
          ]
        },
        "dock_amount": {
          "Description": "The amount docked from the gross.",
          "type": "number"
        },
        "grader": {
          "Description": "The grader's name.",
          "type": "string"
        },
        "gross_amount": {
          "Description": "The total amount delivered.",
          "type": "number"
        },
        "gross_weight": {
          "Description": "The weight of the goods and the truck in pounds.",
          "type": "number"
        },
        "id": {
          "Description": "The unique ID of the scale ticket.",
          "type": "string"
        },
        "moisture": {
          "Description": "The amount of moisture in the sample.",
          "type": "number"
        },
        "net_amount": {
          "Description": "The amount after compensating for shrink and other factors.",
          "type": "number"
        },
        "net_weight": {
          "Description": "The weight of the goods.",
          "type": "number"
        },
        "remarks": {
          "properties": {
            "bugs": {
              "Description": "The amout of bugs in the sample.",
              "type": "number"
            },
            "cc": {
              "Description": "The amount of cracked corn in the sample.",
              "type": "number"
            },
            "damage": {
              "Description": "The total amount of damaged product in the sample.",
              "type": "number"
            },
            "dockage": {
              "Description": "Dockage or non-wheat materials and under developed kernels in the sample.",
              "type": "number"
            },
            "dkt": {
              "Description": "The total damaged kernels in the sample.",
              "type": "number"
            },
            "fm": {
              "Description": "Broken and foreign material in the sample.",
              "type": "number"
            },
            "fn": {
              "Description": "Falling number value.",
              "type": "number"
            },
            "grade": {
              "Description": "The grade of the sample.",
              "type": "number"
            },
            "htdmg": {
              "Description": "The amount of heat damaged product in the sample.",
              "type": "number"
            },
            "moisture": {
              "Description": "The moisture content of the sample.",
              "type": "number"
            },
            "musty": {
              "Description": "A measure of the mustiness of the sample.",
              "type": "number"
            },
            "sour": {
              "Description": "A measure of the sourness of the sample.",
              "type": "number"
            },
            "splits": {
              "Description": "The number of split kernels or seeds in the sample.",
              "type": "number"
            },
            "defects": {
              "Description": "The total number of defects in the sample.",
              "type": "number"
            },
            "tw": {
              "Description": "The test weight or volumetric weight.",
              "type": "number"
            }
          }
        },
        "sample_number": {
          "Description": "The sample's number or code.",
          "type": "string"
        },
        "shrink_amount": {
          "Description": "The amount expected to be lost when the grain shrinks.",
          "type": "number"
        },
        "splits": {
          "Description": "The percentages owned by each grower on the ticket.",
          "items": {
            "minItems": 0,
            "properties": {
              "name": {
                "Description": "The name of the user who owns a portion of the ticket.",
                "type": "string"
              },
              "percentage": {
                "Description": "The percentage of the ticket owned by the user.",
                "type": "number"
              },
              "user_id": {
                "Description": "The unique identifier of the user who owns a portion of the ticket.",
                "type": "string"
              }
            },
            "required": [
              "name",
              "percentage",
              "user_id"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "tare_weight": {
          "Description": "The weight of the truck.",
          "type": "number"
        },
        "truck_driver": {
          "Description": "The driver's name.",
          "type": "string"
        },
        "truck_license": {
          "Description": "The license number of the driver that made the drop off.",
          "type": "string"
        },
        "truck_name": {
          "Description": "The truck's code.",
          "type": "string"
        },
        "update_at": {
          "Description": "The date/time(ISO8601) the scale ticket was updated at.",
          "type": "string"
        },
        "weigh_in": {
          "Description": "The timestamp of when the truck was weighed in.",
          "type": "string"
        },
        "weigh_master": {
          "Description": "The weigh master's name.",
          "type": "string"
        },
        "weigh_out": {
          "Description": "The timestamp of when the truck was weighed out.",
          "type": "string"
        }
      },
      "required": [
        "contract_id",
        "created_at",
        "crop_type",
        "dock_amount",
        "grader",
        "gross_amount",
        "gross_weight",
        "id",
        "net_amount",
        "net_weight",
        "remarks",
        "sample_number",
        "shrink_amount",
        "splits",
        "tare_weight",
        "truck_driver",
        "truck_license",
        "truck_name",
        "updated_at",
        "weigh_in",
        "weigh_master",
        "weigh_out"
      ],
      "type": "object"
    },
    "meta": {
      "properties": {
        "version": {
          "Description": "The current version of the elevators feature used by your translator.",
          "type": "string"
        }
      },
      "required": [
        "version"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ],
  "type": "object"
}

Prepays

Resources that return information about the company’s contracts.

Prepays Collection

List All Prepays
GET/prepays{?last_returned_id,updated_at}

Retrieves a collection of contracts.

Example URI

GET https://scale-tickets-translator-api-spec.myriadapps.com/api/prepays?last_returned_id=3&updated_at=2016-07-10T04:10:23+0000
URI Parameters
HideShow
last_returned_id
integer (optional) Example: 3

The ID to start the next page at. The value is exclusive meaning it won’t be in the list returned.

updated_at
string (optional) Example: 2016-07-10T04:10:23+0000

The value to start the page at. Values are returned in ascending order. This value is inclusive. This means that if your request has a value of “2016-07-10T04:10:23+0000” contracts updated at that time and after will be returned.

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "data": [
    {
      "available_balance": 3255.2,
      "total_balance": 3255.2,
      "percent_remaining": 100,
      "available_quantity": 12520,
      "total_quantity": 12520,
      "quantity_measure": "lbs",
      "unit_price": 0.26,
      "unit_price_measure": "lbs",
      "item_name": "12-40-SZ",
      "item_id": "1240SZ",
      "id": "2271",
      "prepay_id": "PAG0000816",
      "user_id": "SJOHMAR",
      "created_at": "2016-02-18T18:29:40+00:00",
      "updated_at": "2016-02-18T18:29:40+00:00"
    },
    {
      "available_balance": 865.95,
      "total_balance": 865.95,
      "percent_remaining": 100,
      "available_quantity": 5020,
      "total_quantity": 5020,
      "quantity_measure": "lbs",
      "unit_price": 0.1725,
      "unit_price_measure": "lbs",
      "item_name": "4600",
      "item_id": "4600",
      "id": "2272",
      "prepay_id": "PAG0000816",
      "user_id": "SJOHMAR",
      "created_at": "2016-02-18T18:30:17+00:00",
      "updated_at": "2016-02-18T18:30:17+00:00"
    },
    {
      "available_balance": 0,
      "total_balance": 6720,
      "percent_remaining": 0,
      "available_quantity": 0,
      "total_quantity": 56470.5883,
      "quantity_measure": "lbs",
      "unit_price": 0.119,
      "unit_price_measure": "lbs",
      "item_name": "ACCELRON F",
      "item_id": "CUSTOM/SEED TREAT SOY",
      "id": "1889",
      "prepay_id": "BAL0002402",
      "user_id": "1004",
      "created_at": "2015-12-29T22:25:11+00:00",
      "updated_at": "2016-03-09T17:49:10+00:00"
    }
  ],
  "meta": {
    "has_more_records": false,
    "version": "1.0.0"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "properties": {
    "data": {
      "items": {
        "properties": {
          "available_balance": {
            "Description": "",
            "type": "number"
          },
          "total_balance": {
            "Description": "",
            "type": "string"
          },
          "percent_remaining": {
            "Description": "",
            "type": "number"
          },
          "available_quantity": {
            "Description": "",
            "type": "number"
          },
          "total_quantity": {
            "Description": "",
            "type": "number"
          },
          "quantity_measure": {
            "Description": "",
            "type": "string"
          },
          "unit_price": {
            "Description": "",
            "type": "number"
          },
          "unit_price_measure": {
            "Description": "",
            "type": "string"
          },
          "item_name": {
            "Description": "",
            "type": "string"
          },
          "item_id": {
            "Description": "",
            "type": "string"
          },
          "id": {
            "Description": "",
            "type": "string"
          },
          "prepay_id": {
            "Description": "",
            "type": "string"
          },
          "user_id": {
            "Description": "",
            "type": "string"
          },
          "created_at": {
            "Description": "The date/time(ISO8601) the pre-pay was created at.",
            "type": "string"
          },
          "updated_at": {
            "Description": "The date/time(ISO8601) the pre-pay was updated at.",
            "type": "string"
          }
        },
        "required": [
          "available_balance",
          "total_balance",
          "percent_remaining",
          "available_quantity",
          "total_quantity",
          "quantity_measure",
          "unit_price",
          "unit_price_measure",
          "item_name",
          "item_id",
          "id",
          "prepay_id",
          "user_id",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "meta": {
      "properties": {
        "cursor": {
          "Description": "The attributes of the object are the parameters that need to be used to retrieve the next set of records when 'has_more_records' is true.",
          "type": "object"
        },
        "has_more_records": {
          "Description": "Whether or not the more requests need to be made to retrieve the rest of the records.",
          "type": "boolean"
        },
        "version": {
          "Description": "The current version of the contracts feature used by your translator.",
          "type": "string"
        }
      },
      "required": [
        "has_more_records",
        "version"
      ]
    }
  },
  "required": [
    "data",
    "meta"
  ]
}

Generated by aglio on 01 Jun 2017