Manage accounts

Accounts in a platform contain funds to send rewards to recipients. Accounts are located under groups. Groups (customers) are the second level under a platform. You must have at least one group that cannot be deleted or disabled. Each group (customer) contains one or more accounts.

315

Use case

Your marketing department in your business currently runs two programs: an employee-incentive program and a customer-referral program. You want to keep the funds separate for each program per your accounting requirement. You create two separate accounts on your platform: one for the employee-incentive program and one for the customer-referral program. Each account contains the funds dedicated to the program. You can get details such as name, account number, account identifier, the status of the account, etc. from the account. Here's how:

Get a list of accounts created on this platform

Use the GET {URI}/accounts endpoint to get a list of accounts created on this platform:

FunctionPurpose
GET {URI}/accountsGet a list of Accounts created on this Platform.

Here are the query parameters used with GET {URI}/accounts to get a list of accounts created on this Platform.

Query parameterData TypeDescription
paginatebooleanWhether to paginate the results or not. Defaults to false.
prevCursorstringA provided base64 token that represents the cursor for the previous page of results. Use this token to retrieve the previous set of items. This will be ignored if paginate is false.
nextCursorstringA provided base64 token that represents the cursor for the next page of results. Use this token to retrieve the next set of items. This will be ignored if paginate is false.
maxResultsint32The maximum number of results to return. The default value is 10, and the maximum is 200. This will be ignored if paginate is false.

See the example response below for when you use GET {URI}/accounts:

[
  {
    "accountIdentifier": "string",
    "accountNumber": "string",
    "displayName": "string",
    "currencyCode": "string",
    "currentBalance": 0,
    "createdAt": "2024-02-12T08:08:58.265Z",
    "status": "string",
    "contactEmail": "string"
  }
]

The response message for this endpoint is:

  • 200 OK
  • 400 Bad request
  • 401 Unauthorized
  • 403 Forbidden

Create accounts

The following example shows the response using POST {URI}/accounts to create an account under the Group you created. The accountIdentifier must be lowercase, string, and 5-100 characters.

{
  "accountIdentifier": "string", (5-100 chars)
  "contactEmail": "string",
  "displayName": "string", (100 chars)
  "currencyCode": "string" (3 chars)
}

Check account balance

Tango API allows you to check the account balance at any time with GET {URI}/accounts, but it does not show the low balance alerts. We recommend building in a balance check and alert system if you anticipate the need to re-fund accounts on a regular basis.

The following example response helps you observe your adjusted balance. Perform a GET {URI}/accounts call or GET {URI}/accounts{accountName} call to see the adjusted balance of your account following the order. The paginate boolean in query parameter is set to true for this example.

{
  "prevCursor": "string",
  "nextCursor": "string",
  "prevPageAvailable": boolean,
  "nextPageAvailable": boolean,
  "maxResults": int32,
  "items": 
  {
    "accountIdentifier": "string", (5-100 chars)
    "accountNumber": "string", (5-100 chars)
    "displayName": "string", (100 chars)
    "currencyCode": "string", (3 chars)
    "currentBalance": 0,
    "createdAt": "2023-05-10T18:40:03.899Z",
    "status": "string",
    "contactEmail": "string" (255 chars)
  }
}

Get details for a specific account

Use GET {URI}/accounts/{accountIdentifier} endpoint to get details for a specific account under this platform:

FunctionPurpose
GET {URI}/accounts/{accountIdentifier}Get details for a specific account on this Platform.

The following path parameter is used with GET {URI}/accounts/{accountIdentifier} to get details for a specific account on this platform.

ParameterData TypeDescription
accountIdentifierstringThe accountIdentifier for the Account you are seeking details.
The string must have 5-100 characters.

See the example response below for when you use GET {URI}/accounts/accountIdentifier to get details for a specific account:

{
    "accountIdentifier": "string", (5-100 chars)
    "accountNumber": "string", (5-100 chars)
    "displayName": "string", (100 chars)
    "currencyCode": "string", (3 chars)
    "currentBalance": 7850.94,
    "createdAt": "2016-07-19T18:19:30.855Z",
    "status": "ACTIVE",
    "contactEmail": "string", (255 chars)
}

The response message for this endpoint is:

  • 200 OK
  • 400 Bad request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found

What’s Next