# Import Green Lot Imports a new green lot from an external system (e.g. ERP) into Cropster by an external identifier (= ). Optionally, providing the warehouse via location is possible, by setting the property. Endpoint: POST /inventory.green.importGreenLot Security: oauth2 ## Request fields (application/json): - `data` (object) Defines the data required for the operation, including all mandatory and optional fields. - `data.name` (string, required) The name of the imported green lot Example: "Ethiopia Natural" - `data.icoNumber` (string) The ICO (= International Coffee Organization) number associated with the green lot Example: "5412" - `data.externalId` (string, required) Represents the unique identifier of the imported green lot in an external system (e.g. ERP). Example: "green-lot-9876" - `data.weight` (object, required) Represents the current weight of the object. - `data.weight.amount` (number, required) The weight amount represented as floating-point number. Example: 12.5 - `data.weight.unit` (string, required) The weight unit of the object. Enum: "KG", "LBS" - `data.price` (object) Represents a price with an amount and a currency. - `data.price.amount` (number, required) The price amount represented as floating-point number. Example: 25.5 - `data.price.currency` (string, required) The currency of the price, represented as ISO 4217 currency code. Example: "USD" - `data.location` (object) Represents the relationship between an internal object and its external identifier. - `data.location.externalId` (string) Represents the unique identifier of this object in an external system (e.g. ERP). Example: "location-1234" ## Response 200 fields (application/json): - `ok` (boolean) Indicates whether the request was successful. Example: true - `result` (object) Contains the response data of a successful request. - `result.greenLot` (object) Represents a lot of green coffee beans. - `result.greenLot.id` (string) The unique identifier of the green lot. Example: "550e8400-e29b-41d4-a716-446655440000" - `result.greenLot.name` (string) The name of the green lot. Example: "Ethiopia Natural" - `result.greenLot.icoNumber` (string) The ICO (International Coffee Organization) number associated with the green lot. Example: "5412" - `result.greenLot.externalId` (string) Represents the unique identifier of the imported green lot in an external system (e.g. ERP). Example: "green-lot-9876" - `result.greenLot.weight` (object) Represents the current weight of the object. - `result.greenLot.weight.amount` (number, required) The weight amount represented as floating-point number. Example: 12.5 - `result.greenLot.weight.unit` (string, required) The weight unit of the object. Enum: "KG", "LBS" - `result.greenLot.price` (object) Represents a price with an amount and a currency. - `result.greenLot.price.amount` (number, required) The price amount represented as floating-point number. Example: 25.5 - `result.greenLot.price.currency` (string, required) The currency of the price, represented as ISO 4217 currency code. Example: "USD" - `result.greenLot.location` (object) Represents the relationship between an internal object and its external identifier. - `result.greenLot.location.id` (string) The unique identifier of the object. Example: "550e8400-e29b-41d4-a716-446655440000" - `result.greenLot.location.externalId` (string) Represents the unique identifier of this object in an external system (e.g. ERP). Example: "location-1234" ## Response 400 fields (application/json): - `ok` (boolean) Indicates whether the request was successful or not - `error` (object) - `error.code` (string) Specifies error code that can be handled programmatically. Example: "invalid_parameter" - `error.message` (string) A detailed description of the occurred error. Example: "Invalid parameter provided" ## Response 401 fields (application/json): - `ok` (boolean) Indicates whether the request was successful or not - `error` (object) - `error.code` (string) Specifies error code that can be handled programmatically. Example: "invalid_parameter" - `error.message` (string) A detailed description of the occurred error. Example: "Invalid parameter provided" ## Response 403 fields (application/json): - `ok` (boolean) Indicates whether the request was successful or not - `error` (object) - `error.code` (string) Specifies error code that can be handled programmatically. Example: "invalid_parameter" - `error.message` (string) A detailed description of the occurred error. Example: "Invalid parameter provided" ## Response 422 fields (application/json): - `ok` (boolean) Indicates whether the request was successful or not - `error` (object) - `error.code` (string) Specifies error code that can be handled programmatically. Example: "invalid_parameter" - `error.message` (string) A detailed description of the occurred error. Example: "Invalid parameter provided" ## Response 500 fields (application/json): - `ok` (boolean) Indicates whether the request was successful or not - `error` (object) - `error.code` (string) Specifies error code that can be handled programmatically. Example: "invalid_parameter" - `error.message` (string) A detailed description of the occurred error. Example: "Invalid parameter provided"