OrderCloud SDK
An AngularJs SDK for OrderCloud API
Table of Contents
Getting Started
$ bower install ordercloud - angular - sdk -- save - dev
Or just include the output in the dist folder directly in your project.
REQUIREMENTS
This sdk is to always be used in conjunction with another angular project.
You must also define some variable constants in the referecing application.
angular . module ( ' orderCloud ' , [ ] )
. constant ( ' clientid ' , ' ... ' )
. constant ( ' authurl ' , ' ... ' )
. constant ( ' apiurl ' , ' ... ' )
In some cases, your app will need to access multiple buyer companies, so the buyerid is not stored as a constant. Instead, the buyerid is stored in an AngularJS factory named BuyerID within this sdk.
In order to set an initial/default buyerid, add a run function in addition to the above constants.
. run ( function ( BuyerID ) { OrderCloud . BuyerID . Set ( ' BUYERIDHERE ' ) ; } )
The BuyerID function can be used within any AngularJS controller and/or factory within your application in order to change which buyerid should be used.
Simply inject the BuyerID factory into your controller or factory and call OrderCloud.BuyerID.Set('NEWIDHERE');.
If needed, OrderCloud.BuyerID().Get() will return the buyerid that is currently set.
The CatalogID function can be used within any AngularJS controller and/or factory within your application in order to change which catalogid should be used.
Simply inject the CatalogID factory into your controller or factory and call OrderCloud.CatalogID.Set('NEWIDHERE');.
If needed, OrderCloud.CatalogID().Get() will return the catalogid that is currently set.
API RESOURCES AND METHODS
SecurityProfiles
angular . module ( ' orderCloud.sdk).factory(SecurityProfiles, SecurityProfilesFactory)
Get a Single Security Profile
OrderCloud . SecurityProfiles . Get ( securityProfileID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
securityProfileID
string
ID of the security profile.
Response Body Sample
{
" ID " : " … " ,
" IsDevProfile " : false ,
" Name " : " … " ,
" Roles " : [
" … "
]
}
Get a List of Security Profiles
OrderCloud . SecurityProfiles . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" IsDevProfile " : false ,
" Name " : " … " ,
" Roles " : [
" … "
]
}
]
}
List Assignments
OrderCloud . SecurityProfiles . ListAssignments ( securityProfileID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
securityProfileID
string
ID of the security profile.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the security profile.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" SecurityProfileID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Delete Assignment
OrderCloud . SecurityProfiles . DeleteAssignment ( securityProfileID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
securityProfileID
string
ID of the security profile.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Save Assignment
OrderCloud . SecurityProfiles . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" SecurityProfileID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
ForgottenPassword
angular . module ( ' orderCloud.sdk).factory(ForgottenPassword, ForgottenPasswordFactory)
Send Verification Code
OrderCloud . ForgottenPassword . SendVerificationCode ( passwordResetRequest ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ClientID " : " … " ,
" Email " : " … " ,
" Username " : " … " ,
" URL " : " … "
}
Reset Password
OrderCloud . ForgottenPassword . ResetPassword ( verificationCode , passwordReset ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
verificationCode
string
Verification code of the forgotten password.
Request Body Sample
{
" ClientID " : " … " ,
" Username " : " … " ,
" Password " : " … "
}
Me
angular . module ( ' orderCloud.sdk).factory(Me, MeFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
Get the Current Authenticated User
OrderCloud . Me . Get ( ) . then ( successFn ) . catch ( errorFn ) ;
Response Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
Update the Currently Authenticated User
OrderCloud . Me . Update ( user ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Patch the Currently Authenticated User.
OrderCloud . Me . Patch ( user ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Create From Temp User
OrderCloud . Me . CreateFromTempUser ( user , tempUserToken ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
tempUserToken
string
Temp user token of the me.
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
CostCenters
angular . module ( ' orderCloud.sdk).factory(CostCenters, CostCentersFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Cost Centers
OrderCloud . CostCenters . ListCostCenters ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
]
}
UserGroups
angular . module ( ' orderCloud.sdk).factory(UserGroups, UserGroupsFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List User Groups
OrderCloud . UserGroups . ListUserGroups ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
]
}
Addresses
angular . module ( ' orderCloud.sdk).factory(Addresses, AddressesFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Addresses
OrderCloud . Addresses . ListAddresses ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Shipping " : false ,
" Billing " : false ,
" Editable " : false ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
]
}
Create Address
OrderCloud . Addresses . CreateAddress ( address ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" Shipping " : false ,
" Billing " : false ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Get Address
OrderCloud . Addresses . GetAddress ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Response Body Sample
{
" ID " : " … " ,
" Shipping " : false ,
" Billing " : false ,
" Editable " : false ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Update Address
OrderCloud . Addresses . UpdateAddress ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" Shipping " : false ,
" Billing " : false ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Patch Address
OrderCloud . Addresses . PatchAddress ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" Shipping " : false ,
" Billing " : false ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Delete Address
OrderCloud . Addresses . DeleteAddress ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
CreditCards
angular . module ( ' orderCloud.sdk).factory(CreditCards, CreditCardsFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
Create Credit Card
OrderCloud . CreditCards . CreateCreditCard ( creditCard ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
List Credit Cards
OrderCloud . CreditCards . ListCreditCards ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Editable " : false ,
" Token " : " … " ,
" DateCreated " : null ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
]
}
Get Credit Card
OrderCloud . CreditCards . GetCreditCard ( creditcardID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditcardID
string
ID of the creditcard.
Response Body Sample
{
" ID " : " … " ,
" Editable " : false ,
" Token " : " … " ,
" DateCreated " : null ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Update Credit Card
OrderCloud . CreditCards . UpdateCreditCard ( creditcardID , creditCard ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditcardID
string
ID of the creditcard.
Request Body Sample
{
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Patch Credit Card
OrderCloud . CreditCards . PatchCreditCard ( creditcardID , creditCard ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditcardID
string
ID of the creditcard.
Request Body Sample
{
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Delete Credit Card
OrderCloud . CreditCards . DeleteCreditCard ( creditcardID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditcardID
string
ID of the creditcard.
Categories
angular . module ( ' orderCloud.sdk).factory(Categories, CategoriesFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Categories
OrderCloud . Categories . ListCategories ( listArgs , depth , catalogID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
depth
string
Depth of the category.
catalogID
string
ID of the catalog.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … " ,
" ChildCount " : 0
}
]
}
Products
angular . module ( ' orderCloud.sdk).factory(Products, ProductsFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Products
OrderCloud . Products . ListProducts ( listArgs , categoryID , catalogID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
categoryID
string
ID of the category.
catalogID
string
ID of the catalog.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ReplenishmentPriceSchedule " : {
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
} ,
" StandardPriceSchedule " : {
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
} ,
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" SpecCount " : 0 ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" VariantCount " : 0 ,
" ShipFromAddressID " : " … "
}
]
}
Get Product
OrderCloud . Products . GetProduct ( productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Response Body Sample
{
" ReplenishmentPriceSchedule " : {
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
} ,
" StandardPriceSchedule " : {
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
} ,
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" SpecCount " : 0 ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" VariantCount " : 0 ,
" ShipFromAddressID " : " … "
}
List Specs
OrderCloud . Products . ListSpecs ( productID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" Options " : [
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
] ,
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
]
}
Get Spec
OrderCloud . Products . GetSpec ( productID , specID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
specID
string
ID of the spec.
Response Body Sample
{
" Options " : [
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
] ,
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
Orders
angular . module ( ' orderCloud.sdk).factory(Orders, OrdersFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Outgoing Orders
OrderCloud . Orders . ListOutgoingOrders ( listArgs , from , to ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
from
date
Lower bound of date range that the order was created (if outgoing) or submitted (if incoming).
to
date
Upper bound of date range that the order was created (if outgoing) or submitted (if incoming).
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
]
}
List Incoming Orders
OrderCloud . Orders . ListIncomingOrders ( listArgs , from , to ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
from
date
Lower bound of date range that the order was created (if outgoing) or submitted (if incoming).
to
date
Upper bound of date range that the order was created (if outgoing) or submitted (if incoming).
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
]
}
Get Order
OrderCloud . Orders . GetOrder ( orderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Promotions
angular . module ( ' orderCloud.sdk).factory(Promotions, PromotionsFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Promotions
OrderCloud . Promotions . ListPromotions ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
]
}
Get Promotion
OrderCloud . Promotions . GetPromotion ( promotionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
Response Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
SpendingAccounts
angular . module ( ' orderCloud.sdk).factory(SpendingAccounts, SpendingAccountsFactory)
"Me" is a container for read-only endpoints that return a filtered view of things that the current buyer user is allowed to see, i.e. things that they are assigned to either directly or as a member of a buyer organization or user group. It also provides ways for a user to update or change their own information.
List Spending Accounts
OrderCloud . SpendingAccounts . ListSpendingAccounts ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
]
}
Get Spending Account
OrderCloud . SpendingAccounts . GetSpendingAccount ( spendingAccountID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
Orders
angular . module ( ' orderCloud.sdk).factory(Orders, OrdersFactory)
An Order represents a business transaction between two parties. It typically consists of a collection of Line Items, a Payment Method, Tax and Shipping information, etc. The OrderCloud platform defines various "actions" that can be performed against Orders, such as Submit, Approve, Ship, etc. These actions transform the state of the order and often trigger external events such as financial transactions.
Get a Single Order
OrderCloud . Orders . Get ( orderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Create New Order
OrderCloud . Orders . Create ( order ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" BillingAddressID " : " … " ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" xp " : null
}
Create or Update Order
OrderCloud . Orders . Update ( orderID , order ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" BillingAddressID " : " … " ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" xp " : null
}
Delete Order
OrderCloud . Orders . Delete ( orderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
List Outgoing
OrderCloud . Orders . ListOutgoing ( from , to , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
from
date
Lower bound of date range that the order was created.
to
date
Upper bound of date range that the order was created.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
]
}
List Incoming
OrderCloud . Orders . ListIncoming ( from , to , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
from
date
Lower bound of date range that the order was submitted.
to
date
Upper bound of date range that the order was submitted.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
]
}
List Approvals
OrderCloud . Orders . ListApprovals ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ApprovalRuleID " : " … " ,
" ApprovingGroupID " : " … " ,
" Status " : " Pending " ,
" DateCreated " : " 0001-01-01T00:00:00+00:00 " ,
" DateCompleted " : null ,
" ApproverID " : " … " ,
" ApproverUserName " : " … " ,
" ApproverEmail " : " … " ,
" Comments " : " … "
}
]
}
List Eligible Approvers
OrderCloud . Orders . ListEligibleApprovers ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
]
}
Partially Update Order
OrderCloud . Orders . Patch ( orderID , partialOrder ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" BillingAddressID " : " … " ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" xp " : null
}
Submit Order
OrderCloud . Orders . Submit ( orderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Approve Order
OrderCloud . Orders . Approve ( orderID , comments ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
comments
string
Comments to be saved with the order approval.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Decline Order
OrderCloud . Orders . Decline ( orderID , comments ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
comments
string
Comments to be saved with the order denial.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Cancel Order
OrderCloud . Orders . Cancel ( orderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Ship Order
OrderCloud . Orders . Ship ( orderID , shipment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Set Shipping Address
OrderCloud . Orders . SetShippingAddress ( orderID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Patch Shipping Address
OrderCloud . Orders . PatchShippingAddress ( orderID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Set Billing Address
OrderCloud . Orders . SetBillingAddress ( orderID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Patch Billing Address
OrderCloud . Orders . PatchBillingAddress ( orderID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Add Promotion
OrderCloud . Orders . AddPromotion ( orderID , promoCode ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
promoCode
string
Promo code of the order.
Response Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
List Promotions
OrderCloud . Orders . ListPromotions ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" Amount " : 0.0 ,
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
]
}
Remove Promotion
OrderCloud . Orders . RemovePromotion ( orderID , promoCode ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
promoCode
string
Promo code of the order.
Response Body Sample
{
" ID " : " … " ,
" Type " : " Standard " ,
" FromUserID " : " … " ,
" FromUserFirstName " : " … " ,
" FromUserLastName " : " … " ,
" BillingAddressID " : " … " ,
" BillingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShippingAddressID " : " … " ,
" Comments " : " … " ,
" LineItemCount " : 0 ,
" Status " : " Unsubmitted " ,
" DateCreated " : null ,
" DateSubmitted " : null ,
" DateApproved " : null ,
" DateDeclined " : null ,
" DateCanceled " : null ,
" DateCompleted " : null ,
" Subtotal " : 0.0 ,
" ShippingCost " : 0.0 ,
" TaxCost " : 0.0 ,
" PromotionDiscount " : 0.0 ,
" Total " : 0.0 ,
" IsSubmitted " : false ,
" xp " : null
}
Transfer Temp User Order
OrderCloud . Orders . TransferTempUserOrder ( tempUserToken ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
tempUserToken
string
Temp user token of the order.
LineItems
angular . module ( ' orderCloud.sdk).factory(LineItems, LineItemsFactory)
A Line Item represents a single line on an Order. At a minimum, it contains a single Product SKU and a quantity. A line item may also include Spec values, a Cost Center, shipping details, date needed, and other custom information.
Get a Single Line Item
OrderCloud . LineItems . Get ( orderID , lineItemID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Response Body Sample
{
" ID " : " … " ,
" ProductID " : " … " ,
" Quantity " : 0 ,
" DateAdded " : " 0001-01-01T00:00:00+00:00 " ,
" QuantityShipped " : 0 ,
" UnitPrice " : null ,
" LineTotal " : 0.0 ,
" CostCenter " : " … " ,
" DateNeeded " : null ,
" ShippingAccount " : " … " ,
" ShippingAddressID " : " … " ,
" ShipFromAddressID " : " … " ,
" ShippingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShipFromAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" Specs " : [
{
" SpecID " : " … " ,
" Name " : " … " ,
" OptionID " : " … " ,
" Value " : " … "
}
] ,
" xp " : null
}
Get a List of Line Items
OrderCloud . LineItems . List ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" ProductID " : " … " ,
" Quantity " : 0 ,
" DateAdded " : " 0001-01-01T00:00:00+00:00 " ,
" QuantityShipped " : 0 ,
" UnitPrice " : null ,
" LineTotal " : 0.0 ,
" CostCenter " : " … " ,
" DateNeeded " : null ,
" ShippingAccount " : " … " ,
" ShippingAddressID " : " … " ,
" ShipFromAddressID " : " … " ,
" ShippingAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" ShipFromAddress " : {
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
} ,
" Specs " : [
{
" SpecID " : " … " ,
" Name " : " … " ,
" OptionID " : " … " ,
" Value " : " … "
}
] ,
" xp " : null
}
]
}
Create New Line Item
OrderCloud . LineItems . Create ( orderID , lineItem ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" ProductID " : " … " ,
" Quantity " : 0 ,
" UnitPrice " : null ,
" CostCenter " : " … " ,
" DateNeeded " : null ,
" ShippingAccount " : " … " ,
" ShippingAddressID " : " … " ,
" ShipFromAddressID " : " … " ,
" Specs " : [
{
" SpecID " : " … " ,
" OptionID " : " … " ,
" Value " : " … "
}
] ,
" xp " : null
}
Create or Update Line Item
OrderCloud . LineItems . Update ( orderID , lineItemID , lineItem ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Request Body Sample
{
" ID " : " … " ,
" ProductID " : " … " ,
" Quantity " : 0 ,
" UnitPrice " : null ,
" CostCenter " : " … " ,
" DateNeeded " : null ,
" ShippingAccount " : " … " ,
" ShippingAddressID " : " … " ,
" ShipFromAddressID " : " … " ,
" Specs " : [
{
" SpecID " : " … " ,
" OptionID " : " … " ,
" Value " : " … "
}
] ,
" xp " : null
}
Delete Line Item
OrderCloud . LineItems . Delete ( orderID , lineItemID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Partially Update Line Item
OrderCloud . LineItems . Patch ( orderID , lineItemID , partialLineItem ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Request Body Sample
{
" ID " : " … " ,
" ProductID " : " … " ,
" Quantity " : 0 ,
" UnitPrice " : null ,
" CostCenter " : " … " ,
" DateNeeded " : null ,
" ShippingAccount " : " … " ,
" ShippingAddressID " : " … " ,
" ShipFromAddressID " : " … " ,
" Specs " : [
{
" SpecID " : " … " ,
" OptionID " : " … " ,
" Value " : " … "
}
] ,
" xp " : null
}
Set Shipping Address
OrderCloud . LineItems . SetShippingAddress ( orderID , lineItemID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Patch Shipping Address
OrderCloud . LineItems . PatchShippingAddress ( orderID , lineItemID , partialAddress ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Payments
angular . module ( ' orderCloud.sdk).factory(Payments, PaymentsFactory)
Get a Single Payment
OrderCloud . Payments . Get ( orderID , paymentID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
Response Body Sample
{
" ID " : " … " ,
" Type " : " PurchaseOrder " ,
" DateCreated " : " 0001-01-01T00:00:00+00:00 " ,
" CreditCardID " : " … " ,
" SpendingAccountID " : " … " ,
" Description " : " … " ,
" Amount " : null ,
" xp " : null ,
" Transactions " : [
{
" ID " : " … " ,
" Type " : " … " ,
" DateExecuted " : " 0001-01-01T00:00:00+00:00 " ,
" Amount " : null ,
" Succeeded " : false ,
" ResultCode " : " … " ,
" ResultMessage " : " … " ,
" xp " : null
}
]
}
Get a List of Payments
OrderCloud . Payments . List ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Type " : " PurchaseOrder " ,
" DateCreated " : " 0001-01-01T00:00:00+00:00 " ,
" CreditCardID " : " … " ,
" SpendingAccountID " : " … " ,
" Description " : " … " ,
" Amount " : null ,
" xp " : null ,
" Transactions " : [
{
" ID " : " … " ,
" Type " : " … " ,
" DateExecuted " : " 0001-01-01T00:00:00+00:00 " ,
" Amount " : null ,
" Succeeded " : false ,
" ResultCode " : " … " ,
" ResultMessage " : " … " ,
" xp " : null
}
]
}
]
}
Create New Payment
OrderCloud . Payments . Create ( orderID , payment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
Request Body Sample
{
" ID " : " … " ,
" Type " : " PurchaseOrder " ,
" CreditCardID " : " … " ,
" SpendingAccountID " : " … " ,
" Description " : " … " ,
" Amount " : null ,
" xp " : null
}
Create or Update Payment
OrderCloud . Payments . Update ( orderID , paymentID , payment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
Request Body Sample
{
" ID " : " … " ,
" Type " : " PurchaseOrder " ,
" CreditCardID " : " … " ,
" SpendingAccountID " : " … " ,
" Description " : " … " ,
" Amount " : null ,
" xp " : null
}
Delete Payment
OrderCloud . Payments . Delete ( orderID , paymentID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
Partially Update Payment
OrderCloud . Payments . Patch ( orderID , paymentID , partialPayment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
Request Body Sample
{
" ID " : " … " ,
" Type " : " PurchaseOrder " ,
" CreditCardID " : " … " ,
" SpendingAccountID " : " … " ,
" Description " : " … " ,
" Amount " : null ,
" xp " : null
}
Create Transaction
OrderCloud . Payments . CreateTransaction ( orderID , paymentID , transaction ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
Request Body Sample
{
" ID " : " … " ,
" Type " : " … " ,
" DateExecuted " : " 0001-01-01T00:00:00+00:00 " ,
" Amount " : null ,
" Succeeded " : false ,
" ResultCode " : " … " ,
" ResultMessage " : " … " ,
" xp " : null
}
Update Transaction
OrderCloud . Payments . UpdateTransaction ( orderID , paymentID , transactionID , transaction ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
transactionID
string
ID of the transaction.
Request Body Sample
{
" ID " : " … " ,
" Type " : " … " ,
" DateExecuted " : " 0001-01-01T00:00:00+00:00 " ,
" Amount " : null ,
" Succeeded " : false ,
" ResultCode " : " … " ,
" ResultMessage " : " … " ,
" xp " : null
}
Patch Transaction
OrderCloud . Payments . PatchTransaction ( orderID , paymentID , transactionID , partialTransaction ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
transactionID
string
ID of the transaction.
Request Body Sample
{
" ID " : " … " ,
" Type " : " … " ,
" DateExecuted " : " 0001-01-01T00:00:00+00:00 " ,
" Amount " : null ,
" Succeeded " : false ,
" ResultCode " : " … " ,
" ResultMessage " : " … " ,
" xp " : null
}
Delete Transaction
OrderCloud . Payments . DeleteTransaction ( orderID , paymentID , transactionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
paymentID
string
ID of the payment.
transactionID
string
ID of the transaction.
Shipments
angular . module ( ' orderCloud.sdk).factory(Shipments, ShipmentsFactory)
A Shipment is a grouping of one or more Line Items from one or more Orders that is physically packaged and delivered to the Buyer as a single unit. It is typically created by the Seller after the Order is submitted as part of the fulfillment process.
Get a Single Shipment
OrderCloud . Shipments . Get ( shipmentID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
Response Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Get a List of Shipments
OrderCloud . Shipments . List ( orderID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
orderID
string
ID of the order.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
]
}
Create New Shipment
OrderCloud . Shipments . Create ( shipment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Create or Update Shipment
OrderCloud . Shipments . Update ( shipmentID , shipment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
Request Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Delete Shipment
OrderCloud . Shipments . Delete ( shipmentID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
Partially Update Shipment
OrderCloud . Shipments . Patch ( shipmentID , shipment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
Request Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Save Item
OrderCloud . Shipments . SaveItem ( shipmentID , item ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
Request Body Sample
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
Delete Item
OrderCloud . Shipments . DeleteItem ( shipmentID , orderID , lineItemID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
shipmentID
string
ID of the shipment.
orderID
string
ID of the order.
lineItemID
string
ID of the line item.
Response Body Sample
{
" ID " : " … " ,
" Shipper " : " … " ,
" DateShipped " : null ,
" DateDelivered " : null ,
" TrackingNumber " : " … " ,
" Cost " : null ,
" Items " : [
{
" OrderID " : " … " ,
" LineItemID " : " … " ,
" QuantityShipped " : 0
}
] ,
" xp " : null
}
Buyers
angular . module ( ' orderCloud.sdk).factory(Buyers, BuyersFactory)
Buyers, or customers, are the organizations that view the categories and products and place orders.
Get a Single Buyer
OrderCloud . Buyers . Get ( ) . then ( successFn ) . catch ( errorFn ) ;
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" DefaultCatalogID " : " … " ,
" Active " : false ,
" xp " : null
}
Get a List of Buyers
OrderCloud . Buyers . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" DefaultCatalogID " : " … " ,
" Active " : false ,
" xp " : null
}
]
}
Create New Buyer
OrderCloud . Buyers . Create ( company ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" DefaultCatalogID " : " … " ,
" Active " : false ,
" xp " : null
}
Create or Update Buyer
OrderCloud . Buyers . Update ( company ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" DefaultCatalogID " : " … " ,
" Active " : false ,
" xp " : null
}
Delete Buyer
OrderCloud . Buyers . Delete ( ) . then ( successFn ) . catch ( errorFn ) ;
Partially Update Buyer
OrderCloud . Buyers . Patch ( company ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" DefaultCatalogID " : " … " ,
" Active " : false ,
" xp " : null
}
AdminUsers
angular . module ( ' orderCloud.sdk).factory(AdminUsers, AdminUsersFactory)
Users on an Organization level are users that have administrative access to things like adding users, creating catalogs, processing orders or creating products. These users are not specific to a buyer company.
Get a Single Admin User
OrderCloud . AdminUsers . Get ( userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Response Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
Get a List of Admin Users
OrderCloud . AdminUsers . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
]
}
Create New Admin User
OrderCloud . AdminUsers . Create ( user ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Create or Update Admin User
OrderCloud . AdminUsers . Update ( userID , user ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Delete Admin User
OrderCloud . AdminUsers . Delete ( userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Partially Update Admin User
OrderCloud . AdminUsers . Patch ( userID , user ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Catalogs
angular . module ( ' orderCloud.sdk).factory(Catalogs, CatalogsFactory)
A Catalog represents a group of categories used to group and place content for a specific audience. All buyers are issued and assigned a default catalog upon creation. Catalogs can be shared between buyers using assignments.
Get a Single Catalog
OrderCloud . Catalogs . Get ( catalogID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" CategoryCount " : 0 ,
" xp " : null
}
Get a List of Catalogs
OrderCloud . Catalogs . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" CategoryCount " : 0 ,
" xp " : null
}
]
}
Create New Catalog
OrderCloud . Catalogs . Create ( catalog ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Create or Update Catalog
OrderCloud . Catalogs . Update ( catalogID , catalog ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Delete Catalog
OrderCloud . Catalogs . Delete ( catalogID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Partially Update Catalog
OrderCloud . Catalogs . Patch ( catalogID , partialCatalog ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
List Assignments
OrderCloud . Catalogs . ListAssignments ( catalogID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" CatalogID " : " … " ,
" BuyerID " : " … "
}
]
}
Save Assignment
OrderCloud . Catalogs . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" CatalogID " : " … " ,
" BuyerID " : " … "
}
Delete Assignment
OrderCloud . Catalogs . DeleteAssignment ( catalogID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Categories
angular . module ( ' orderCloud.sdk).factory(Categories, CategoriesFactory)
Categories are used within a catalog to group and place content for a specific audience. Content can be in the form of another category, nested categories, products or HTML.
Get a Single Category
OrderCloud . Categories . Get ( catalogID , categoryID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … " ,
" ChildCount " : 0
}
Get a List of Categories
OrderCloud . Categories . List ( catalogID , listArgs , depth ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
depth
string
Depth of the category.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … " ,
" ChildCount " : 0
}
]
}
Create New Category
OrderCloud . Categories . Create ( catalogID , category ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … "
}
Create or Update Category
OrderCloud . Categories . Update ( catalogID , categoryID , category ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … "
}
Delete Category
OrderCloud . Categories . Delete ( catalogID , categoryID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
Partially Update Category
OrderCloud . Categories . Patch ( catalogID , categoryID , category ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null ,
" ListOrder " : 1 ,
" Active " : false ,
" ParentID " : " … "
}
List Assignments
OrderCloud . Categories . ListAssignments ( catalogID , categoryID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the category.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" CategoryID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Delete Assignment
OrderCloud . Categories . DeleteAssignment ( catalogID , categoryID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Save Assignment
OrderCloud . Categories . SaveAssignment ( catalogID , categoryAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Request Body Sample
{
" CategoryID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
List Product Assignments
OrderCloud . Categories . ListProductAssignments ( catalogID , categoryID , productID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
productID
string
ID of the product.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" CategoryID " : " … " ,
" ProductID " : " … " ,
" ListOrder " : null
}
]
}
Save Product Assignment
OrderCloud . Categories . SaveProductAssignment ( catalogID , productAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
Request Body Sample
{
" CategoryID " : " … " ,
" ProductID " : " … " ,
" ListOrder " : null
}
Delete Product Assignment
OrderCloud . Categories . DeleteProductAssignment ( catalogID , categoryID , productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
catalogID
string
ID of the catalog.
categoryID
string
ID of the category.
productID
string
ID of the product.
Specs
angular . module ( ' orderCloud.sdk).factory(Specs, SpecsFactory)
Specs are used to capture user input when adding a Product to an Order. At its simplest, a spec is a name/value pair. A spec value may have a price markup or markdown associated with it. In more advanced scenarios, specs can drive the product SKU. For example, a product may be available in 3 colors and 3 sizes and therefore have a total of 9 SKUs. The OrderCloud platform will choose the correct SKU based on the user-selected color and size specs .
Get a Single Spec
OrderCloud . Specs . Get ( specID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
Response Body Sample
{
" OptionCount " : 0 ,
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
Get a List of Specs
OrderCloud . Specs . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" OptionCount " : 0 ,
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
]
}
Create New Spec
OrderCloud . Specs . Create ( spec ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
Create or Update Spec
OrderCloud . Specs . Update ( specID , spec ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
Request Body Sample
{
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
Delete Spec
OrderCloud . Specs . Delete ( specID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
Partially Update Spec
OrderCloud . Specs . Patch ( specID , spec ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
Request Body Sample
{
" ID " : " … " ,
" ListOrder " : 0 ,
" Name " : " … " ,
" DefaultValue " : " … " ,
" Required " : false ,
" AllowOpenText " : false ,
" DefaultOptionID " : " … " ,
" DefinesVariant " : false ,
" xp " : null
}
List Product Assignments
OrderCloud . Specs . ListProductAssignments ( specID , productID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
productID
string
ID of the product.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" SpecID " : " … " ,
" ProductID " : " … " ,
" DefaultValue " : " … " ,
" DefaultOptionID " : " … "
}
]
}
Delete Product Assignment
OrderCloud . Specs . DeleteProductAssignment ( specID , productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
productID
string
ID of the product.
Save Product Assignment
OrderCloud . Specs . SaveProductAssignment ( productAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" SpecID " : " … " ,
" ProductID " : " … " ,
" DefaultValue " : " … " ,
" DefaultOptionID " : " … "
}
Create Option
OrderCloud . Specs . CreateOption ( specID , option ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
Request Body Sample
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
List Options
OrderCloud . Specs . ListOptions ( specID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
]
}
Update Option
OrderCloud . Specs . UpdateOption ( specID , optionID , option ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
optionID
string
ID of the option.
Request Body Sample
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
Patch Option
OrderCloud . Specs . PatchOption ( specID , optionID , option ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
optionID
string
ID of the option.
Request Body Sample
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
Get Option
OrderCloud . Specs . GetOption ( specID , optionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
optionID
string
ID of the option.
Response Body Sample
{
" ID " : " … " ,
" Value " : " … " ,
" ListOrder " : 0 ,
" IsOpenText " : false ,
" PriceMarkupType " : null ,
" PriceMarkup " : null ,
" xp " : null
}
Delete Option
OrderCloud . Specs . DeleteOption ( specID , optionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
specID
string
ID of the spec.
optionID
string
ID of the option.
Products
angular . module ( ' orderCloud.sdk).factory(Products, ProductsFactory)
A Product represents a physical, digital, or absract good that is offered for sale by a seller organization and is purchase-able by Buyer Users via an Order.
Products can be a static SKU or a version of a static SKU, known as a Variant. For example, a variant is often a size or color choice that drives a different product SKU.
Products may also have inventory associated with them and various inventory attributes like quantity available and re-order notifications.
Get a Single Product
OrderCloud . Products . Get ( productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" SpecCount " : 0 ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" VariantCount " : 0 ,
" ShipFromAddressID " : " … "
}
Get a List of Products
OrderCloud . Products . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" SpecCount " : 0 ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" VariantCount " : 0 ,
" ShipFromAddressID " : " … "
}
]
}
Create New Product
OrderCloud . Products . Create ( product ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" ShipFromAddressID " : " … "
}
Create or Update Product
OrderCloud . Products . Update ( productID , product ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" ShipFromAddressID " : " … "
}
Delete Product
OrderCloud . Products . Delete ( productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Partially Update Product
OrderCloud . Products . Patch ( productID , product ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" ShipFromAddressID " : " … "
}
Generate Variants
OrderCloud . Products . GenerateVariants ( productID , overwriteExisting ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
overwriteExisting
boolean
Overwrite existing of the product.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" QuantityMultiplier " : 0 ,
" ShipWeight " : null ,
" ShipHeight " : null ,
" ShipWidth " : null ,
" ShipLength " : null ,
" Active " : false ,
" Type " : " Static " ,
" InventoryEnabled " : false ,
" InventoryNotificationPoint " : null ,
" VariantLevelInventory " : false ,
" SpecCount " : 0 ,
" xp " : null ,
" AllowOrderExceedInventory " : false ,
" InventoryVisible " : false ,
" VariantCount " : 0 ,
" ShipFromAddressID " : " … "
}
List Variants
OrderCloud . Products . ListVariants ( productID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" Active " : false ,
" xp " : null
}
]
}
Update Variant
OrderCloud . Products . UpdateVariant ( productID , variantID , variant ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
variantID
string
ID of the variant.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" Active " : false ,
" xp " : null
}
Patch Variant
OrderCloud . Products . PatchVariant ( productID , variantID , variant ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
variantID
string
ID of the variant.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" Active " : false ,
" xp " : null
}
Get Variant
OrderCloud . Products . GetVariant ( productID , variantID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
variantID
string
ID of the variant.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" Active " : false ,
" xp " : null
}
List Variant Inventory
OrderCloud . Products . ListVariantInventory ( productID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
]
}
Get Variant Inventory
OrderCloud . Products . GetVariantInventory ( productID , variantID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
variantID
string
ID of the variant.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
Update Variant Inventory
OrderCloud . Products . UpdateVariantInventory ( productID , variantID , inventory ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
variantID
string
ID of the variant.
inventory
integer
Inventory of the product.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
List Inventory
OrderCloud . Products . ListInventory ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
]
}
Get Inventory
OrderCloud . Products . GetInventory ( productID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
Update Inventory
OrderCloud . Products . UpdateInventory ( productID , inventory ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
inventory
integer
Inventory of the product.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Available " : null ,
" Reserved " : null ,
" LastUpdated " : null
}
Save Assignment
OrderCloud . Products . SaveAssignment ( productAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ProductID " : " … " ,
" PriceScheduleID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
List Assignments
OrderCloud . Products . ListAssignments ( productID , userID , userGroupID , level , priceScheduleID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the product.
priceScheduleID
string
ID of the price schedule.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ProductID " : " … " ,
" PriceScheduleID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Delete Assignment
OrderCloud . Products . DeleteAssignment ( productID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
productID
string
ID of the product.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
PriceSchedules
angular . module ( ' orderCloud.sdk).factory(PriceSchedules, PriceSchedulesFactory)
Price schedules allow the same product to be sold across multiple channels. A price schedule may include quantity price breaks, min and max quantity per order, whether to apply tax or shipping calculations, or to what type of order the price schedule applies.
Get a Single Price Schedule
OrderCloud . PriceSchedules . Get ( priceScheduleID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
}
Get a List of Price Schedules
OrderCloud . PriceSchedules . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MinQuantity " : null ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
}
]
}
Create New Price Schedule
OrderCloud . PriceSchedules . Create ( priceSchedule ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
}
Create or Update Price Schedule
OrderCloud . PriceSchedules . Update ( priceScheduleID , priceSchedule ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
}
Delete Price Schedule
OrderCloud . PriceSchedules . Delete ( priceScheduleID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
Partially Update Price Schedule
OrderCloud . PriceSchedules . Patch ( priceScheduleID , priceSchedule ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" ApplyTax " : false ,
" ApplyShipping " : false ,
" MaxQuantity " : null ,
" UseCumulativeQuantity " : false ,
" RestrictedQuantity " : false ,
" OrderType " : " Standard " ,
" PriceBreaks " : [
{
" Quantity " : 0 ,
" Price " : 0.0
}
] ,
" xp " : null
}
Save Price Break
OrderCloud . PriceSchedules . SavePriceBreak ( priceScheduleID , priceBreak ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
Request Body Sample
{
" Quantity " : 0 ,
" Price " : 0.0
}
Delete Price Break
OrderCloud . PriceSchedules . DeletePriceBreak ( priceScheduleID , quantity ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
priceScheduleID
string
ID of the price schedule.
quantity
integer
Quantity of the price schedule.
Promotions
angular . module ( ' orderCloud.sdk).factory(Promotions, PromotionsFactory)
Promotions are used to reduce the cost of a line item or an order. Promotions can have redemption rules that can be applied for available dates, occurences and value.
Promotions can be assigned to Products, Categories, Buyers, UserGroups and Users for redemption.
Get a Single Promotion
OrderCloud . Promotions . Get ( promotionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
Response Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
Get a List of Promotions
OrderCloud . Promotions . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" RedemptionCount " : 0 ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
]
}
Create New Promotion
OrderCloud . Promotions . Create ( promo ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
Create or Update Promotion
OrderCloud . Promotions . Update ( promotionID , promo ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
Request Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
Delete Promotion
OrderCloud . Promotions . Delete ( promotionID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
Partially Update Promotion
OrderCloud . Promotions . Patch ( promotionID , partialPromotion ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
Request Body Sample
{
" ID " : " … " ,
" Code " : " … " ,
" Name " : " … " ,
" RedemptionLimit " : null ,
" RedemptionLimitPerUser " : null ,
" Description " : " … " ,
" FinePrint " : " … " ,
" StartDate " : null ,
" ExpirationDate " : null ,
" EligibleExpression " : " … " ,
" ValueExpression " : " … " ,
" CanCombine " : false ,
" xp " : null
}
List Assignments
OrderCloud . Promotions . ListAssignments ( promotionID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the promotion.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" PromotionID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Save Assignment
OrderCloud . Promotions . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" PromotionID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
Delete Assignment
OrderCloud . Promotions . DeleteAssignment ( promotionID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
promotionID
string
ID of the promotion.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
AdminAddresses
angular . module ( ' orderCloud.sdk).factory(AdminAddresses, AdminAddressesFactory)
Get a Single Admin Address
OrderCloud . AdminAddresses . Get ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Response Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Get a List of Admin Addresses
OrderCloud . AdminAddresses . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
]
}
Create New Admin Address
OrderCloud . AdminAddresses . Create ( address ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Create or Update Admin Address
OrderCloud . AdminAddresses . Update ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Delete Admin Address
OrderCloud . AdminAddresses . Delete ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Partially Update Admin Address
OrderCloud . AdminAddresses . Patch ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
AdminUserGroups
angular . module ( ' orderCloud.sdk).factory(AdminUserGroups, AdminUserGroupsFactory)
Get a Single Admin User Group
OrderCloud . AdminUserGroups . Get ( userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Get a List of Admin User Groups
OrderCloud . AdminUserGroups . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
]
}
Create New Admin User Group
OrderCloud . AdminUserGroups . Create ( group ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Create or Update Admin User Group
OrderCloud . AdminUserGroups . Update ( userGroupID , group ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Delete Admin User Group
OrderCloud . AdminUserGroups . Delete ( userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Partially Update Admin User Group
OrderCloud . AdminUserGroups . Patch ( userGroupID , group ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
List User Assignments
OrderCloud . AdminUserGroups . ListUserAssignments ( userGroupID , userID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
userID
string
ID of the user.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" UserGroupID " : " … " ,
" UserID " : " … "
}
]
}
Delete User Assignment
OrderCloud . AdminUserGroups . DeleteUserAssignment ( userGroupID , userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
userID
string
ID of the user.
Save User Assignment
OrderCloud . AdminUserGroups . SaveUserAssignment ( userGroupAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" UserGroupID " : " … " ,
" UserID " : " … "
}
MesageSenders
angular . module ( ' orderCloud.sdk).factory(MesageSenders, MesageSendersFactory)
Get a Single Message Sender
OrderCloud . MesageSenders . Get ( messageSenderID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
messageSenderID
string
ID of the message sender.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" MessageTypes " : [
" OrderDeclined "
]
}
Get a List of Message Senders
OrderCloud . MesageSenders . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" MessageTypes " : [
" OrderDeclined "
]
}
]
}
List Assignments
OrderCloud . MesageSenders . ListAssignments ( messageSenderID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
messageSenderID
string
ID of the message sender.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the message sender.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" MessageSenderID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" MessageConfigName " : " … "
}
]
}
Delete Assignment
OrderCloud . MesageSenders . DeleteAssignment ( messageSenderID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
messageSenderID
string
ID of the message sender.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Save Assignment
OrderCloud . MesageSenders . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" MessageSenderID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
List CC Listener Assignments
OrderCloud . MesageSenders . ListCCListenerAssignments ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" MessageSenderAssignment " : {
" MessageSenderID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" MessageConfigName " : " … "
} ,
" MessageConfigName " : " … " ,
" MessageType " : " OrderDeclined " ,
" BuyerID " : " … " ,
" UserGroupID " : " … " ,
" UserID " : " … "
}
]
}
Save CC Listener Assignment
OrderCloud . MesageSenders . SaveCCListenerAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" MessageSenderAssignment " : {
" MessageSenderID " : " … " ,
" BuyerID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
} ,
" MessageType " : " OrderDeclined " ,
" BuyerID " : " … " ,
" UserGroupID " : " … " ,
" UserID " : " … "
}
Users
angular . module ( ' orderCloud.sdk).factory(Users, UsersFactory)
A user is a person with access to the application. The properties of a user define who they are and what they are able to do with their login to the application.
Get a Single User
OrderCloud . Users . Get ( userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Response Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
Get a List of Users
OrderCloud . Users . List ( userGroupID , listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Username " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null ,
" AvailableRoles " : [
" … "
]
}
]
}
Create New User
OrderCloud . Users . Create ( user ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Create or Update User
OrderCloud . Users . Update ( userID , user ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Delete User
OrderCloud . Users . Delete ( userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Partially Update User
OrderCloud . Users . Patch ( userID , user ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Request Body Sample
{
" ID " : " … " ,
" Username " : " … " ,
" Password " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Email " : " … " ,
" Phone " : " … " ,
" TermsAccepted " : null ,
" Active " : false ,
" xp " : null
}
Get Access Token
OrderCloud . Users . GetAccessToken ( userID , tokenRequest ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userID
string
ID of the user.
Request Body Sample
{
" ClientID " : " … " ,
" Claims " : [
" DevCenterImpersonate "
]
}
UserGroups
angular . module ( ' orderCloud.sdk).factory(UserGroups, UserGroupsFactory)
User Groups are used to streamline the management of users within an application. By placing like users in groups, you can filter content, define order management rules, and manage changes much more easily than trying to account for individual users.
Get a Single User Group
OrderCloud . UserGroups . Get ( userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Get a List of User Groups
OrderCloud . UserGroups . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
]
}
Create New User Group
OrderCloud . UserGroups . Create ( group ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Create or Update User Group
OrderCloud . UserGroups . Update ( userGroupID , group ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Delete User Group
OrderCloud . UserGroups . Delete ( userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Partially Update User Group
OrderCloud . UserGroups . Patch ( userGroupID , group ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
List User Assignments
OrderCloud . UserGroups . ListUserAssignments ( userGroupID , userID , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
userID
string
ID of the user.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" UserGroupID " : " … " ,
" UserID " : " … "
}
]
}
Delete User Assignment
OrderCloud . UserGroups . DeleteUserAssignment ( userGroupID , userID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
userGroupID
string
ID of the user group.
userID
string
ID of the user.
Save User Assignment
OrderCloud . UserGroups . SaveUserAssignment ( userGroupAssignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" UserGroupID " : " … " ,
" UserID " : " … "
}
Addresses
angular . module ( ' orderCloud.sdk).factory(Addresses, AddressesFactory)
Addresses are used for the purposes of billing and shipping an order. An address may belong to a list that can be shared among many users if appropriate.
Get a Single Address
OrderCloud . Addresses . Get ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Response Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Get a List of Addresses
OrderCloud . Addresses . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
]
}
Create New Address
OrderCloud . Addresses . Create ( address ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Create or Update Address
OrderCloud . Addresses . Update ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
Delete Address
OrderCloud . Addresses . Delete ( addressID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Partially Update Address
OrderCloud . Addresses . Patch ( addressID , address ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
Request Body Sample
{
" ID " : " … " ,
" CompanyName " : " … " ,
" FirstName " : " … " ,
" LastName " : " … " ,
" Street1 " : " … " ,
" Street2 " : " … " ,
" City " : " … " ,
" State " : " … " ,
" Zip " : " … " ,
" Country " : " … " ,
" Phone " : " … " ,
" AddressName " : " … " ,
" xp " : null
}
List Assignments
OrderCloud . Addresses . ListAssignments ( addressID , userID , userGroupID , level , isShipping , isBilling , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the address.
isShipping
boolean
Is shipping of the address.
isBilling
boolean
Is billing of the address.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" AddressID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" IsShipping " : false ,
" IsBilling " : false
}
]
}
Delete Assignment
OrderCloud . Addresses . DeleteAssignment ( addressID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
addressID
string
ID of the address.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Save Assignment
OrderCloud . Addresses . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" AddressID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" IsShipping " : false ,
" IsBilling " : false
}
SpendingAccounts
angular . module ( ' orderCloud.sdk).factory(SpendingAccounts, SpendingAccountsFactory)
Spending Accounts are funds given to users by a managing entity and are managed as part of a user's account. These funds are generally used as "corporate dollars", "rewards dollars", or "gift cards".
They can be used to pay for all of or part of an order with parameters that control account expiration, balance available, balance renewal, user access and overdraft.
Multiple spending accounts can be assigned to a member of an organization and applied to all transactions, but only one can be used as a payment method.
When multiple Spending Accounts are used on a transaction each is deducted individually.
Get a Single Spending Account
OrderCloud . SpendingAccounts . Get ( spendingAccountID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
Get a List of Spending Accounts
OrderCloud . SpendingAccounts . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
]
}
Create New Spending Account
OrderCloud . SpendingAccounts . Create ( spendingAccount ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
Create or Update Spending Account
OrderCloud . SpendingAccounts . Update ( spendingAccountID , spendingAccount ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
Delete Spending Account
OrderCloud . SpendingAccounts . Delete ( spendingAccountID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
Partially Update Spending Account
OrderCloud . SpendingAccounts . Patch ( spendingAccountID , spendingAccount ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Balance " : 0.0 ,
" AllowAsPaymentMethod " : false ,
" RedemptionCode " : " … " ,
" StartDate " : null ,
" EndDate " : null ,
" xp " : null
}
List Assignments
OrderCloud . SpendingAccounts . ListAssignments ( spendingAccountID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the spending account.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" SpendingAccountID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" AllowExceed " : false
}
]
}
Save Assignment
OrderCloud . SpendingAccounts . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" SpendingAccountID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … " ,
" AllowExceed " : false
}
Delete Assignment
OrderCloud . SpendingAccounts . DeleteAssignment ( spendingAccountID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
spendingAccountID
string
ID of the spending account.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
CostCenters
angular . module ( ' orderCloud.sdk).factory(CostCenters, CostCentersFactory)
A cost center is used to allocate organizational expenditures. Different businesses call these by different names such as "allocation codes" or "charge back codes", but the basic purpose is the same - to allocate an expense back to someone or some department of an organization.
Get a Single Cost Center
OrderCloud . CostCenters . Get ( costCenterID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Get a List of Cost Centers
OrderCloud . CostCenters . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
]
}
Create New Cost Center
OrderCloud . CostCenters . Create ( costCenter ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Create or Update Cost Center
OrderCloud . CostCenters . Update ( costCenterID , costCenter ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
Delete Cost Center
OrderCloud . CostCenters . Delete ( costCenterID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
Partially Update Cost Center
OrderCloud . CostCenters . Patch ( costCenterID , costCenter ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" xp " : null
}
List Assignments
OrderCloud . CostCenters . ListAssignments ( costCenterID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the cost center.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" CostCenterID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Delete Assignment
OrderCloud . CostCenters . DeleteAssignment ( costCenterID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
costCenterID
string
ID of the cost center.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Save Assignment
OrderCloud . CostCenters . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" CostCenterID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
ApprovalRules
angular . module ( ' orderCloud.sdk).factory(ApprovalRules, ApprovalRulesFactory)
Approval rules are used to verify the integrity of an order. Common examples include orders requiring managerial approval, approval for orders that contain a specific product category, approval for quantity thresholds or approval for orders that exceed a specific price. Properties are also available to control the triggers and timing for processing approvals whether parallel to another rule, or in succession of a previous rule.
Get a Single Approval Rule
OrderCloud . ApprovalRules . Get ( approvalRuleID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
approvalRuleID
string
ID of the approval rule.
Response Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" ApprovingGroupID " : " … " ,
" RuleExpression " : " … " ,
" Scope " : " PerOrder " ,
" ScopeTimeUnit " : null ,
" ScopeTimeNumber " : null ,
" ScopeStartDate " : null ,
" ExpireAfterTimeUnit " : null ,
" ExpireAfterNumber " : null ,
" ApproveOnExpire " : false ,
" xp " : null
}
Get a List of Approval Rules
OrderCloud . ApprovalRules . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" ApprovingGroupID " : " … " ,
" RuleExpression " : " … " ,
" Scope " : " PerOrder " ,
" ScopeTimeUnit " : null ,
" ScopeTimeNumber " : null ,
" ScopeStartDate " : null ,
" ExpireAfterTimeUnit " : null ,
" ExpireAfterNumber " : null ,
" ApproveOnExpire " : false ,
" xp " : null
}
]
}
Create New Approval Rule
OrderCloud . ApprovalRules . Create ( approvalRule ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" ApprovingGroupID " : " … " ,
" RuleExpression " : " … " ,
" Scope " : " PerOrder " ,
" ScopeTimeUnit " : null ,
" ScopeTimeNumber " : null ,
" ScopeStartDate " : null ,
" ExpireAfterTimeUnit " : null ,
" ExpireAfterNumber " : null ,
" ApproveOnExpire " : false ,
" xp " : null
}
Create or Update Approval Rule
OrderCloud . ApprovalRules . Update ( approvalRuleID , approvalRule ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
approvalRuleID
string
ID of the approval rule.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" ApprovingGroupID " : " … " ,
" RuleExpression " : " … " ,
" Scope " : " PerOrder " ,
" ScopeTimeUnit " : null ,
" ScopeTimeNumber " : null ,
" ScopeStartDate " : null ,
" ExpireAfterTimeUnit " : null ,
" ExpireAfterNumber " : null ,
" ApproveOnExpire " : false ,
" xp " : null
}
Delete Approval Rule
OrderCloud . ApprovalRules . Delete ( approvalRuleID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
approvalRuleID
string
ID of the approval rule.
Partially Update Approval Rule
OrderCloud . ApprovalRules . Patch ( approvalRuleID , partialApprovalRule ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
approvalRuleID
string
ID of the approval rule.
Request Body Sample
{
" ID " : " … " ,
" Name " : " … " ,
" Description " : " … " ,
" ApprovingGroupID " : " … " ,
" RuleExpression " : " … " ,
" Scope " : " PerOrder " ,
" ScopeTimeUnit " : null ,
" ScopeTimeNumber " : null ,
" ScopeStartDate " : null ,
" ExpireAfterTimeUnit " : null ,
" ExpireAfterNumber " : null ,
" ApproveOnExpire " : false ,
" xp " : null
}
CreditCards
angular . module ( ' orderCloud.sdk).factory(CreditCards, CreditCardsFactory)
Credit cards are used as a payment method for an order. A user may have access to one or many credit cards for personal spend or group spending.
Credit Cards may be saved and assigned to members of an organization for use during purchase.
Get a Single Credit Card
OrderCloud . CreditCards . Get ( creditCardID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
Response Body Sample
{
" ID " : " … " ,
" Token " : " … " ,
" DateCreated " : null ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Get a List of Credit Cards
OrderCloud . CreditCards . List ( listArgs ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
search
string
Word or phrase to search for.
searchOn
string
Comma-delimited list of fields to search on.
sortBy
string
Comma-delimited list of fields to sort by.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
filters
Any additional key/value pairs passed in the query string are interpretted as filters. Valid keys are top-level properties of the returned model or 'xp.???'
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" ID " : " … " ,
" Token " : " … " ,
" DateCreated " : null ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
]
}
Create New Credit Card
OrderCloud . CreditCards . Create ( card ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" ID " : " … " ,
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Create or Update Credit Card
OrderCloud . CreditCards . Update ( creditCardID , card ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
Request Body Sample
{
" ID " : " … " ,
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
Delete Credit Card
OrderCloud . CreditCards . Delete ( creditCardID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
Partially Update Credit Card
OrderCloud . CreditCards . Patch ( creditCardID , card ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
Request Body Sample
{
" ID " : " … " ,
" Token " : " … " ,
" CardType " : " … " ,
" PartialAccountNumber " : " … " ,
" CardholderName " : " … " ,
" ExpirationDate " : null ,
" xp " : null
}
List Assignments
OrderCloud . CreditCards . ListAssignments ( creditCardID , userID , userGroupID , level , page , pageSize ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
level
string
Level of the credit card.
page
integer
Page of results to return. Default: 1
pageSize
integer
Number of results to return per page. Default: 20, max: 100.
Response Body Sample
{
" Meta " : {
" Page " : 1 ,
" PageSize " : 20 ,
" TotalCount " : 25 ,
" TotalPages " : 2 ,
" ItemRange " : [
1 ,
20
]
} ,
" Items " : [
{
" CreditCardID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
]
}
Save Assignment
OrderCloud . CreditCards . SaveAssignment ( assignment ) . then ( successFn ) . catch ( errorFn ) ;
Request Body Sample
{
" CreditCardID " : " … " ,
" UserID " : " … " ,
" UserGroupID " : " … "
}
Delete Assignment
OrderCloud . CreditCards . DeleteAssignment ( creditCardID , userID , userGroupID ) . then ( successFn ) . catch ( errorFn ) ;
Parameters
Name
Type
Description
creditCardID
string
ID of the credit card.
userID
string
ID of the user.
userGroupID
string
ID of the user group.
Extending the OrderCloud Data Model
Many times, object(s) returned from the OrderCloud API require additional data points derived from the provided information in order to more easily and elegantly drive UI functionality. One simple example of this is to create a FullName property on User objects derived from the FirstName and LastName properties.
Similarly, another example would be to create a FullAddress property on an Address object by combining the AddressName, Street1, Street2, City, State, Zip, and Country properties. Additionally, functions can be extended onto data model objects in order to drive such AngularJS directives as ng-show, ng-if, etc.
When the $promise is returned from AngularJS' $resource factory, the OrderCloud-Angular-SDK will attempt to locate and inject an 'Extend' factory from your AngularJS application. If this factory exists and a method within the factory with the respective OrderCloud end point exists, you can proceed to extend the data model.
A list of available end points and a simple example are located below.
angular . module ( ' myApp ' , [ ] )
. factory ( ' Extend ' , extendFactory )
function extendFactory ( ) {
var service = {
Users : _users
} ;
function _users ( user ) {
user . FullName = user . FirstName + ' ' + user . LastName ;
}
return service ;
}