Skip to content

luiscgomes/nuchall

 
 

Repository files navigation

nuchall - Beta API - v1.0

Setup

Local console

  • install requirements
    python3.7 -m venv /venv \
    && /venv/bin/pip install -U pip \
    && /venv/bin/pip install --no-cache-dir -r requirements.txt
  • run application
/venv/bin/python3 run.py

Docker

  • build image
docker build -t nuchall .
  • run container
docker run -p 5000:5000 nuchall

endpoint

HTTP Method URI Action
POST /api/v1.0/authorize authorize a transaction
GET /api/v1.0/healthcheck return application status
GET /api/v1.0 Retrieve api version

Authorize a transaction

POST /api/v1.0/authorize

Payload

{
  "account": {
    "cardIsActive": true,
    "limit": "Number",
    "denylist": ["string"]
  },
  "lasttransactions": [
    {
      "merchant": "String",
      "amount": "Number",
      "time": "string" // 2019-08-17T11:02:00.000000
    }
  ],
  "transaction": {
    "merchant": "String",
    "amount": "Number"
  }
}

Response

{
  "approved": "Boolean",
  "newLimit": "Number",
  "deniedReasons": [
    {
      "reason": "description of rule"
    }
  ]
}
status: 201 CREATED

Api Version

GET /api/v1.0
{
  "version": "nuchall - Beta API - v1.0"
}
status: 200 OK

Healthcheck

GET /api/v1.0/healthcheck
{
  "isHealthy": true
}
status: 200 OK

default schema

account

{
  "cardIsActive": true,
  "limit": "Number",
  "denylist": ["String"]
}

Transaction

{
  "merchant": "String",
  "amount": "Number",
  "time": "String"
}

LastTransactions

{
  "lasttransactions": ["String"]
}

Output

{
  "approved": "Boolean",
  "newLimit": "Number",
  "deniedReasons": ["String"]
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%