Module bintable
ballerinax/bintable Ballerina library
Overview
Bintable is a Bank Identification Number (BIN) lookup service that returns card metadata such as the brand, type and issuer for the leading digits of a payment card, and reports the balance and expiry of the account that is used to make lookups.
The Bintable connector lets Ballerina applications call the Bintable API (version 1.0.0-oas3) to look up card information by BIN and to check the remaining account balance and expiry.
Key features
- Look up card brand, type, issuer and country details from a BIN
- Check the account balance and package expiry
- Authenticate with a single API key
Setup guide
To use the Bintable connector, you need an API key.
-
Create an account on bintable.com and sign in.
-
Open the account dashboard and copy the API key shown there.
-
Keep the key safe and supply it to the connector through your
Config.tomlfile.
Quickstart
To use the bintable connector in your Ballerina application, update the .bal file as follows:
-
Import the
bintablemodule.import ballerinax/bintable; -
Add the API key to the
Config.tomlfile.apiKey = "<API_KEY>" -
Create a
bintable:Clientwith the API key.configurable string apiKey = ?; bintable:Client bintableClient = check new ({apiKey}); -
Look up a BIN.
public function main() returns error? { bintable:ResponseItem _ = check bintableClient->lookupBin("457173"); }
Examples
The Bintable connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Card BIN verification - Check the account balance, then look up the card details of a BIN.
- Account balance monitoring - Report the account balance and verify that the key can serve lookups.