πŸ–₯️For Developers

Fina Card API (BETA)

Fina Card has public API endpoints so you can integrate Fina Card in your dApp or Wallet UI, or use our API to analyse your spendings://api

Generating Signature

For each API method, you need to include a ADR-36 signature. The message required in each API method is different. Here is an Javascript example of using Keplr to generate the signature.

if (window.keplr) {
    await window.keplr.enable("secret-4");
    const account = await window.keplr.getKey("secret-4");
    const signed = await window.keplr.signArbitrary(
      "secret-4",
      account.bech32Address,
      "Fina Card: Sign In"
    );
    // Parameters required to make a request
    const signature = signed.signature
    const address = account.bech32Address
    const pubKey = signed.pub_key.value
    const chainId = "secret-4"
}

Encryption Key

As Fina needs to query the details of the Top Up transaction, which is encrypted on Secret Network, we need to know the encryption key used in the transaction so we can decrypt the message. Here is an example code to generate the encryption key.

API Methods

Get Account

Get user's Fina Card information and transactions

POST https://api.card.fina.cash/getAccount

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Sign In

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

Get Sensitive Information

Get user's encrypted sensitive card information like full card number, CVV, 3DS password

POST https://api.card.fina.cash/getSensitiveInfo

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: View Sensitive Information at {{ISO Timestamp}}

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

timestamp*

String

ISO Timestamp, eg 2023-03-31T13:12:36.128Z

rsaPubKey*

String

A base64 encoded RSA public key used to encrypt the sensitive information

To decrypt the information, use the RSA key generated with scheme { hash: "sha256", label: "CardNumber" } . Scheme label for each field is different.

Example:

Get Top Up Information

Get top up information like the price, fee, min and max top up amount, etc

POST https://api.card.fina.cash/getTopupInfo

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Sign In

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

Change 3D Secure Settings

Change 3D Secure settings like mobile number and password

POST https://api.card.fina.cash/change3DS

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Change 3DS Settings at {{ISO Timestamp}}

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

timestamp*

String

ISO Timestamp, eg 2023-03-31T13:12:36.128Z

password

String

New 3D Secure password

mobile

String

New 3D Secure mobile number

Toggle Block Card

Block or Unblock card transactions

POST https://api.card.fina.cash/toggleBlockCard

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Toggle Block Card at {{ISO Timestamp}}

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

timestamp*

String

ISO Timestamp, eg 2023-03-31T13:12:36.128Z

Top Up

Top up card by sending token to the topupAddress returned from /getTopupInfo and call this API with the TX hash to increase card balance.

POST https://api.card.fina.cash/topup

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Sign In

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

topupAsset*

String

Token symbol used to top up. eg, SCRT

currency*

String

Currency to top up the card. eg, EUR

txHash*

String

TX hash of your top up

encryptionKey*

String

Encryption key used to encrypt transaction on Secret Network

Create New Card

Create a new card for new user

POST https://api.card.fina.cash/createCard

Request Body

Name
Type
Description

signature*

String

Message to sign:

Fina Card: Sign In

address*

String

User's bech32 address

pubKey*

String

User's base64 encoded public key

chainId*

String

Chain ID

topupAsset*

String

Token symbol used in initial top up. eg, SCRT

currency*

String

Currency to top up the card. eg, EUR

txHash*

String

TX hash of your initial top up

name*

String

Name on your card

mobile*

String

3D Secure mobile number

password*

String

3D Secure password

encryptionKey*

String

Encryption key used to encrypt transaction on Secret Network

Last updated

Was this helpful?