### Deep Linking Configuration Examples Source: https://ordercloud.io/knowledge-base/sso-via-openid-connect Examples showing how to configure deep linking using the appstartpath parameter and AppStartUrl. ```text ``` ```text ``` ```text ``` -------------------------------- ### Security Profile Password Configuration Examples Source: https://ordercloud.io/knowledge-base/custom-password-configuration Examples showing individual security profile configurations and the resulting combined restrictive configuration applied to a user. ```json 1{ 2 "PasswordConfig": { 3 "MinimumCharacterCount":10, 4 "MaxConsecutiveDupeChars": 1 5 } 6} ``` ```json 1{ 2 "PasswordConfig": { 3 "MinimumCharacterCount":12, 4 "MaxConsecutiveDupeChars": 3 5 } 6} ``` ```json 1{ 2 "PasswordConfig": { 3 "MinimumCharacterCount":12, 4 "MaxConsecutiveDupeChars": 1 5 } 6} ``` -------------------------------- ### GET v1/me/products Source: https://ordercloud.io/knowledge-base/products-pricing-ordering-in-marketplaces Retrieves products with optional seller-specific pricing. ```APIDOC ## GET v1/me/products ### Description Returns a list of products. Use the sellerID query parameter to filter for seller-specific pricing. ### Method GET ### Endpoint v1/me/products ### Parameters #### Query Parameters - **sellerID** (string) - Optional - The ID of the seller to filter pricing. ``` -------------------------------- ### GET v1/integrations/promotion Source: https://ordercloud.io/knowledge-base/promotion-integration Retrieves the current Promotion Integration configuration for the marketplace. ```APIDOC ## GET v1/integrations/promotion ### Description Retrieves the current Promotion Integration configuration for the marketplace. ### Method GET ### Endpoint v1/integrations/promotion ``` -------------------------------- ### Example Parent XP Structure Source: https://ordercloud.io/knowledge-base/child-products Defines the initial xp structure for a Parent product to be inherited by its children. ```json { "xp": { "ShippingInfo": { "DaysToShip": 3, "ShippingCost": 5 } } } ``` -------------------------------- ### Start ngrok for local development Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-azure-ad-b2c-idp Exposes a local port to a public URL for testing authentication callbacks. ```bash ngrok http 3000 ``` -------------------------------- ### Create a Buyer Organization Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-azure-ad-b2c-idp Examples for creating a buyer organization using HTTP, JavaScript SDK (Promise and Async/Await), and C# SDK. ```http POST https://sandboxapi.ordercloud.io/v1/buyers HTTP/1.1 { "ID": "buyer1", "Name": "Buyer 1", "Active": true } ``` ```javascript import { Tokens, Buyers } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") Buyers.Create({ ID: "buyer1", Name: "Buyer 1", Active: true }) .then(response => { // returns the newly created buyer organization console.log(response); }) .catch(err => console.log(err)); }) ``` ```javascript import { Tokens, Buyers, Buyer, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const buyer: Buyer = await Buyers.Create({ ID: "buyer1", Name: "Buyer 1", Active: true }) .catch((err:OrderCloudError) => console.log(err)); console.log(buyer); ``` ```csharp using OrderCloud.SDK; var client = new OrderCloudClient(...); Buyer response = await client.Buyers.CreateAsync(new Buyer { ID = "buyer1", Name = "Buyer 1", Active = true }); ``` -------------------------------- ### Create OpenID Connect Configuration Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-google-idp Examples for registering a new OpenID Connect configuration with Google using different SDK patterns. ```javascript 1import { Tokens, OpenIdConnects } from "ordercloud-javascript-sdk"; 2 3Tokens.Set("INSERT_ACCESS_TOKEN_HERE") 4 5OpenIdConnects.Create({ 6 ID: "google", 7 OrderCloudApiClientID: "CLIENT_ID_FROM_CREATING_API_CLIENT_STEP", 8 ConnectClientID: "GOOGLE_CLIENT_ID_HERE", 9 ConnectClientSecret: "GOOGLE_CLIENT_SECRET_HERE", 10 AppStartUrl: "http://localhost:3000?token={0}&idpToken={1}", 11 AuthorizationEndpoint: "https://accounts.google.com/o/oauth2/v2/auth", 12 TokenEndpoint: "https://oauth2.googleapis.com/token", 13 UrlEncoded: false, 14 CallSyncUserIntegrationEvent: true, 15 IntegrationEventID: "openidconnect", 16 AdditionalIdpScopes: [] 17}) 18.then(response => { 19 // returns the newly created openidconnect 20 console.log(response); 21}) 22.catch(err => console.log(err)); 23 24}) ``` ```javascript 1import { Tokens, OpenIdConnects, OpenIdConnect, OrderCloudError } from "ordercloud-javascript-sdk"; 2 3Tokens.Set("INSERT_ACCESS_TOKEN_HERE") 4 5const openIdConnect = await OpenIdConnects.Create({ 6 ID: "google", 7 OrderCloudApiClientID: "CLIENT_ID_FROM_CREATING_API_CLIENT_STEP", 8 ConnectClientID: "GOOGLE_CLIENT_ID_HERE", 9 ConnectClientSecret: "GOOGLE_CLIENT_SECRET_HERE", 10 AppStartUrl: "http://localhost:3000?token={0}&idpToken={1}", 11 AuthorizationEndpoint: "https://accounts.google.com/o/oauth2/v2/auth", 12 TokenEndpoint: "https://oauth2.googleapis.com/token", 13 UrlEncoded: false, 14 CallSyncUserIntegrationEvent: true, 15 IntegrationEventID: "openidconnect", 16 AdditionalIdpScopes: [] 17}) 18.catch((err:OrderCloudError) => console.log(err)); 19console.log(openIdConnect); ``` ```csharp 1using OrderCloud.SDK; 2 3var client = new OrderCloudClient(...); 4 5await client.AuthenticateAsync(); 6 7OpenIdConnect response = await client.OpenIdConnects.CreateAsync(new OpenIdConnect { 8 ID: "google", 9 OrderCloudApiClientID: "CLIENT_ID_FROM_CREATING_API_CLIENT_STEP", 10 ConnectClientID: "GOOGLE_CLIENT_ID_HERE", 11 ConnectClientSecret: "GOOGLE_CLIENT_SECRET_HERE", 12 AppStartUrl: "http://localhost:3000?token={0}&idpToken={1}", 13 AuthorizationEndpoint: "https://accounts.google.com/o/oauth2/v2/auth", 14 TokenEndpoint: "https://oauth2.googleapis.com/token", 15 UrlEncoded: false, 16 CallSyncUserIntegrationEvent: true, 17 IntegrationEventID: "openidconnect", 18 AdditionalIdpScopes: [] 19}); ``` -------------------------------- ### GET v1/me/product/{productID} Source: https://ordercloud.io/knowledge-base/products-pricing-ordering-in-marketplaces Retrieves a specific product with seller-specific pricing. ```APIDOC ## GET v1/me/product/{productID} ### Description Returns a specific product with seller-specific pricing applied. ### Method GET ### Endpoint v1/me/product/{productID} ### Parameters #### Path Parameters - **productID** (string) - Required - The ID of the product. #### Query Parameters - **sellerID** (string) - Optional - The ID of the seller to filter pricing. ``` -------------------------------- ### Create OpenID Connect Configuration Source: https://ordercloud.io/knowledge-base/sso-via-openid-connect Example request body for creating an OpenID Connect configuration in OrderCloud. ```http POST https://sandboxapi.ordercloud.io/v1/openidconnects HTTP/1.1 { "ID": "anormalordercloudid", "OrdercloudApiClient": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "ConnectClientID": "…", "ConnectClientSecret": "…", "AppStartUrl": "https://my-buyer-application.com/login?token={0}", "AuthorizationEndpoint": "…", "TokenEndpoint": "…", "IntegrationEventID": "integrationeventID", // required for configs created after 03/31/2020 "CustomErrorUrl": "https://my-buyer-application.com/error?ErrorMessage={0}" // optionally redirect to a custom URL upon error } ``` -------------------------------- ### Create a Buyer Organization Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-google-idp Examples for creating a buyer organization using the OrderCloud API or SDKs. ```http POST https://sandboxapi.ordercloud.io/v1/buyers HTTP/1.1 { "ID": "buyer1", "Name": "Buyer 1", "Active": true } ``` ```javascript import { Tokens, Buyers } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") Buyers.Create({ ID: "buyer1", Name: "Buyer 1", Active: true }) .then(response => { // returns the newly created buyer organization console.log(response); }) .catch(err => console.log(err)); }) ``` ```typescript import { Tokens, Buyers, Buyer, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const buyer: Buyer = await Buyers.Create({ ID: "buyer1", Name: "Buyer 1", Active: true }) .catch((err:OrderCloudError) => console.log(err)); console.log(buyer); ``` ```csharp using OrderCloud.SDK; var client = new OrderCloudClient(...); Buyer response = await client.Buyers.CreateAsync(new Buyer { ID = "buyer1", Name = "Buyer 1", Active = true }); ``` -------------------------------- ### GET v1/approvalrules Source: https://ordercloud.io/knowledge-base/order-returns Retrieve a list of seller approval rules. ```APIDOC ## GET v1/approvalrules ### Description Retrieve a list of seller approval rules. ### Method GET ### Endpoint v1/approvalrules ``` -------------------------------- ### GET v1/locales Source: https://ordercloud.io/knowledge-base/globalization-multicurrency-multilanguage Retrieve a list of all configured locales. ```APIDOC ## GET v1/locales ### Description Retrieves a list of all configured locales in the marketplace. ### Method GET ### Endpoint v1/locales ``` -------------------------------- ### Configure Order Incrementor Source: https://ordercloud.io/knowledge-base/incrementors Example configuration for an order incrementor with a specific padding count. ```json { "ID": "orderincrementor", "Name": "Order Incrementor", "LastNumber": 0, "LeftPaddingCount": 11 } ``` -------------------------------- ### Create a Seller Security Profile Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Examples for creating a 'Default Seller' security profile with administrative roles. ```http POST https://sandboxapi.ordercloud.io/v1/securityprofiles HTTP/1.1 { "ID": "defaultseller", "Name": "Default Seller", "Roles": [ "BuyerAdmin", "ProductAdmin", "OrderAdmin" ] } ``` ```javascript import { SecurityProfiles } from "ordercloud-javascript-sdk"; SecurityProfiles.Create({ "ID": "defaultseller", "Name": "Default Seller", "Roles": [ "BuyerAdmin", "ProductAdmin", "OrderAdmin" ] }) .then((securityProfile) => { console.log(securityProfile); }) .catch((ex) => console.log(ex)); ``` ```typescript import { SecurityProfiles, SecurityProfile, OrderCloudError } from "ordercloud-javascript-sdk"; SecurityProfiles.Create({ "ID": "defaultseller", "Name": "Default Seller", "Roles": [ "BuyerAdmin", "ProductAdmin", "OrderAdmin" ] }) .then((securityProfile: SecurityProfile) => { console.log(securityProfile); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` ```csharp using OrderCloud.SDK; var data = new SecurityProfile { "ID": "defaultseller", "Name": "Default Seller", "Roles": new ApiRole[] { ApiRole.BuyerAdmin, ApiRole.ProductAdmin, ApiRole.OrderAdmin } }; try { SecurityProfile response = await SecurityProfiles.Create(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ``` -------------------------------- ### GET integrations/deliveryconfig Source: https://ordercloud.io/knowledge-base/delivery-configuration Retrieves a list of delivery configurations. ```APIDOC ## GET integrations/deliveryconfig ### Description Retrieves a list of delivery configurations. ### Method GET ### Endpoint integrations/deliveryconfig ``` -------------------------------- ### Promotion Configuration JSON Source: https://ordercloud.io/knowledge-base/rule-based-promotion-expressions Example JSON structure for a promotion applying 30% off the least expensive 3 items when spending at least $50. ```json { "Code": "30OFF", "LineItemLevel": true, "ItemLimitPerOrder": 3, "ItemSortBy": "LineSubtotal", "EligibleExpression": "order.Subtotal >= 50", "ValueExpression": "item.LineSubtotal * .3" } ``` -------------------------------- ### Create a Security Profile Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-azure-ad-b2c-idp Examples for creating a security profile with the 'Shopper' role using HTTP, JavaScript SDK, and C# SDK. ```http POST https://sandboxapi.ordercloud.io/v1/securityprofiles HTTP/1.1 { "ID": "buyerProfile", "Name": "Buyer Security Profile", "Roles": ["Shopper"] } ``` ```javascript import { Tokens, SecurityProfiles } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") SecurityProfiles.Create({ ID: "buyerProfile", Name: "Buyer Security Profile", Roles: ["Shopper"], }) .then(response => { // returns the newly created security profile console.log(response); }) .catch(err => console.log(err)); }) ``` ```javascript import { Tokens, SecurityProfiles, SecurityProfile, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const securityProfile: SecurityProfile = await SecurityProfiles.Create({ ID: "buyerProfile", Name: "Buyer Security Profile", Roles: ["Shopper"], }) .catch((err:OrderCloudError) => console.log(err)); console.log(securityProfile); ``` ```csharp using OrderCloud.SDK; var client = new OrderCloudClient(...); await client.AuthenticateAsync(); SecurityProfile response = await client.SecurityProfiles.CreateAsync(new SecurityProfile { ID = "buyerProfile", Name = "Buyer Security Profile", Roles = new ApiRole[] { ApiRole.Shopper } }); ``` -------------------------------- ### Create a Buyer Security Profile Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Examples for creating a 'Default Buyer' security profile with the Shopper role. ```http POST https://sandboxapi.ordercloud.io/v1/securityprofiles HTTP/1.1 { "ID": "defaultbuyer", "Name": "Default Buyer", "Roles": [ "Shopper" ] } ``` ```javascript import { SecurityProfiles } from "ordercloud-javascript-sdk"; SecurityProfiles.Create({ "ID": "defaultbuyer", "Name": "Default Buyer", "Roles": [ "Shopper" ] }) .then((securityProfile) => { console.log(securityProfile); }) .catch((ex) => console.log(ex)); ``` ```typescript import { SecurityProfiles, SecurityProfile, OrderCloudError } from "ordercloud-javascript-sdk"; SecurityProfiles.Create({ "ID": "defaultbuyer", "Name": "Default Buyer", "Roles": [ "Shopper" ] }) .then((securityProfile: SecurityProfile) => { console.log(securityProfile); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` ```csharp using OrderCloud.SDK; var data = new SecurityProfile { "ID": "defaultbuyer", "Name": "Default Buyer", "Roles": new ApiRole[] { ApiRole.Shopper } }; try { SecurityProfile response = await SecurityProfiles.Create(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ``` -------------------------------- ### Pagination Response Structure Source: https://ordercloud.io/knowledge-base/advanced-querying Example of the Meta and Items structure returned by list endpoints. ```JSON HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 { "Meta": { "Page": 1, "PageSize": 20, "TotalCount": 25, "TotalPages": 2, "ItemRange": [1, 20] }, "Items": ["..."] } ``` -------------------------------- ### GET /me/orders/incoming Source: https://ordercloud.io/knowledge-base/advanced-querying Retrieves a list of incoming orders with optional sorting parameters. ```APIDOC ## GET https://api.ordercloud.io/v1/me/orders/incoming ### Description Retrieves a list of incoming orders. Supports sorting by specific fields in ascending or descending order. ### Method GET ### Endpoint https://api.ordercloud.io/v1/me/orders/incoming ### Parameters #### Query Parameters - **sortBy** (string) - Optional - The field to sort by. Prefix with '!' for descending order (e.g., sortBy=!LastName). - **page** (integer) - Optional - The page number to retrieve (starting at 1). - **pageSize** (integer) - Optional - Number of items per page (default 20, max 100). ### Response #### Success Response (200) - **Meta** (object) - Contains pagination metadata (Page, PageSize, TotalCount, TotalPages, ItemRange). - **Items** (array) - The list of resources returned by the query. #### Response Example { "Meta": { "Page": 1, "PageSize": 20, "TotalCount": 25, "TotalPages": 2, "ItemRange": [1, 20] }, "Items": ["..."] } ``` -------------------------------- ### Create a Security Profile Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-google-idp Examples for creating a security profile to define user roles using the OrderCloud API or SDKs. ```http POST https://sandboxapi.ordercloud.io/v1/securityprofiles HTTP/1.1 { "ID": "buyerProfile", "Name": "Buyer Security Profile", "Roles": ["Shopper"] } ``` ```javascript import { Tokens, SecurityProfiles } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") SecurityProfiles.Create({ ID: "buyerProfile", Name: "Buyer Security Profile", Roles: ["Shopper"], }) .then(response => { // returns the newly created security profile console.log(response); }) .catch(err => console.log(err)); }) ``` ```typescript import { Tokens, SecurityProfiles, SecurityProfile, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const securityProfile: SecurityProfile = await SecurityProfiles.Create({ ID: "buyerProfile", Name: "Buyer Security Profile", Roles: ["Shopper"], }) .catch((err:OrderCloudError) => console.log(err)); console.log(securityProfile); ``` ```csharp using OrderCloud.SDK; var client = new OrderCloudClient(...); await client.AuthenticateAsync(); SecurityProfile response = await client.SecurityProfiles.CreateAsync(new SecurityProfile { ID = "buyerProfile", Name = "Buyer Security Profile", Roles = new ApiRole[] { ApiRole.Shopper } }); ``` -------------------------------- ### PriceSchedule Resource Structure Source: https://ordercloud.io/knowledge-base/sale-prices Example JSON structure for a PriceSchedule resource including new sale pricing fields. ```json { "OwnerID": "marketplaceownerID", "ID": "priceschedule1", "Name": "Price Schedule One", "ApplyTax": false, "ApplyShipping": false, "MinQuantity": 1, "MaxQuantity": null, "UseCumulativeQuantity": false, "RestrictedQuantity": false, "SaleStart": "2022-03-02T00:00:00.00+00:00", // NEW - optional "SaleEnd": "2022-03-02T00:00:00.00+00:00", // NEW - optional "IsOnSale": true, // NEW - readonly - determined from current date/time falling within SaleStart/SaleEnd date AND existence of PriceBreak.SalePrice "PriceBreaks": [ { "Quantity": 1, "Price": 20, "SalePrice": 15 // NEW - optional } ], "Currency": null, "xp": {} } ``` -------------------------------- ### Clone the starter repository Source: https://ordercloud.io/knowledge-base/start-dotnet-middleware-from-scratch Use this command to pull the dotnet-catalyst-examples repository to your local machine. ```bash git clone https://github.com/ordercloud-api/dotnet-catalyst-examples ``` -------------------------------- ### GET v1/locales/assignments Source: https://ordercloud.io/knowledge-base/globalization-multicurrency-multilanguage Retrieve locale assignments. ```APIDOC ## GET v1/locales/assignments ### Description Retrieves a list of all locale assignments. ### Method GET ### Endpoint v1/locales/assignments ``` -------------------------------- ### GET /integrations/TrackingEvents Source: https://ordercloud.io/knowledge-base/tracking-events Retrieves a list of tracking events. ```APIDOC ## GET /integrations/TrackingEvents ### Description Retrieves a list of tracking events. ### Method GET ### Endpoint /integrations/TrackingEvents ``` -------------------------------- ### GET v1/bundles/assignments Source: https://ordercloud.io/knowledge-base/product-bundles Retrieves a list of bundle assignments. ```APIDOC ## GET v1/bundles/assignments ### Description Retrieves a list of bundle assignments. ### Method GET ### Endpoint v1/bundles/assignments ``` -------------------------------- ### GET v1/cart/promotions Source: https://ordercloud.io/knowledge-base/cart Lists Promotions applied to the Cart. ```APIDOC ## GET v1/cart/promotions ### Description Lists Promotions applied to the Cart. ### Method GET ### Endpoint v1/cart/promotions ``` -------------------------------- ### Create Price Schedules for a Product Source: https://ordercloud.io/knowledge-base/same-product-multiple-price-schedules Create separate price schedules for Enterprise and Startup tiers by sending POST requests to the priceschedules endpoint. ```HTTP POST https://sandboxapi.ordercloud.io/v1/priceschedules HTTP/1.1 Authorization: Bearer INSERT_ACCESS_TOKEN_HERE Content-Type: application/json; charset=UTF-8 { "ID": "enterprise-priceschedule-id", "Name": "USB Cord", "MinQuantity": 1, "PriceBreaks": [ { "Quantity": 1, "Price": 3.99 } ] } ``` ```HTTP POST https://sandboxapi.ordercloud.io/v1/priceschedules HTTP/1.1 Authorization: Bearer INSERT_ACCESS_TOKEN_HERE Content-Type: application/json; charset=UTF-8 { "ID": "startup-priceschedule-id", "Name": "USB Cord", "MinQuantity": 1, "PriceBreaks": [ { "Quantity": 1, "Price": 5.99 } ] } ``` -------------------------------- ### Create an API Client using JavaScript SDK Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Examples for creating an API client using the OrderCloud JavaScript SDK, including both standard and typed implementations. ```javascript import { ApiClients } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "ClientSecret": "supersecureclientsecretstring" }) .then((apiClient) => { console.log(apiClient); }) .catch((ex) => console.log(ex)); ``` ```typescript import { ApiClients, ApiClient, OrderCloudError } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "ClientSecret": "supersecureclientsecretstring" }) .then((apiClient: ApiClient) => { console.log(apiClient); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` -------------------------------- ### GET v1/me/sellers Source: https://ordercloud.io/knowledge-base/products-pricing-ordering-in-marketplaces Lists all sellers available to the current buyer. ```APIDOC ## GET v1/me/sellers ### Description Returns a list of sellers (Marketplace Owner and Suppliers) that the current buyer can order from. ### Method GET ### Endpoint v1/me/sellers ``` -------------------------------- ### Create an API client Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-google-idp Methods for creating an API client using REST, JavaScript SDK (Promise and Async/Await), and C# SDK. ```http POST https://sandboxapi.ordercloud.io/v1/apiclients HTTP/1.1 { "AccessTokenDuration": 600, "Active": true, "AppName": "Buyer Client", "RefreshTokenDuration": 43200, "AllowAnyBuyer": true, "AllowSeller": true } ``` ```javascript import { Tokens, ApiClients } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") ApiClients.Create({ AccessTokenDuration: 600, Active: true, AppName: "Buyer Client", RefreshTokenDuration: 43200, AllowAnyBuyer: true, AllowSeller: true }) .then((response) => { console.log(response); }) .catch(err => console.log(err)); }) ``` ```typescript import { Tokens, ApiClients, ApiClient, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const apiClient: ApiClient = await ApiClients.Create({ AccessTokenDuration: 600, Active: true, AppName: "Buyer Client", RefreshTokenDuration: 43200, AllowAnyBuyer: true, AllowSeller: true }) .catch((err:OrderCloudError) => console.log(err)); console.log(apiClient); ``` ```csharp using OrderCloud.SDK; var client = new OrderCloudClient(...); await client.AuthenticateAsync(); ApiClient response = await client.ApiClients.Create(new ApiClient { AccessTokenDuration = 600, Active = true, AppName = "Buyer Client", RefreshTokenDuration = 43200, AllowAnyBuyer = true, AllowSeller = true }); ``` -------------------------------- ### GET v1/integrations/inventory Source: https://ordercloud.io/knowledge-base/inventory-integration Retrieves the current inventory integration configuration. ```APIDOC ## GET v1/integrations/inventory ### Description Retrieves the current inventory integration configuration for the marketplace. ### Method GET ### Endpoint v1/integrations/inventory ``` -------------------------------- ### GET v1/locales/{localeID} Source: https://ordercloud.io/knowledge-base/globalization-multicurrency-multilanguage Retrieve details for a specific locale. ```APIDOC ## GET v1/locales/{localeID} ### Description Retrieves the details of a specific locale by its ID. ### Method GET ### Endpoint v1/locales/{localeID} ### Parameters #### Path Parameters - **localeID** (string) - Required - The unique identifier of the locale. ``` -------------------------------- ### Create a Product Collection via JavaScript SDK Source: https://ordercloud.io/knowledge-base/building-wishlist-using-product-collections Use the Me.CreateProductCollection method to initialize a wishlist collection. ```JavaScript import { Me } from "ordercloud-javascript-sdk"; Me.CreateProductCollection({ ID: "wishlist", Name: "Wishlist", }) .then((productCollection) => { console.log(productCollection); }) .catch((ex) => console.log(ex)); ``` ```TypeScript import { Me, OrderCloudError, ProductCollection } from "ordercloud-javascript-sdk"; Me.CreateProductCollection({ ID: "wishlist", Name: "Wishlist", }) .then((productCollection: ProductCollection) => { console.log(productCollection); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` -------------------------------- ### GET /integrations/TrackingEvents/{id} Source: https://ordercloud.io/knowledge-base/tracking-events Retrieves a specific tracking event by its ID. ```APIDOC ## GET /integrations/TrackingEvents/{id} ### Description Retrieves a specific tracking event by its ID. ### Method GET ### Endpoint /integrations/TrackingEvents/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the tracking event. ``` -------------------------------- ### Create Buyer Storefront API Client Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Configures an API Client for buyer storefronts with AllowAnyBuyer enabled. ```HTTP POST https://sandboxapi.ordercloud.io/v1/apiclients HTTP/1.1 { "AppName": "Buyer Storefront", "Active": true, "AccessTokenDuration": 600, "AllowAnyBuyer": true } ``` ```JavaScript import { ApiClients } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Buyer Storefront", "Active": true, "AccessTokenDuration": 600, "AllowAnyBuyer": true }) .then((apiClient) => { console.log(apiClient); }) .catch((ex) => console.log(ex)); ``` ```TypeScript import { ApiClients, ApiClient, OrderCloudError } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Buyer Storefront", "Active": true, "AccessTokenDuration": 600, "AllowAnyBuyer": true }) .then((apiClient: ApiClient) => { console.log(apiClient); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` ```C# using OrderCloud.SDK; var data = new ApiClient { "AppName": "Buyer Storefront", "Active": true, "AccessTokenDuration": 600, "AllowAnyBuyer": true }; try { ApiClient response = await ApiClients.Create(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ``` -------------------------------- ### Create an API Client using .NET SDK Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Implementation for creating an API client within a .NET environment using the OrderCloud SDK. ```csharp using OrderCloud.SDK; var data = new ApiClient { "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "ClientSecret": "supersecureclientsecretstring" }; try { ApiClient response = await ApiClients.Create(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ``` -------------------------------- ### GET v1/me/productcollections/{productCollectionID}/invitations Source: https://ordercloud.io/knowledge-base/product-collection-enhancements Lists invitations for a product collection. ```APIDOC ## GET v1/me/productcollections/{productCollectionID}/invitations ### Description Lists invitations for a product collection. Requires the Shopper role. ### Method GET ### Endpoint v1/me/productcollections/{productCollectionID}/invitations ### Parameters #### Path Parameters - **productCollectionID** (string) - Required - The ID of the product collection. ``` -------------------------------- ### Create a Product Collection via C# SDK Source: https://ordercloud.io/knowledge-base/building-wishlist-using-product-collections Use the Me.CreateProductCollection method within a try-catch block to handle potential OrderCloud exceptions. ```C# using OrderCloud.SDK; var productCollection = new ProductCollection { ID = "wishlist", Name = "Wishlist", }; try { ProductCollection response = await Me.CreateProductCollection(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ``` -------------------------------- ### GET integrations/deliveryconfig/{deliveryConfigId} Source: https://ordercloud.io/knowledge-base/delivery-configuration Retrieves a specific delivery configuration by its ID. ```APIDOC ## GET integrations/deliveryconfig/{deliveryConfigId} ### Description Retrieves a specific delivery configuration by its ID. ### Method GET ### Endpoint integrations/deliveryconfig/{deliveryConfigId} ### Parameters #### Path Parameters - **deliveryConfigId** (string) - Required - The unique identifier of the delivery configuration. ``` -------------------------------- ### GET v1/suppliers/{supplierID}/buyers Source: https://ordercloud.io/knowledge-base/products-pricing-ordering-in-marketplaces Lists buyers associated with a specific supplier. ```APIDOC ## GET v1/suppliers/{supplierID}/buyers ### Description Retrieves a list of buyers for a given supplier. Marketplace Owner and Suppliers are authorized to access this endpoint. ### Method GET ### Endpoint v1/suppliers/{supplierID}/buyers ### Parameters #### Path Parameters - **supplierID** (string) - Required - The ID of the supplier. ``` -------------------------------- ### Create a user with XP Source: https://ordercloud.io/knowledge-base/extended-properties Demonstrates adding custom user data like age and gender by defining an xp object in the request body. ```http POST https://api.ordercloud.io/buyers/{buyerID}/users HTTP/1.1 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9... Content-Type: application/json; charset=UTF-8 { "Username": "janesmith", "Password": "test12345", "FirstName": "Jane", "LastName": "Smith", "Email": "jsmith@company.com", "Phone": "555-555-5555", "TermsAccepted": null, "Active": true, "xp": { "Gender": "Female", "Age" : 26 }, "AvailableRoles": [], "DateCreated": "2019-06-04T20:35:36.38+00:00", "PasswordLastSetDate": "2019-07-12T00:03:58.28+00:00" } ``` -------------------------------- ### Mathematical and Conditional Functions Source: https://ordercloud.io/knowledge-base/rule-based-promotion-expressions Examples of wrapping expressions in min, max, and rounding functions. ```text min(200, order.Total) ``` ```text min(200.00, order.Total) ``` ```text max(200, order.Total) ``` ```text max(200.00, order.Total) ``` ```text round((order.Total * .1), 0) ``` -------------------------------- ### PUT v1/integrations/promotion Source: https://ordercloud.io/knowledge-base/promotion-integration Updates or creates the Promotion Integration configuration for the marketplace. ```APIDOC ## PUT v1/integrations/promotion ### Description Updates or creates the Promotion Integration configuration for the marketplace. ### Method PUT ### Endpoint v1/integrations/promotion ### Request Body - **Url** (string) - Required - The middleware endpoint URL. - **HashKey** (string) - Required - The security hash key. ``` -------------------------------- ### GET v1/orders/all Source: https://ordercloud.io/knowledge-base/products-pricing-ordering-in-marketplaces Retrieves all orders based on the user's role within the marketplace. ```APIDOC ## GET v1/orders/all ### Description Returns all orders to any orgs in your marketplace if you are the Marketplace Owner. Returns outgoing orders if you are a buyer user, or incoming orders if you are a supplier user. ### Method GET ### Endpoint v1/orders/all ``` -------------------------------- ### Create a Product Facet configuration Source: https://ordercloud.io/knowledge-base/faceted-navigation Defines a product facet by mapping an extended property path to a facet ID. This configuration instructs OrderCloud to index the specified xp field. ```json { "ID": "color", "Name": "Color", "XpPath": "Facets.Color", "ListOrder": 0, "MinCount": 1, "xp": {} } ``` -------------------------------- ### Create ProductSynchronization Record Source: https://ordercloud.io/knowledge-base/bidirectional-contenthub-integration Configure the ProductSynchronization record to trigger synchronization events for product creation. ```json { "SyncProductChanged": true, "DeliveryConfigID": "{the ID of your DeliveryConfiguration}" // e.g. contenthub } ``` -------------------------------- ### GET v1/buyers/{buyerID}/productcollections/{productCollectionID} Source: https://ordercloud.io/knowledge-base/product-collection-enhancements Retrieves a specific product collection for a buyer. ```APIDOC ## GET v1/buyers/{buyerID}/productcollections/{productCollectionID} ### Description Retrieves a specific product collection for a buyer. Requires the ProductCollectionReader role. ### Method GET ### Endpoint v1/buyers/{buyerID}/productcollections/{productCollectionID} ### Parameters #### Path Parameters - **buyerID** (string) - Required - The ID of the buyer. - **productCollectionID** (string) - Required - The ID of the product collection. ``` -------------------------------- ### Create Integration Event via JavaScript SDK Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-google-idp Examples for creating an integration event using the OrderCloud JavaScript SDK with both promise-based and async/await patterns. ```javascript import { Tokens, IntegrationEvents } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") IntegrationEvents.Create({ ID: "openidconnect", Name: "openidconnect", EventType: "OpenIDConnect", CustomImplementationUrl: "{your-ngrok-url}/integration-events", HashKey: "supersecrethash", ElevatedRoles: ["BuyerUserAdmin"], }) .then(response => { // returns the newly created integration event console.log(response); }) .catch(err => console.log(err)); }) ``` ```javascript import { Tokens, IntegrationEvents, IntegrationEvent, OrderCloudError } from "ordercloud-javascript-sdk"; Tokens.Set("INSERT_ACCESS_TOKEN_HERE") const integrationEvent: IntegrationEvent = await IntegrationEvents.Create({ ID: "openidconnect", Name: "openidconnect", EventType: "OpenIDConnect", CustomImplementationUrl: "{your-ngrok-url}/integration-events", HashKey: "supersecrethash", ElevatedRoles: ["BuyerUserAdmin"], }) .catch((err:OrderCloudError) => console.log(err)); console.log(integrationEvent); ``` -------------------------------- ### GET v1/buyers/{buyerID}/productcollections Source: https://ordercloud.io/knowledge-base/product-collection-enhancements Retrieves a list of product collections for a specific buyer. ```APIDOC ## GET v1/buyers/{buyerID}/productcollections ### Description Retrieves a list of product collections for a specific buyer. Requires the ProductCollectionReader role. ### Method GET ### Endpoint v1/buyers/{buyerID}/productcollections ### Parameters #### Path Parameters - **buyerID** (string) - Required - The ID of the buyer. ``` -------------------------------- ### GET v1/me/products Source: https://ordercloud.io/knowledge-base/inventory-management Filters products based on inventory availability at specific store locations. ```APIDOC ## GET v1/me/products ### Description Filters the product list to return only items available at specified store locations with a quantity greater than zero. ### Method GET ### Endpoint v1/me/products ### Parameters #### Query Parameters - **InventoryRecords.AddressID** (string) - Required - Pipe-separated list of Address IDs to filter by. - **InventoryRecords.QuantityAvailable** (string) - Required - Filter for availability (e.g., >0). ``` -------------------------------- ### GET v1/apiclients/{apiClientID}/secrets Source: https://ordercloud.io/knowledge-base/api-client-secrets Retrieves a list of secrets for a specific API Client. ```APIDOC ## GET v1/apiclients/{apiClientID}/secrets ### Description Retrieves a list of all secrets associated with the specified API Client. ### Method GET ### Endpoint v1/apiclients/{apiClientID}/secrets ### Parameters #### Path Parameters - **apiClientID** (string) - Required - The ID of the API Client. ``` -------------------------------- ### Create Product Sync Source: https://ordercloud.io/knowledge-base/product-sync-sitecore-search Define the synchronization behavior for product changes and deletions. ```json { "DeliveryConfigID": "", // pass the ID of the config created in the step above "SyncProductChanged": true, "SyncProductDeleted": true } ``` -------------------------------- ### API Request with Authorization Header Source: https://ordercloud.io/knowledge-base/authentication Example of including the access token in an API request header. ```http GET https://api.ordercloud.io/v1/buyers HTTP/1.1 ``` -------------------------------- ### Create OpenID Connect Configuration Source: https://ordercloud.io/knowledge-base/implementing-single-sign-on-with-azure-ad-b2c-idp Configures an OpenID Connect identity provider using the OrderCloud SDK. Choose the language matching your development environment. ```javascript 5const openIdConnect = await OpenIdConnects.Create({ 6 ID: "azure", 7 OrderCloudApiClientID: "CLIENT_ID_FROM_CREATING_API_CLIENT_STEP", 8 ConnectClientID: "CLIENT_ID_FROM_CONFIGURING_AZURE", 9 ConnectClientSecret: "CLIENT_SECRET_FROM_CONFIGURING_AZURE", 10 AppStartUrl: "http://localhost:3000?token={0}&idpToken={1}&refreshToken={3}", 11 AuthorizationEndpoint: "AUTH_ENDPOINT_FROM_AZURE", 12 TokenEndpoint: "TOKEN_ENDPOINT_FROM_AZURE", 13 UrlEncoded: false, 14 CallSyncUserIntegrationEvent: true, 15 IntegrationEventID: "openidconnect", 16 AdditionalIdpScopes: ["CLIENT_ID_FROM_CONFIGURING_AZURE"] // If included, you will receive the azure token in addition to ordercloud token at the end of the flow 17}) 18.catch((err:OrderCloudError) => console.log(err)); 19console.log(openIdConnect); ``` ```csharp 1using OrderCloud.SDK; 2 3var client = new OrderCloudClient(...); 4 5await client.AuthenticateAsync(); 6 7OpenIdConnect response = await client.OpenIdConnects.CreateAsync(new OpenIdConnect { 8 ID = "azure", 9 OrderCloudApiClientID = "CLIENT_ID_FROM_CREATING_API_CLIENT_STEP", 10 ConnectClientID = "CLIENT_ID_FROM_CONFIGURING_AZURE", 11 ConnectClientSecret = "CLIENT_SECRET_FROM_CONFIGURING_AZURE", 12 AppStartUrl = "http://localhost:3000?token={0}&idpToken={1}&refreshToken={3}", 13 AuthorizationEndpoint = "AUTH_ENDPOINT_FROM_AZURE", 14 TokenEndpoint = "TOKEN_ENDPOINT_FROM_AZURE", 15 UrlEncoded = false, 16 CallSyncUserIntegrationEvent = true, 17 IntegrationEventID = "openidconnect", 18 AdditionalIdpScopes = ["CLIENT_ID_FROM_CONFIGURING_AZURE"] // If included, you will receive the azure token in addition to ordercloud token at the end of the flow 19}); ``` -------------------------------- ### Apply a facet filter Source: https://ordercloud.io/knowledge-base/faceted-navigation Example of a query string applying a filter for a specific facet value. ```http 1/me/products?xp.Facets.Color=purple ``` -------------------------------- ### Create a Product Collection via REST API Source: https://ordercloud.io/knowledge-base/building-wishlist-using-product-collections Use the POST endpoint to create a new product collection for the current user. ```HTTP POST https://sandboxapi.ordercloud.io/v1/me/productcollections HTTP/1.1 { "ID": "wishlist", "Name": "Wishlist", } ``` -------------------------------- ### GET v1/integrations/subscription Source: https://ordercloud.io/knowledge-base/subscriptions Retrieves the current Subscription Integration configuration for the marketplace. Requires SubscriptionAdmin role. ```APIDOC ## GET v1/integrations/subscription ### Description Retrieves the current Subscription Integration configuration for the marketplace. ### Method GET ### Endpoint v1/integrations/subscription ``` -------------------------------- ### GET v1/apiclients/{apiClientID}/secrets/{apiClientSecretID} Source: https://ordercloud.io/knowledge-base/api-client-secrets Retrieves details for a specific API Client Secret. ```APIDOC ## GET v1/apiclients/{apiClientID}/secrets/{apiClientSecretID} ### Description Retrieves the details of a specific API Client Secret. ### Method GET ### Endpoint v1/apiclients/{apiClientID}/secrets/{apiClientSecretID} ### Parameters #### Path Parameters - **apiClientID** (string) - Required - The ID of the API Client. - **apiClientSecretID** (string) - Required - The ID of the API Client Secret. ``` -------------------------------- ### POST /createuser Source: https://ordercloud.io/knowledge-base/sso-via-openid-connect Endpoint to be hosted by your application to handle user creation after the first successful IDP authentication. ```APIDOC ## POST /createuser ### Description Called by OrderCloud after a user enters their credentials in the IDP for the first time. Use the provided token response to create the user in OrderCloud. ### Method POST ### Request Body - **ExistingUser** (object) - Null for new users. - **OpenIdConnect** (object) - Your OpenID Connect configuration. - **TokenResponse** (object) - Contains id_token and access_token from the IDP. - **Environment** (string) - The current environment (e.g., Sandbox). - **OrderCloudAccessToken** (string) - Token of the default context user. - **ConfigData** (object) - Configuration data. ### Response #### Success Response (200) - **Username** (string) - The username of the user created in OrderCloud. - **ErrorMessage** (string) - Error message if the process fails. ``` -------------------------------- ### Configure Product Synchronization for Sitecore Search Source: https://ordercloud.io/knowledge-base/entity-synchronization Defines a delivery configuration for synchronizing product entities to Sitecore Search. ```json { "ID": "SynchronizeProducts", "Name": "SynchronizeProducts", "Enabled": true, "DeliveryTargets": { "SearchIngestion": { "Domain": "", "Source": "", "Endpoint": "https://discover.sitecorecloud.io", "Entity": "product", "ApiKey": null } } } ``` -------------------------------- ### DiscoverEvent Configuration Source: https://ordercloud.io/knowledge-base/delivery-configuration Configuration settings for DiscoverEvent. ```json 1{ 2 "ApiKey" : "" 3 "ClientID": "", 4 "ServiceEndpoint": "" 5} ``` -------------------------------- ### Create Admin Backoffice API Client Source: https://ordercloud.io/knowledge-base/configuring-user-application-data-access Configures an API Client for admin backoffice applications with AllowAnySeller and AllowAnySupplier enabled. ```HTTP POST https://sandboxapi.ordercloud.io/v1/apiclients HTTP/1.1 { "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "AllowAnySupplier": true } ``` ```JavaScript import { ApiClients } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "AllowAnySupplier": true }) .then((apiClient) => { console.log(apiClient); }) .catch((ex) => console.log(ex)); ``` ```TypeScript import { ApiClients, ApiClient, OrderCloudError } from "ordercloud-javascript-sdk"; ApiClients.Create({ "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "AllowAnySupplier": true }) .then((apiClient: ApiClient) => { console.log(apiClient); }) .catch((ex: OrderCloudError) => console.log(ex)); ``` ```C# using OrderCloud.SDK; var data = new ApiClient { "AppName": "Admin Backoffice", "Active": true, "AccessTokenDuration": 600, "AllowAnySeller": true, "AllowAnySupplier": true }; try { ApiClient response = await ApiClients.Create(data); Console.WriteLine(response) } catch(OrderCloudException ex) { Console.WriteLine(ex.Message); } ```