POS25
  • πŸ‘‹Welcome to POS25
  • Features
    • πŸ–₯️Offline payment
      • πŸ”³QR code scanning
      • ✨NFC tap to pay
      • πŸ—ƒοΈCard
  • ☁️Online payment
    • πŸ›…Checkout page
    • πŸ’³Card EMV acceptance
    • πŸ”³QR payment
  • Page
  • πŸ“’Contract Addresses
  • API Integration
    • πŸ“ͺAPI
    • 1. Get list chains support
    • 2. Get list of assets support
    • 3. Create link payment (Support QR code)
    • 4. NFC payment
  • SDK Integration
    • πŸ› οΈTypescript SDK
    • πŸ› οΈPython SDK
    • βš™οΈMobile SDK
    • πŸ› οΈHow to use SDK
    • πŸ•ΈοΈChange log
  • Reference documents
    • πŸ–₯️For Developers
  • Terms
  • Privacy
Powered by GitBook
On this page
  • 1. Get list chain support
  • 2. Get a list of asset support
  • 3. API create link payment (Support QR code)
  • 4. API NFC payment
  1. API Integration

API

This is an API that interacts with the POS25 system.

PreviousContract AddressesNext1. Get list chains support

Last updated 1 year ago

Base url:

Token: 8d1300ea96d3cca64918f871318864c6 . Developer can using this Token to test the APIs bellow.

1. Get list chain support

GET https://api.pos25.app/v1/cf-payment/chain

The API will respond list of blockchain that POS25 support. Information includes name, chain_id, and link logo.

Headers

Name
Type
Description

Authorization*

String

Bearer <Token>

{
    "data": [
        {
            "name": "SCROLL",
            "chain_id": 534352,
            "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/26998.png"
        },
        {
            "name": "NAUTILUS",
            "chain_id": 22222,
            "logo": "https://pbs.twimg.com/profile_images/1626750544642727937/qNCwFLUt_400x400.jpg"
        },
        {
            "name": "BASE",
            "chain_id": 8453,
            "logo": "https://bridge.base.org/icons/base.svg"
        },
        {
            "name": "SUI",
            "chain_id": 101,
            "logo": "https://static.atomsolution.vn/sui.png"
        }
    ],
    "errors": [],
    "msg": "",
    "error_code": ""
}

{
    "data": {},
    "errors": [
        {
            "user": "Invalid"
        }
    ],
    "msg": "Forbidden",
    "error_code": "E_FORBIDDEN"
}

{
    "data": {},
    "errors": [
        {
            "field": "Some error message"
        }
    ],
    "msg": "",
    "error_code": "E_BAD_REQUEST"
}

Let's see how you can call this method either through Curl or Python:

curl --location 'https://api.pos25.app/v1/cf-payment/chain' \
--header 'Authorization: Bearer 8d1300ea96d3cca64918f871318864c6'
import requests

url = "https://api.pos25.app/v1/cf-payment/chain"

payload = {}
headers = {
  'Authorization': 'Bearer 8d1300ea96d3cca64918f871318864c6'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

2. Get a list of asset support

GET https://api.pos25.app/v1/cf-payment/asset

The API will retrieve a list of chain assets that the user passes in via chain_id

Query Parameters

Name
Type
Description

chain_id*

String

chain_id that pos25 supports

Headers

Name
Type
Description

Authorization*

String

Bearer <Token>

{
    "data": [
        {
            "asset": "USDT",
            "chain": "SCROLL",
            "chain_id": 534352,
            "decimal": 6,
            "logo": "https://s3.ap-southeast-1.amazonaws.com/static.atomsolution.vn/usdt.png"
        }
    ],
    "errors": [],
    "msg": "",
    "error_code": ""
}

{
    "data": {},
    "errors": [
        {
            "user": "Invalid"
        }
    ],
    "msg": "Forbidden",
    "error_code": "E_FORBIDDEN"
}

{
    "data": {},
    "errors": [
        {
            "chain_id": [
                "Missing data for required field."
            ]
        }
    ],
    "msg": "Invalid params",
    "error_code": "E_BAD_REQUEST"
}

Let's see how you can call this method either through Curl or Python:

curl --location 'https://api.pos25.app/v1/cf-payment/asset?chain_id=534352'
import requests

url = "https://api.pos25.app/v1/cf-payment/asset?chain_id=534352"

payload = {}
headers = {}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

3. API create link payment (Support QR code)

POST https://api.pos25.app/v1/cf-payment/generate_qr

The API generates link payment. You can generate a QR code from the link and Users can make payments on wallets such as Metamask, TRAM wallet,...

Headers

Name
Type
Description

Authorization*

String

Bearer <Token>

Request Body

Name
Type
Description

order_id*

String

Order id of transaction (UNIQUE)

amount*

String

Transaction amount

asset*

String

the asset the user wants to pay (the asset is taken from the API to get a list of supported assets)

chain_id*

String

chain_id is the blockchain the user wants to pay on, obtained from the supporting chain API

currency*

String

the currency the user wants to display instead of the blockchain asset (with added transaction fees)

fee_value*

String

Transaction fee

serial_number*

String

serrial number of POS device

{
    "data": {
        "qr_url": "https://app.pos25.app/qr-scan?&order_id=010001&contract_address=0x48736b8AC81E0fa279b571B25C698D631a4407A1&currency_address=0x55d398326f99059ff775485246999027b3197955&transaction_amount=0.001&act=DEPOSIT&chain_id=22222&decimal=6",
        "rate_usd": 23000,
        "expire_at": "04/11/2023 22:50:31"
    },
    "errors": [],
    "msg": "",
    "error_code": ""
}

{
    "data": {},
    "errors": [
        {
            "user": "Invalid"
        }
    ],
    "msg": "Forbidden",
    "error_code": "E_FORBIDDEN"
}

{
    "data": {},
    "errors": [
        {
            "serial_number": [
                "Missing data for required field."
            ],
            "fee_value": [
                "Missing data for required field."
            ]
        }
    ],
    "msg": "Invalid data",
    "error_code": "E_BAD_REQUEST"
}

Let's see how you can call this method either through Curl or Python:

curl --location 'https://api.pos25.app/v1/cf-payment/generate_qr' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 8d1300ea96d3cca64918f871318864c6' \
--data '
{
    "order_id": "010001",
    "amount": "0.001",
    "asset": "USDT",
    "chain_id": 22222,
    "currency": "USD",
    "fee_value": "0",
    "serial_number": "00024500706"
}

'
import requests
import json

url = "https://api.pos25.app/v1/cf-payment/generate_qr"

payload = json.dumps({
  "order_id": "010001",
  "amount": "0.001",
  "asset": "USDT",
  "chain_id": 22222,
  "currency": "USD",
  "fee_value": "0",
  "serial_number": "00024500706"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer 8d1300ea96d3cca64918f871318864c6'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

4. API NFC payment

POST https://api.pos25.app/v1/cf-payment/generate_nfc

The API performs the above payment using NFC

*NOTE: Currently, payment by NFC is only supported on TRAM wallet

Headers

Name
Type
Description

Authorization*

String

Bearer <Token>

Request Body

Name
Type
Description

order_id*

String

Order id of transaction (UNIQUE)

amount*

String

Transaction amount

token*

String

The token will be created by TRAM wallet to request a transaction and sent to the POS machine via NFC

serial_number*

String

serrial number of POS device

{
    "data": "success",
    "errors": [],
    "msg": "",
    "error_code": ""
}

{
    "data": {},
    "errors": [
        {
            "user": "Invalid"
        }
    ],
    "msg": "Forbidden",
    "error_code": "E_FORBIDDEN"
}

{
    "data": {},
    "errors": [
        {
            "serial_number": [
                "Missing data for required field."
            ],
            "fee_value": [
                "Missing data for required field."
            ]
        }
    ],
    "msg": "Invalid data",
    "error_code": "E_BAD_REQUEST"
}

Let's see how you can call this method either through Curl or Python:

curl --location 'https://api.pos25.app/v1/cf-payment/generate_nfc' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 8d1300ea96d3cca64918f871318864c6' \
--data '{
    "token": "10f932e3-b85a-4c23-8a88-f830e4bbfe06",
    "order_id": "92108",
    "amount": "0.01",
    "serial_number": "00024500710"
}
'
import requests
import json

url = "https://api.pos25.app/v1/cf-payment/generate_nfc"

payload = json.dumps({
  "token": "10f932e3-b85a-4c23-8a88-f830e4bbfe06",
  "order_id": "92108",
  "amount": "0.01",
  "serial_number": "00024500710"
})
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Bearer 8d1300ea96d3cca64918f871318864c6'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
πŸ“ͺ
https://api.pos25.app/v1/cf-payment