Send forecast
const url = 'https://api.tradecloud1.com/v2/api-connector/forecast';const options = { method: 'POST', headers: {Authorization: '<Authorization>', 'Content-Type': 'application/json'}, body: '{"header":{"companyId":"00f03b98-2511-489f-9695-13791b3f66b6","supplierAccountNumber":"12345","forecastNumber":"F123456789"},"lines":[{"item":{"buyerItemNumber":"12345","buyerItemRevision":"v2","buyerItemName":"Round tube ø60x45","supplierItemNumber":"67890","purchaseUnitOfMeasureIso":"PCE"},"schedule":[{"startDate":"2023-01-01","endDate":"2023-01-31","quantity":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 \ --header 'Authorization: <Authorization>' \ --header 'Content-Type: application/json' \ --data '{ "header": { "companyId": "00f03b98-2511-489f-9695-13791b3f66b6", "supplierAccountNumber": "12345", "forecastNumber": "F123456789" }, "lines": [ { "item": { "buyerItemNumber": "12345", "buyerItemRevision": "v2", "buyerItemName": "Round tube ø60x45", "supplierItemNumber": "67890", "purchaseUnitOfMeasureIso": "PCE" }, "schedule": [ { "startDate": "2023-01-01", "endDate": "2023-01-31", "quantity": 1234.56 } ] } ], "issueDateTime": "2022-12-31T10:11:12" }'Send a new forecast for one supplier. Requires buyer and integration roles.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Send 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 your forecast or ERP system and added to the supplier connection in the Tradecloud portal.
Example
12345The mandatory forecast code or number as known in your forecast or ERP system. The number must be the same for each supplier forecast from the same generated forecast.
Example
F123456789The lines of this forecast, each consisting of an item and forecast schedule.
A forecast line contains an item and a schedule with forecasted demands per period.
object
The forecasted item (or article, goods).
object
The item code or number as known in your forecast or 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
PCEThe forecast schedule lines for this item, each consisting of a forecast period and forecasted demand during this period.
A forecast period and the forecasted demand during this period.
object
The first day of this forecast period. Date has ISO 8601 date format.
Example
2023-01-01The last day of this forecast period. Date has ISO 8601 date format.
Example
2023-01-31The forecasted demand in this period. Quantity has a decimal format.
Example
1234.56ISO local date and time at which the forecast was originally issued in your forecast or ERP system.
Example
2022-12-31T10:11:12Responses
Section titled “Responses”Successfully verified and sent 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.
