# tenbis-api

Latest version **2.2.2** (published 2024-04-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install tenbis-api
pnpm add tenbis-api
yarn add tenbis-api
bun add tenbis-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2024-04-21 |
| First published | 2023-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 25.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | micaelillos |

## Links

- npm: https://www.npmjs.com/package/tenbis-api
- npm.io page: https://npm.io/package/tenbis-api

## Dependencies (3)

- [got](https://npm.io/package/got.md) ^11.0.0
- [axios](https://npm.io/package/axios.md) ^1.3.4
- [nodemon](https://npm.io/package/nodemon.md) ^2.0.22

## Recent versions

- 2.2.2 (latest) — 2024-04-21
- 2.2.1 — 2024-04-21
- 2.1.1 — 2023-11-20
- 2.1.0 — 2023-11-20
- 2.0.1 — 2023-11-17
- 2.0.0 — 2023-11-17
- 1.0.1 — 2023-05-03
- 1.0.0 — 2023-04-04

## README

# 10BIS API wrapper

<p align=center>
    <img src="https://www.10bis.co.il/Areas/G12/Content/Images/HomePage/GOV/GOV_TenBisLogo.png" width=250>
  <br>
  <img src="https://img.shields.io/badge/License-MIT-yellow.svg">
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg">
  <img src="https://img.shields.io/badge/10BIS-API-orange">
</p>

## Overview

This repo contains a fully functional typescript api wrapper to the 10bis api to be able to automate making 10bis orders.

## Get started

Install library

``` yarn add tenbis-api```

## Full Example Usage

```typescript
import api from 'tenbis-api'
const { getPayments, getTransactionReport, getUser, loadTenbisCredit } = './core'

// Example to load user credit with api
// More functionality is implemented - searching for restaurants, adding to cart, submiting orders
try {
    // Login with User Token
    const user = await getUser('***************')

    // Get User's id, address, token and current shopping cart id
    const { userId: assignedUserId, userToken } = user.Data
    const { refreshToken, authToken } = user
    const shoppingCartId = user.ShoppingCartGuid

    // Get moneycards
    const moneycards = await getPayments(shoppingCartId)
    console.log(moneycards)

    // load credit of remaining usage diff 50 shekels
    const transactionReport = await getTransactionReport(userToken)
    const usage = transactionReport.Data.moneycards[0].usage.daily
    await loadTenbisCredit(100 - usage, moneycards.Data[0].cardId)

} catch (e) {
    console.log(e.message)
}
```

---
_Source: https://npm.io/package/tenbis-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
