You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We'll need to get a token before we can make any API calls. The SDK offers five different ways of getting a token as part of the [Auth class](https://ordercloud-api.github.io/ordercloud-javascript-sdk/classes/auth).
87
+
We'll need to get a token before we can make any API calls. The SDK offers five different ways of getting a token as part of the [Auth class](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/classes/auth).
The [`Configuration`](https://ordercloud-api.github.io/ordercloud-javascript-sdk/classes/configuration) service can be used to set sdk level [options](https://ordercloud-api.github.io/ordercloud-javascript-sdk/interfaces/sdkconfiguration).
201
+
The [`Configuration`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/classes/configuration) service can be used to set sdk level [options](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/interfaces/sdkconfiguration).
202
202
203
203
Simply set the options you need to override and the SDK will merge it with the default options object.
204
204
@@ -222,15 +222,15 @@ console.log(configuration); // the current sdk configuration
222
222
223
223
## Handling Errors 🐛
224
224
225
-
The SDK uses a custom error ([`OrderCloudError`](https://ordercloud-api.github.io/ordercloud-javascript-sdk/classes/orderclouderror)) to provide rich and useful information in the case of an error.
225
+
The SDK uses a custom error ([`OrderCloudError`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/classes/orderclouderror)) to provide rich and useful information in the case of an error.
226
226
227
227
```javascript
228
228
Products.Get('my-product')
229
229
.catch(error=> {
230
230
if(error.isOrderCloudError) {
231
231
// the request was made and the API responded with a status code
232
232
// that falls outside of the range of 2xx, the error will be of type OrderCloudError
@@ -337,7 +337,7 @@ While Typescript is not required to use this project (we compile it down to ES5
337
337
338
338
### Understanding OrderCloud's models
339
339
340
-
By default, properties of ordercloud models are required if their Create or Save operation requires them. For example the [`LineItem` model](https://ordercloud-api.github.io/ordercloud-javascript-sdk/interfaces/lineitem) has the properties `ProductID` and `Quantity` required. This is important to know if you need to define an object by type before using it.
340
+
By default, properties of ordercloud models are required if their Create or Save operation requires them. For example the [`LineItem` model](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/interfaces/lineitem) has the properties `ProductID` and `Quantity` required. This is important to know if you need to define an object by type before using it.
|[`ListPage<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk/interfaces/listpage)| Takes in a type for the item in the list. For example `ListPage<Order>` will be the type for an order list page. |
423
-
|[`ListPageWithFacets<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk/interfaces/listpagewithfacets)| Similar to `ListPage` but for [premium search](https://ordercloud.io/blog/introducing-premium-search) models. For example `ListPageWithFacets<Product>` will be the type for a product list page. |
424
-
|[`Searchable<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#searchable)| Takes in a [`SearchableEndpoint`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#searchableendpoint) and returns the type for a valid `searchOn` field on list calls. For example `Searchable<'Orders.List'>`. |
425
-
|[`Sortable<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#sortable)| Takes in a [`SortableEndpoint`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#sortableendpoint) and returns the type for a valid `sortBy` field on list calls. For example `Sortable<'Orders.List'>`. |
426
-
|[`Filters<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#filters)| Takes in an ordercloud model and returns the type for a valid `filter` field on list calls. For example `Filters<Product>`. This also works for any custom models that extend an OrderCloud model, for example `Filters<MyProduct>`. |
427
-
|[`PartialDeep<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#partialdeep)| Similar to Typescript's [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialt) except works on nested properties as well. |
428
-
|[`RequiredDeep<T>`](https://ordercloud-api.github.io/ordercloud-javascript-sdk#requireddeep)| Similar to Typescript's [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredt) except works on nested properties as well. |
429
-
|[`DecodedToken`](https://ordercloud-api.github.io/ordercloud-javascript-sdk/interfaces/decodedtoken)| A type representing a decoded OrderCloud token ||
422
+
|[`ListPage<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/interfaces/listpage)| Takes in a type for the item in the list. For example `ListPage<Order>` will be the type for an order list page. |
423
+
|[`ListPageWithFacets<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/interfaces/listpagewithfacets)| Similar to `ListPage` but for [premium search](https://ordercloud.io/blog/introducing-premium-search) models. For example `ListPageWithFacets<Product>` will be the type for a product list page. |
424
+
|[`Searchable<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#searchable)| Takes in a [`SearchableEndpoint`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#searchableendpoint) and returns the type for a valid `searchOn` field on list calls. For example `Searchable<'Orders.List'>`. |
425
+
|[`Sortable<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#sortable)| Takes in a [`SortableEndpoint`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#sortableendpoint) and returns the type for a valid `sortBy` field on list calls. For example `Sortable<'Orders.List'>`. |
426
+
|[`Filters<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#filters)| Takes in an ordercloud model and returns the type for a valid `filter` field on list calls. For example `Filters<Product>`. This also works for any custom models that extend an OrderCloud model, for example `Filters<MyProduct>`. |
427
+
|[`PartialDeep<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#partialdeep)| Similar to Typescript's [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialt) except works on nested properties as well. |
428
+
|[`RequiredDeep<T>`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK#requireddeep)| Similar to Typescript's [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredt) except works on nested properties as well. |
429
+
|[`DecodedToken`](https://ordercloud-api.github.io/OrderCloud-JavaScript-SDK/interfaces/decodedtoken)| A type representing a decoded OrderCloud token ||
0 commit comments