bukalapak-api icon indicating copy to clipboard operation
bukalapak-api copied to clipboard

🎁 Promise-based Javascript wrapper for Bukalapak API

bukalapak-api

🎁 Promise-based Javascript wrapper for Bukalapak API

Usage

const {authentication} = require('bukalapak-api')

const USER = {
  username: '[email protected]',
  password: 'hunter2'
}

async function logToken (user) {
  try {
    const { status, token, confirmed } = await authentication.getApiToken(user)
    console.log(token)
  } catch (error) {
    const {message} = error
    console.log(message)
  }
}

logToken(USER)

API

Authentication

Get API Token

  • getApiToken({ username: String, password: String })
Success Response
{
  "status"    : "OK",
  "user_id"   : "157324",
  "user_name" : "Sayur Kangkung",
  "confirmed" : true,
  "token"     : "U8Ch2LigkVhdI3XwYRA",
  "email"     : "[email protected]",
  "omnikey"   : "a15d3e8835c69f1c4fd6b38fe9098b4b",
  "message"   : null
}
Failure response
{
  "status"    : "ERROR",
  "user_id"   : null,
  "user_name" : null,
  "confirmed" : false,
  "token"     : null,
  "email"     : null,
  "omnikey"   : null,
  "message"   : "Username atau password tidak valid"
}

Facebook Login

  • facebookLogin({ facebookId: String, facebookToken: String })
Success Response
{
  "status": "OK",
  "user_id": "157324",
  "user_name": "Sayur Kangkung",
  "token": "U8Ch2LigkVhdI3XwYRA",
  "message": null
}
Failure response
{
    "status": "ERROR",
    "message": "User tidak ditemukan"
}

Google Login

  • googleLogin({ email: String, googleToken: String })
Success Response
{
  "status": "OK",
  "user_id": "157324",
  "user_name": "Sayur Kangkung",
  "token": "U8Ch2LigkVhdI3XwYRA",
  "message": null
}
Failure response
{
    "status": "ERROR",
    "message": "User tidak ditemukan"
}

Categories

(WIP)

Carts

(WIP)

Deals

(WIP)

Dompet

(WIP)

Errors

(WIP)

Favorites

(WIP)

Images

(WIP)

Additional Informations

(WIP)

Labels

(WIP)

Messages

(WIP)

Negotiations

(WIP)

Notifications

(WIP)

Products

(WIP)

Product Reviews

(WIP)

Pushes

(WIP)

SEO Pages

(WIP)

Shipping Fees

(WIP)

Subscriptions

(WIP)

Supports

(WIP)

Transactions

(WIP)

Users

(WIP)

(WIP)### User Addresses

Contributing

Looking for contributors! Feel free to open issues and create PR's. Lint your code using prettier.

License

MIT. See LICENSE.