Skip to content

Commit

Permalink
docs: Add beneficiaries api methods to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
peoray committed Jan 26, 2024
1 parent ebdeae5 commit 45cb5ad
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ A Nodejs API wrapper for [Bloc](https://www.blochq.io/) banking services written
- [Webhook API](#webhook-api)
- [Set Webhook](#set-webhook)
- [Get Webhook](#get-webhook)
- [Beneficiaries API](#beneficiaries-api)
- [Create Beneficiary](#create-beneficiary)
- [Get Beneficiary by ID](#get-beneficiary-by-id)
- [Update Beneficiary](#update-beneficiary)
- [Delete beneficiary](#delete-beneficiary)
- [License](#license)

## Prerequisites
Expand Down Expand Up @@ -368,8 +373,65 @@ console.log(response) // IWebhookResponse

Find more details about the parameters and response for the above method [here](https://docs.blochq.io/reference/getwebhook)

### Beneficiaries API

Beneficiaries API operations

#### Create Beneficiary

```ts
// import the beneficiary interfaces from the sdk
import type { ICreateBeneficiary, IBeneficiaryResponse } from 'bloc-nodejs';

const payload: ICreateBeneficiary = {
// payload data
}

const response = await bloc.createBeneficiary(payload)
console.log(response) // IBeneficiaryResponse
```

Find more details about the parameters and response for the above method [here](https://docs.blochq.io/reference/createbeneficiary)

#### Get Beneficiary by ID

```ts
// import the beneficiary interfaces from the sdk
import type { IBeneficiaryResponse } from 'bloc-nodejs';

const response = await bloc.getBeneficiaryById('beneficiary-id')
console.log(response) // IBeneficiaryResponse
```

Find more details about the parameters and response for the above method [here](https://docs.blochq.io/reference/getbeneficiarybyid)

#### Update Beneficiary

```ts
// import the beneficiary interfaces from the sdk
import type { IUpdateBeneficiary, IBeneficiaryResponse } from 'bloc-nodejs';

const payload: ICreateBeneficiary = {
// payload data
}

const response = await bloc.updateBeneficiary('beneficiary-id', payload)
console.log(response) // IBeneficiaryResponse
```

Find more details about the parameters and response for the above method [here](https://docs.blochq.io/reference/updatebeneficiary)

#### Delete Beneficiary

```ts
const response = await bloc.deleteBeneficiary('beneficiary-id')
console.log(response) // any
```

Find more details about the parameters and response for the above method [here](https://docs.blochq.io/reference/deletebeneficiary)

## License

[MIT](https://github.com/peoray/bloc-nodejs/blob/main/LICENSE)
[MIT](./LICENSE)

[Back to Top](#table-of-content)

0 comments on commit 45cb5ad

Please sign in to comment.