Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

commercecloud-ocapi-client

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commercecloud-ocapi-client

An ES6 JavaScript Client for Salesforce Open Commerce API

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
80
decreased by-29.82%
Maintainers
1
Weekly downloads
 
Created
Source

Salesforce Commerce Cloud OCAPI Client

_______________________________________________________________________________________________________________________________________________________

                                                            /                    /                                 ,             /   ,                 
----__----__---_--_---_--_----__---)__----__----__----__---/----__-----------__-/--------__----__----__------__------------__---/--------__----__--_/_-
  /   ' /   ) / /  ) / /  ) /___) /   ) /   ' /___) /   ' /   /   ) /   /  /   /       /   ) /   ' /   )   /   ) /       /   ' /   /   /___) /   ) /   
_(___ _(___/_/_/__/_/_/__/_(___ _/_____(___ _(___ _(___ _/___(___/_(___(__(___/_______(___/_(___ _(___(___/___/_/_______(___ _/___/___(___ _/___/_(_ __
                                                                                                         /                                             
                                                                                                        /                                              

NPM

CircleCI

Introduction

ShopApi - ES6 JavaScript client for Salesforce Commerce Cloud OCAPI Shop API.

  • API version: 17.8

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install commercecloud-ocapi-client --save
git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

import ShopApi from 'commercecloud-ocapi-client'

ShopApi.ApiClient.instance = new ShopApi.ApiClient({
    clientUsername: 'YOUR USERNAME', // Configure HTTP basic authorization: customers_auth
    clientPassword: 'YOUR PASSWORD', // Configure HTTP basic authorization: customers_auth
    oAuthAccessToken: '' // Configure OAuth2 access token for authorization: oauth2_application
})

const api = new ShopApi.BasketsApi()

const basketId = "basketId_example" // {String} the id of the basket to be retrieved

api.deleteBasketsByID(basketId)
    .then(() {
        console.log('API called successfully.')
    })
    .catch((fault) => {
        console.error(fault)
    })

Documentation for API Endpoints

Documentation for Authorization

client_id

  • Type: API key
  • API key parameter name: x-dw-client-id
  • Location: HTTP header

customers_auth

  • Type: HTTP basic authentication

oauth2_application

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes: N/A

FAQs

Package last updated on 06 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc