---
schema_version: "1"
id: a3c61b5fcbe87fe76124b05de573d21e17727f538cbb914f9db0ae1c48f432cd
title: SDK Core Class Structure and Methods
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-t-sdk-core-class-structure-and-methods.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-t-sdk-core-class-structure-and-methods.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c902d88041b98340870c2e432017404388f3d1c1e001550e28a8248dbfdf6000
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# SDK Core Class Structure and Methods

The Software Development Kit (SDK) is used by developers to create applications that call the Digital Commerce APIs.

**Fall '20 Release**

The main class is VlocityDigitalCommerce, which has the following methods:

- [getOffers](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getoffers)()

  - Retrieve a list of offers

  - Maps to GetOffersByCatalog API (/v3/catalogs/{catalog_code}/offers) or, if the **contains** parameter is specified, maps to the GetContainsProducts API (/v3/catalogs/{ catalog_code}/offers?contains={product_code})

- [getFilteredOffersList](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getfilteredofferslist)

  - Retrieves a filtered list of products and promotions.

- [getOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getoffer)()

  - Retrieves an offer with details

  - Maps to GetOfferDetails API (/v3/catalogs/{ catalog_code}/offers/{offer_code})

- [validateOffer](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#validateoffer)()

  - Validates an offer

  - Maps to Configure Offer API (/v3/catalogs/{ catalog_code}/offers/{offer_code})

  - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey in the request POST body. This complexity is handled inside the SDK; therefore the client only needs to call the SDK configureOfferDetails method once regardless of what the offerType is.

- [addToBasket](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#addtocart)()

  - maps to Basket API: (/v3/catalogs/{catalog_code}/basket)

  - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey inside the request Post body. This complexity is handled inside the SDK; therefore client only needs to call SDK addToBasket method once regardless of what the offerType is.

  - The basket is tracked using the cartContextKey in the URL; for an empty basket, there is no need to pass the cartContextKey. After the first call, cartContextKey is returned and the client must include this in all subsequent calls with cartContextKey in request Body. This complexity is handled and automated inside this SDK method.

- [updateItemsInCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#updateitemsincart)()

  - maps to Basket API: (/v3/catalogs/{catalog_code}/basket/{cart_context_key})

  - If the offer is of `offerType=Promotion`, then the client must get the transactionKey from the first response and then call the same API again with transactionKey inside the request Post body. This complexity is handled inside the SDK; therefore client only needs to call SDK addToBasket method once regardless of what the offerType is.

  - The basket is tracked using the cartContextKey in the URL; for an empty basket, there is no need to pass the cartContextKey. After the first call, cartContextKey is returned and the client must include this in all subsequent calls with cartContextKey in request Body. This complexity is handled and automated inside this SDK method.

- [checkoutCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#checkoutcart)()

  - Maps to the [Create Cart from Basket API](https://developer.salesforce.com/docs/industries/cme/guide/comms-t-create-cart-from-basket.md) (/v3/carts)

- [getPromotions](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#getpromotions)()

  - Maps to GetOffersByCatalog API: /v3/catalogs/{catalog_code}/offers

  - Returns promotions for all products or for an associated to product.

- [assetToBasket](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#assettobasket)()

  - Maps to Basket API: /v3/catalogs/{catalog_code}/basket/{asset_ID}

  - Create a basket from a given asset ID

- [authenticateUser](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#authenticateuser)()

  - Maps to SignIn API: {checkout_SDK_node_server_URL}/signIn

  - Maps to SignUp API: {checkout_SDK_node_server_URL}/signUp

  - Securely login to salesforce using checkout node server SDK

- [updateBillingDetails](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#updatebillingdetails)()

  - Maps to SignIn API: {checkout_SDK_node_server_URL}/updateDetails

  - Securely update shipping and billing address to the Salesforce user account.

- [saveCart](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#savecart)()

  - Maps to SignIn API: {checkout_SDK_node_server_URL}/createOrder

  - Securely save the cart by creating an Order.

- [submitOrder](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#submitorder)()

  - Maps to SignIn API: {checkout_SDK_node_server_URL}/submitOrder

  - Securely create and submit order for given accountId and cartContextKey

- [signOutUser](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/classes/_digitalcommerce_digitalcommerce_sdk_.digitalcommerce.html#signoutuser)

  - Signs out the user from the ServerSDK.

See the [SDK Reference](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/sdk/index.html) for more details.

For reference information about the Spring '20 SDK release, see [Digital Commerce Lightning Web Components (107.0)](https://sfdo-docs.s3.us-west-2.amazonaws.com/VlocityDevDoc/lwc107/lwc/107.0/index.html).
