APIs identify Facts based on the attributes passed in the input. To know which attributes are Facts for an API, see the Sterling Selling and Fulfillment Foundation Javadocs for that API. For example, createOrder's Javadocs state that EnterpriseCode is a Fact. So if createOrder is called with EnterpriseCode = "E1", the order will be created in E1's Colony Transaction schema.
Facts that are passed in the input of an API should all point to the same colony; that is, users must remain in the same colony's context during an API call.
Certain attributes can be passed in any API's input, even if the Javadocs do not categorize them as a Fact. In the case of ColonyID, Sterling Selling and Fulfillment Foundation does not pass this attribute in APIs, but it is included in the following table because you can optionally implement the application to pass ColonyId. All of these attributes should be present in the header element:
Fact Attribute | Fact Type |
---|---|
ColonyId | ColonyId |
CallingOrganizationCode | OrganizationCode |
EnterpriseCode | OrganizationCode |
OrganizationCode | OrganizationCode |
APIs can also work based on Primary Keys. For example, a user can call the scheduleOrder API with just the OrderHeaderKey in the input. The first two digits of the Primary Key help the API identify which Colony it should act on.