2.10.1 • Published 2 years ago

rejoiner2 v2.10.1

Weekly downloads
22
License
MIT
Repository
github
Last release
2 years ago

Rejoiner2 Node.js client wrapper

Install

yarn add rejoiner2

or

npm install rejoiner2 --save

Use

var Rejoiner2 = require('rejoiner2')

var apiClient = new Rejoiner2({
  // Your seven character Rejoiner2 Site ID
  siteId: 'eXaMpLe',
  // Your account's 40 character API key
  apiKey: 'tHiSaPiKeYiSjUsTaNeXaMpLeAnDyOuCaNtUsEiT',
})

Ping

The ping endpoint can be used to verify your credentials are working.

apiClient.verify.ping()
  .then(...)
  .catch(...)

Customer Endpoints

Convert Customer

apiClient.customer.convert({
  email: 'test@example.com',
  cart_data: {
    cart_value: 20000,
    cart_item_count: 2,
    promo: 'COUPON_CODE',
    return_url: 'https://www.example.com/return_url',
    ...
  },
  cart_items: [
    {
      product_id: 'example',
      name: 'Example Product',
      price: 10000,
      description: 'Information about Example Product.',
      category: [
        'Example Category 1',
        'Example Category 2',
      ],
      item_qty: 1,
      qty_price: 10000,
      product_url: 'https://www.example.com/products/example',
      image_url: 'https://www.example.com/products/example/images/example.jpg',
      ...
    },
    {
      product_id: 'example2',
      name: 'Example Product 2',
      price: 10000,
      description: 'Information about Example Product 2.',
      category: [
        'Example Category 2',
        'Example Category 3',
      ],
      item_qty: 1,
      qty_price: 10000,
      product_url: 'https://www.example.com/products/example2',
      image_url: 'https://www.example.com/products/example2/images/example.jpg',
      ...
    },
    ...
  ],
})
  .then(...)
  .catch(...)

Journey Cancellation

apiClient.customer.cancel('test@example.com')
  .then(...)
  .catch(...)

Customer Unsubscribe

apiClient.customer.unsubscribe('test@example.com')
  .then(...)
  .catch(...)

Record Explicit Customer Consent

apiClient.customer.optIn('test@example.com')
  .then(...)
  .catch(...)

Email List Endpoints

Email Lists

apiClient.lists.get()
  .then(...)
  .catch(...)

Retrieving Listing of Contacts

apiClient.lists.contacts('eXaMpLeLiStId').get()
  .then(...)
  .catch(...)

With optional page number for pagination

apiClient.lists.contacts('eXaMpLeLiStId').get(2)
  .then(...)
  .catch(...)

Add Customer to List

apiClient.lists.contacts('eXaMpLeLiStId').add('test@example.com')
  .then(...)
  .catch(...)

Remove Customer From List

apiClient.lists.contacts('eXaMpLeLiStId').remove('test@example.com')
  .then(...)
  .catch(...)
2.10.1

2 years ago

2.10.0

2 years ago

2.9.1

4 years ago

2.8.1

4 years ago

2.8.0

4 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.3

5 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago