Skip to content
SwapWalletDocs
فارسیGet an API key

Business

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.

The business object

Your business: its profile, its payment settings and whether it can take payments.

Attributes

  • idinteger

    Unique identifier of the business.

  • typeenum

    Kind of business.

    Possible values

    • APICreated for the API. Can create invoices.
    • MANUALA personal payment link. Can't create invoices through the API.
  • ownerIdinteger

    SwapWallet user ID of the owner. Payments are settled to this user's SwapWallet account.

  • supportCodestring

    Code to quote when you contact SwapWallet support about this business.

  • statusenum

    Always ACTIVE in this response: keys of inactive or deleted businesses are rejected.

    Possible values

    • ACTIVETaking payments.
    • INACTIVETurned off.
    • DELETEDDeleted.
  • usernamestring

    Unique username of the business.

  • namestring

    Display name, shown to customers on SwapWallet payment pages.

  • descriptionstringnullable

    Short description of the business.

  • websitestringnullable

    The business's website.

  • webhookUrlstringnullable

    Default webhook URL, used for invoices created without their own webhookUrl. Set it in the panel.

  • feePayerenum

    Who 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.
  • lockedHoursinteger

    Hours each payment stays in your business balance before it's settled to the owner's account. 0 means it's settled right away.

  • isVerifiedboolean

    Whether SwapWallet has verified the business. Only verified businesses can create invoices.

The business object
{
  "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
}

The member object

A person on your business team and the roles they hold in the panel.

Attributes

  • applicationUsernamestring

    Username of the business.

  • userIdinteger

    The member's SwapWallet user ID.

  • namestring

    The member's name in this business.

  • rolesarray of enums

    Roles 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.
The member object
{
  "applicationUsername": "pixelshop",
  "userId": 911207,
  "name": "Reza Karimi",
  "roles": [
    "DEVELOPER"
  ]
}

Retrieve your business

GET/v1/merchants/info

Retrieves 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.

Parameters

No parameters.

Returns

Returns the Business object.

GET/v1/merchants/info
curl https://swapwallet.app/api/v1/merchants/info \
  -H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"
Response
{
  "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
  }
}

List members

GET/v1/merchants/members

Lists everyone on your business team with their roles. The list is short, so it comes in one response without paging.

Parameters

No parameters.

Returns

Returns an array of Member objects in result.

GET/v1/merchants/members
curl https://swapwallet.app/api/v1/merchants/members \
  -H "Authorization: Bearer $SWAPWALLET_BUSINESS_KEY"
Response
{
  "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"
      ]
    }
  ]
}