Send Slimstock forecast
const url = 'https://api.tradecloud1.com/v2/api-connector/forecast/slimstock';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"header":{"companyId":"00f03b98-2511-489f-9695-13791b3f66b6","supplierAccountNumber":"12345","forecastNumber":"F123456789"},"lines":[{"buyerItemNumber":"12345","buyerItemRevision":"v2","buyerItemName":"Round tube ø60x45","supplierItemNumber":"67890","purchaseUnitOfMeasureIso":"PCE","startDate":"2023-04-07","M0":1234.56,"M1":1234.56,"M2":1234.56,"M3":1234.56,"M4":1234.56,"M5":1234.56,"M6":1234.56,"M7":1234.56,"M8":1234.56,"M9":1234.56,"M10":1234.56,"M11":1234.56,"M12":1234.56,"M13":1234.56,"M14":1234.56,"M15":1234.56,"M16":1234.56,"M17":1234.56,"M18":1234.56,"M19":1234.56,"M20":1234.56,"M21":1234.56,"M22":1234.56,"M23":1234.56,"M24":1234.56,"M25":1234.56,"M26":1234.56,"M27":1234.56,"M28":1234.56,"M29":1234.56,"M30":1234.56,"M31":1234.56,"M32":1234.56,"M33":1234.56,"M34":1234.56,"M35":1234.56}],"issueDateTime":"2022-12-31T10:11:12"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tradecloud1.com/v2/api-connector/forecast/slimstock \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "header": { "companyId": "00f03b98-2511-489f-9695-13791b3f66b6", "supplierAccountNumber": "12345", "forecastNumber": "F123456789" }, "lines": [ { "buyerItemNumber": "12345", "buyerItemRevision": "v2", "buyerItemName": "Round tube ø60x45", "supplierItemNumber": "67890", "purchaseUnitOfMeasureIso": "PCE", "startDate": "2023-04-07", "M0": 1234.56, "M1": 1234.56, "M2": 1234.56, "M3": 1234.56, "M4": 1234.56, "M5": 1234.56, "M6": 1234.56, "M7": 1234.56, "M8": 1234.56, "M9": 1234.56, "M10": 1234.56, "M11": 1234.56, "M12": 1234.56, "M13": 1234.56, "M14": 1234.56, "M15": 1234.56, "M16": 1234.56, "M17": 1234.56, "M18": 1234.56, "M19": 1234.56, "M20": 1234.56, "M21": 1234.56, "M22": 1234.56, "M23": 1234.56, "M24": 1234.56, "M25": 1234.56, "M26": 1234.56, "M27": 1234.56, "M28": 1234.56, "M29": 1234.56, "M30": 1234.56, "M31": 1234.56, "M32": 1234.56, "M33": 1234.56, "M34": 1234.56, "M35": 1234.56 } ], "issueDateTime": "2022-12-31T10:11:12" }'Send a new Slimstock forecast for one supplier. Requires buyer and integration roles.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send Slimstock forecast by buyer
object
The header of the forecast, which is targeted at only one supplier.
object
The optional Tradecloud company ID of the buyer. Only needed when the integration user is authorized for multiple companies.
Example
00f03b98-2511-489f-9695-13791b3f66b6The mandatory supplier account code or number as known in Slimstock and your ERP system, and added to the supplier connection in the Tradecloud portal.
Example
12345The mandatory forecast identifier in Slimstock. The number must be the same for each supplier forecast from the same generated forecast.
Example
F123456789The lines of the Slimstock forecast. Each line contains the forecasts of one item.
A forecast line contains a Slimstock item, the date determining the current month and forecasted quantities up to 36 months.
object
The item code or number as known in Slimstock and your ERP system. An item number should be unique and immutable.
Example
12345The revision (or version) of this item.
Example
v2The short name of this item.
Example
Round tube ø60x45The item code or number as known by your supplier. Advised in case of wholesale suppliers.
Example
67890The purchase unit of measure for this item, passed through as-is to the supplier. No standard is enforced; UN/ECE Recommendation N°20 (Codes for Units of Measure) is recommended if you want a standard.
Example
PCEAn arbitrary date in a month. The month of this date is used for the period M0. Date has ISO 8601 date format.
Example
2023-04-07The forecasted demand of this item in the month of startDate. The quantity has a decimal format.
Example
1234.56The forecasted demand of this item in the next, 1st month.
Example
1234.56The forecasted demand of this item in the 2nd month.
Example
1234.56The forecasted demand of this item in the 3rd month.
Example
1234.56The forecasted demand of this item in the 4th month.
Example
1234.56The forecasted demand of this item in the 5th month.
Example
1234.56The forecasted demand of this item in the 6th month.
Example
1234.56The forecasted demand of this item in the 7th month.
Example
1234.56The forecasted demand of this item in the 8th month.
Example
1234.56The forecasted demand of this item in the 9th month.
Example
1234.56The forecasted demand of this item in the 10th month.
Example
1234.56The forecasted demand of this item in the 11th month.
Example
1234.56The forecasted demand of this item in the 12th month.
Example
1234.56The forecasted demand of this item in the 13th month.
Example
1234.56The forecasted demand of this item in the 14th month.
Example
1234.56The forecasted demand of this item in the 15th month.
Example
1234.56The forecasted demand of this item in the 16th month.
Example
1234.56The forecasted demand of this item in the 17th month.
Example
1234.56The forecasted demand of this item in the 18th month.
Example
1234.56The forecasted demand of this item in the 19th month.
Example
1234.56The forecasted demand of this item in the 20th month.
Example
1234.56The forecasted demand of this item in the 21st month.
Example
1234.56The forecasted demand of this item in the 22nd month.
Example
1234.56The forecasted demand of this item in the 23rd month.
Example
1234.56The forecasted demand of this item in the 24th month.
Example
1234.56The forecasted demand of this item in the 25th month.
Example
1234.56The forecasted demand of this item in the 26th month.
Example
1234.56The forecasted demand of this item in the 27th month.
Example
1234.56The forecasted demand of this item in the 28th month.
Example
1234.56The forecasted demand of this item in the 29th month.
Example
1234.56The forecasted demand of this item in the 30th month.
Example
1234.56The forecasted demand of this item in the 31st month.
Example
1234.56The forecasted demand of this item in the 32nd month.
Example
1234.56The forecasted demand of this item in the 33rd month.
Example
1234.56The forecasted demand of this item in the 34nd month.
Example
1234.56The forecasted demand of this item in the 35nd month.
Example
1234.56ISO local date and time at which the forecast was originally issued in Slimstock.
Example
2022-12-31T10:11:12Responses
Section titled “Responses”Successfully verified and sent Slimstock forecast.
Successfully queued forecast. The forecast has not yet been verified.
Bad request, the user should check the response body for more info.
object
Example
missing.propertyExample
Property X was missingNot authenticated, the user should authenticate using a valid access token, use Basic Authentication, or refresh to get a valid token. May or may not contain a structured response body
object
Example
Authentication failedThe number of authentication attempts left before the user is banned. Applicable when authentication through Basic Authentication fails.
Example
2Int describing the number of seconds left before the user is allowed to attempt a login with Basic Authentication again.
Example
300Not authorized, the user is authenticated but does not have the necessary permission.
object
Example
Not authorized for this actionSupplier not found.
An unexpected error occurred, Tradecloud ops will be alerted. May or may not contain a structured response body.
object
Example
some.errorExample
Some error occurredThe cause of this error. Free-format JSON object.
object
Service is not healthy (bad gateway), Tradecloud ops will be alerted. Will not contain a structured response body.
Service is unavailable (overloaded or down for maintenance), Tradecloud ops will be alerted. May or may not contain a structured response body.
object
Example
Could not retrieve data from external source.Service is unavailable (gateway timeout), Tradecloud ops will be alerted. Will not contain a structured response body.
