- Authentication
The Payment Dashboard API uses token to authenticate requests. You can get your token key by send login request.
import requests
import json
url = "https://s.api.formsquare.co/api/users/login/"
payload = json.dumps({
"username": "aaaa",
"password": "bbbb"
})
headers = {
'content-type': 'application/json',
'Accept': '*/*',
'Origin': 'https://payment-dashboard.com'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Token sk_test_51JrCspKnnySXUE2gOFcRhfGDVo4lOTXR3nYnDkcFVS6X69Hr7bKbuNZlHmn6a2GZJW7OSO8yvefeNbQo43uVfHfP00WojheC7k"
- Account
This is an object representing your payment dashboard account. You can retrieve it to see the information of your Payment dashboard account.
import requests
url = "https://s.api.formsquare.co/api/users/me/"
payload={}
headers = {
'accept': 'application/json',
'authorization': 'Token xxxx'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Sample response:
{
"id": 22,
"username": "IPNLLCCurtis",
"email": "curtis.t@paybotic.com",
"first_name": "Curtis",
"last_name": "Tran",
"terminals": [],
"terminals_ids": [],
"last_login": null,
"is_superuser": true,
"date_joined": "2020-01-06T14:49:43.469481Z"
}
- Terminals
Returns a list of terminals you’ve previously assigned. The terminals are returned in sorted order, with the most recent terminals appearing first.
GET
: https://s.api.formsquare.co/api/terminals/
- Retrieve a charge
Retrieves the details of a terminal that has previously been created. Supply the unique terminal ID that was returned from your previous request, and Payment dashboard will return the corresponding terminal information.
GET
: https://s.api.formsquare.co/api/terminals/<terminal_id: int>/
Other api endpoint can be call listed here: http://s.api.formsquare.co/api/ Some endpoint limited to specific roles