Skip to content

Latest commit

 

History

History
128 lines (89 loc) · 1.57 KB

File metadata and controls

128 lines (89 loc) · 1.57 KB

DEYM Saweria API Wrapper

A simple Express.js backend API for generating QRIS payments and retrieving transaction data from the Saweria platform, designed to support automated payment systems.


Features

  • Generate QRIS payment
  • Check transaction status
  • Get balance & available balance
  • List transactions
  • Stateless (no database)

Tech Stack

  • Node.js
  • Express.js
  • Axios
  • Winston
  • dotenv

Project Structure

src/
├── routes
├── controllers
├── services
├── middlewares
├── utils

Environment Variables

Create .env from .env.example:

PORT=3000
SAWERIA_BEARER=your_bearer_token
SAWERIA_USER_ID=your_saweria_user_id

Run Project

npm install
node app.js || nodemon app.js

Server:

http://localhost:3000

API Endpoints

Generate QRIS

POST /api/payments/qris
{
  "amount": 1000,
  "message": "Testing payment",
  "customer": {
    "name": "Noname",
    "email": "example@email.com",
    "phone": "628xxxxxxxxxx"
  }
}

Check Transaction Status

GET /api/payments/transactions/:id

Get Balance

GET /api/payments/balance

Get Available Balance

GET /api/payments/available-balance

List Transactions

GET /api/payments/transactions

Notes

  • Backend only
  • No database & No Webhook
  • Polling-based transaction check
  • Bearer token is provided manually for learning purposes

Disclaimer

This project is for learning and portfolio purposes only. Not an official Saweria integration.