1.9.0 • Published 2 years ago

acenda v1.9.0

Weekly downloads
1
License
MIT
Repository
-
Last release
2 years ago

Description

Acenda Nodejs SDK library. Refer to API Docs to see full list of methods.

Installation

$ npm install acenda

or

$ yarn add acenda

Usage

import { Acenda } from 'acenda'

Create

const acenda = new Acenda('<store>', '<access_token>')
const response = await acenda.create('product', {})

Update

//12345 is id
const acenda = new Acenda('<store>', '<access_token>')
const response = await acenda.update('product','12345', {})

List

Optional parameter is very useful for complex queries

const acenda = new Acenda('<store>', '<access_token>')
const response = await acenda.list('order',`query={date_created:{$gte:'2020-04-28'}}`)

Pagination (optional)

const response = await acenda.list('order',query={date_created:{$gte:'2020-04-28'}},1,100)

Delete

//12345 is id
const acenda = new Acenda('<store>', '<access_token>')
const response = await acenda.delete('product', '12345')

Get

//26764 is id
const acenda = new Acenda('<store>', '<access_token>')
const response = await acenda.get('product', '26764')

Response

response.data
{
  code: 200,
  status: 'OK',
  execution_time: 0.10566782951355,
  num_total: 1,
  result: {
    id: 26764,
    group: 'product',
    status: 'active',
    slug: 'test-product',
    name: 'test product',
    collection_id: [],
    category_id: [],
    customer_group_id: [],
    popularity: 0,
    brand: '',
    type: '',
    tags: [],
    description: '',
    cross_sellers: [],
    review_score: 0,
    options: [ 'size' ],
    images: [],
    videos: [],
    dynamic_attributes: [],
    personalization_options: [],
    date_modified: '2020-01-28 09:16:11',
    date_created: '2020-01-28 07:10:47',
    title: 'test product',
    thumbnail: 'https://images.acenda-static.com/zuzu/product/thumbnail/250x250/1/default.jpg',
    url: '/product/test-product',
    category: null,
    taxjar_code: null,
    amazon_enabled: null,
    amazon_posting_template: null,
    collections: [],
    variants: [],
    categories: []
  }
}

Errors

  code: 401,
  status: 'Invalid access token',
  error: 'Invalid access token'
  code: 400,
  status: 'Bad Request',
  execution_time: 0.028566122055054,
  error: 'Specified query is invalid.'
  code: 403,
  status: 'Forbidden',
  execution_time: 0.028566122055054,
  error: 'Forbidden'
  code: 404,
  status: 'Not Found',
  execution_time: 0.028566122055054,
  error: 'Not Found'

Tip

Before you create or update a model, first list that model using "list" method. Then get a single record by using "get" method with one of the ids from the returned list. Use returned data as a reference to insert or update a record. Pay attention to matching field types.

1.8.0

2 years ago

1.9.0

2 years ago

1.7.0

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.10

3 years ago

1.5.9

3 years ago

1.5.8

3 years ago

1.5.7

3 years ago

1.5.6

3 years ago

1.5.5

3 years ago

1.5.4

3 years ago

1.5.3

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.2.0

4 years ago

1.3.7

4 years ago

1.3.6

4 years ago

1.3.5

4 years ago

1.3.4

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.3.10

4 years ago

1.3.13

4 years ago

1.3.14

4 years ago

1.3.11

4 years ago

1.3.12

4 years ago

1.3.9

4 years ago

1.3.8

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.5.1

4 years ago

0.3.8

4 years ago

0.4.0

4 years ago

0.3.7

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.2

4 years ago

0.1.0

4 years ago