Skip to content

Instantly share code, notes, and snippets.

@el0911
Created October 9, 2019 16:45
Show Gist options
  • Save el0911/0631c415cdda25a83ce9feb27edf57a6 to your computer and use it in GitHub Desktop.
Save el0911/0631c415cdda25a83ce9feb27edf57a6 to your computer and use it in GitHub Desktop.

BALANCEBOWL API Documentation Templates

By Somto Achu

The BalanceBowl project contract assigned to NESA by Makers

#APIS Cards

Where full URLs are provided in responses they will be rendered as if service is running on 'http://testserver/'.

Closed Endpoints

Closed endpoints requre authorization header

  • card : GET /api/card/
  • addToCards : POST /api/card/addToCards

Cards

Get a list of all the cards arranged according to their card type

URL : /api/cards/

Method : GET

Auth required : YES

Data constraints

None

Data example

None

Success Response

Code : 200 OK

Content example

[
   {
        cardType:[card type mastercard||visa],
        cards:[
          {
                cvc:[cvc number],
            exp:[expiration date of card],
            cardNumber:[card number]
          }
        ]
   }
]

Error Response

Code : 400 BAD REQUEST

Content :

    [
   {
        cardType:[card type mastercard||visa],
        cards:[
          {
            cvc:string,
            exp:string,
            cardNumber:string
          },
           {
            cvc:string,
            exp:string,
            cardNumber:string
          },
           {
            cvc:string,
            exp:string,
            cardNumber:string
          }
        ]
   }
]

AddToCards

Adds a card to the database with the user table charge the card like 5 naira to check if the card works,paystack has something called auth_code thats what we save not card details

URL : /api/card/addtocard

Method : POST

Auth required : YES

Data constraints

{
    cardNumber:[card number],
    cardCVC:[cvc number],
    exp:[exp date]
}

Data example

{
    cardNumber:string,
    cardCVC:string,
    exp:'sting
}

Success Response

Code : 200 OK

Content example

    {
        status:true
    }

Error Response

Code : 400 BAD REQUEST

Content :

     {
       "status": false,
       "error": "error message"
      }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment