A business is what you create in the business panel. It has its own API key, webhook URL, fee settings and team. A request made with a business- key acts on the business that owns the key, so these endpoints take no ID.
Payments from your customers arrive in the business balance and are then settled to the owner's SwapWallet account.
Your business: its profile, its payment settings and whether it can take payments.
idintegerUnique identifier of the business.
typeenumKind of business.
Possible values
APICreated for the API. Can create invoices.MANUALA personal payment link. Can't create invoices through the API.ownerIdintegerSwapWallet user ID of the owner. Payments are settled to this user's SwapWallet account.
supportCodestringCode to quote when you contact SwapWallet support about this business.
statusenumAlways ACTIVE in this response: keys of inactive or deleted businesses are rejected.
Possible values
ACTIVETaking payments.INACTIVETurned off.DELETEDDeleted.usernamestringUnique username of the business.
logostringnullableURL of the logo, or null if none is set.
namestringDisplay name, shown to customers on SwapWallet payment pages.
descriptionstringnullableShort description of the business.
websitestringnullableThe business's website.
webhookUrlstringnullableDefault webhook URL, used for invoices created without their own webhookUrl. Set it in the panel.
deepLinksarray of enumsWallet apps your invoices offer payment links for, in display order. Set by SwapWallet.
Possible values
SWAP_WALLETSwapWallet, in Telegram.SWAP_WALLET_WEBSITESwapWallet, on the web.TRUST_WALLETTrust Wallet.METAMASKMetaMask.TON_KEEPERTonkeeper. TON only.TONHUBTonhub. TON only.MYTONWALLETMyTonWallet. TON only.BITYCLEBitycle.feePayerenumWho pays SwapWallet's fee by default.
Possible values
APPLICATIONYour business: the fee is deducted from what you receive.USERThe customer: the fee is added to what they pay.lockedHoursintegerHours each payment stays in your business balance before it's settled to the owner's account. 0 means it's settled right away.
isVerifiedbooleanWhether SwapWallet has verified the business. Only verified businesses can create invoices.
{
"id": 1284,
"type": "API",
"ownerId": 905513,
"supportCode": "AP-7KQ2M9D-X4TN",
"status": "ACTIVE",
"username": "pixelshop",
"logo": "https://swapwallet.app/media/applications/pixelshop.png",
"name": "Pixel Shop",
"description": "Gift cards and subscriptions",
"website": "https://pixelshop.example",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"deepLinks": [
"SWAP_WALLET",
"TRUST_WALLET"
],
"feePayer": "APPLICATION",
"lockedHours": 0,
"isVerified": true
}A person on your business team and the roles they hold in the panel.
applicationUsernamestringUsername of the business.
userIdintegerThe member's SwapWallet user ID.
namestringThe member's name in this business.
rolesarray of enumsRoles that decide what the member can do in the panel.
Possible values
OWNEREverything, including critical settings.ADMINEverything except critical settings.FINANCEViews and moves funds, views transactions.ACCOUNTINGViews funds and transactions.SALESCreates receipts, views funds and transactions.DEVELOPERManages the API key and webhooks.SUPPORTViews transactions.{
"applicationUsername": "pixelshop",
"userId": 911207,
"name": "Reza Karimi",
"roles": [
"DEVELOPER"
]
}/v1/merchants/infoRetrieves the business your API key belongs to. Call it once at startup to check the key and read settings such as the default webhook URL and the hold period.
No parameters.
Returns the Business object.
curl https://swapwallet.app/api/v1/merchants/info \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/info', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.get(
"https://swapwallet.app/api/v1/merchants/info",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/info');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://swapwallet.app/api/v1/merchants/info", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"status": "OK",
"result": {
"id": 1284,
"type": "API",
"ownerId": 905513,
"supportCode": "AP-7KQ2M9D-X4TN",
"status": "ACTIVE",
"username": "pixelshop",
"logo": "https://swapwallet.app/media/applications/pixelshop.png",
"name": "Pixel Shop",
"description": "Gift cards and subscriptions",
"website": "https://pixelshop.example",
"webhookUrl": "https://pixelshop.example/webhooks/swapwallet",
"deepLinks": [
"SWAP_WALLET",
"TRUST_WALLET"
],
"feePayer": "APPLICATION",
"lockedHours": 0,
"isVerified": true
}
}/v1/merchants/membersLists everyone on your business team with their roles. The list is short, so it comes in one response without paging.
No parameters.
Returns an array of Member objects in result.
curl https://swapwallet.app/api/v1/merchants/members \
-H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"const response = await fetch('https://swapwallet.app/api/v1/merchants/members', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SWAPWALLET_BUSINESS_KEY}`,
},
});
const data = await response.json();
console.log(data.result);import os
import requests
response = requests.get(
"https://swapwallet.app/api/v1/merchants/members",
headers={"Authorization": f"Bearer {os.environ['SWAPWALLET_BUSINESS_KEY']}"},
)
print(response.json()["result"])<?php
$ch = curl_init('https://swapwallet.app/api/v1/merchants/members');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('SWAPWALLET_BUSINESS_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data['result']);package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, _ := http.NewRequest("GET", "https://swapwallet.app/api/v1/merchants/members", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SWAPWALLET_BUSINESS_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}{
"status": "OK",
"result": [
{
"applicationUsername": "pixelshop",
"userId": 905513,
"name": "Sara Ahmadi",
"roles": [
"OWNER"
]
},
{
"applicationUsername": "pixelshop",
"userId": 911207,
"name": "Reza Karimi",
"roles": [
"DEVELOPER"
]
},
{
"applicationUsername": "pixelshop",
"userId": 918442,
"name": "Mina Rahimi",
"roles": [
"SUPPORT",
"SALES"
]
}
]
}