Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
.env.production
node_modules
coverage
*.jpeg
*.jpeg
.DS_Store
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 3.8.0

- Added `billing` module.
- Added `getUsage` function in `billing` module.

## 3.7.0

- Added support for generating Presigned Urls for Multipart Upload. See `createSignedUrlV2` in `assets` module.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 PixelBin
Copyright (c) 2024 PixelBin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
98 changes: 98 additions & 0 deletions documentation/platform/BILLING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
##### [Back to Pixelbin API docs](./README.md)

## Billing Methods

Payment Service

- [getUsage](#getusage)

## Methods with example and description

### getUsage

**Summary**: Get current usage of organization

```javascript
// Promise

const promise = billing.getUsage();

// Async/Await

const data = await billing.getUsage();
```

Get current usage of organization

_Returned Response:_

[CompleteUsageSchema](#completeusageschema)

Success

<details>
<summary><i>&nbsp; Example:</i></summary>

```json
{
"credits": {
"used": 1.0357297026862702
},
"total": {
"credits": 1000,
"storage": 1
},
"usage": {
"storage": "0"
}
}
```

</details>

---

### Schemas

#### NotFoundSchema

| Properties | Type | Nullable | Description |
| ---------- | ------ | -------- | ----------- |
| message | string | no | |

---

#### UsageSchema

| Properties | Type | Nullable | Description |
| ---------- | ------ | -------- | ----------- |
| storage | string | no | |

---

#### ConsumedCreditsSchema

| Properties | Type | Nullable | Description |
| ---------- | ------ | -------- | ----------- |
| used | number | no | |

---

#### TotalUsageSchema

| Properties | Type | Nullable | Description |
| ---------- | ------ | -------- | ----------- |
| credits | number | no | |
| storage | number | no | |

---

#### CompleteUsageSchema

| Properties | Type | Nullable | Description |
| ---------- | ----------------------------------------------- | -------- | ----------- |
| credits | [ConsumedCreditsSchema](#consumedcreditsschema) | no | |
| total | [TotalUsageSchema](#totalusageschema) | no | |
| usage | [UsageSchema](#usageschema) | no | |

---
1 change: 1 addition & 0 deletions documentation/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- [Assets](ASSETS.md) - Asset Uploader Service
- [Organization](ORGANIZATION.md) - Organization Service
- [Transformation](TRANSFORMATION.md) - Image Transformation Service
- [Billing](BILLING.md) - Payment Service
Loading