SpareSpare Docs
GuidesAPI Reference

Accounts

Retrieve a customer's bank accounts, current, savings, cards, loans, and investments, once consent is active.

Integration guide

Goal: List the accounts a customer holds at their bank, with identifiers and metadata, using an active consent.

Estimated time: 15 minutes

Prerequisites

  • Sandbox credentials and an access token
  • An active AIS consent / connection for the customer

What it returns

The Account entity is a financial account the customer holds (current, savings, credit card, loan, or investment), with the identifiers and metadata you need to fetch its balances and transactions.

Each account includes a stable account ID you pass to the Balances & Transactions endpoints, plus currency, type, and status.

Integration summary

Confirm the customer's AIS consent is in an authorized state (see Consent Lifecycle).

List accounts

curl "https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List?consentId=CONSENT_ID" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
const res = await fetch(
  "https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List?consentId=CONSENT_ID",
  {
    headers: {
      Authorization: `Bearer ${accessToken}`,
    },
  },
);

const accounts = await res.json();
res = requests.get(
    "https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List",
    params={"consentId": "CONSENT_ID"},
    headers={
        "Authorization": f"Bearer {access_token}",
    },
)

accounts = res.json()
HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List?consentId=CONSENT_ID"))
    .header("Authorization", "Bearer " + accessToken)
    .GET()
    .build();

HttpResponse<String> response = client.send(
    request, HttpResponse.BodyHandlers.ofString());

String accounts = response.body();
using var client = new HttpClient();

var request = new HttpRequestMessage(
    HttpMethod.Get,
    "https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List?consentId=CONSENT_ID");
request.Headers.Add("Authorization", $"Bearer {accessToken}");

var response = await client.SendAsync(request);

var accounts = await response.Content.ReadAsStringAsync();
req, _ := http.NewRequest(
    http.MethodGet,
    "https://sandbox.sparefinancial.sa/api/v1.0/ais/Account/List?consentId=CONSENT_ID",
    nil,
)
req.Header.Set("Authorization", "Bearer "+accessToken)

res, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer res.Body.Close()

accounts, _ := io.ReadAll(res.Body)

Use the account IDs

For each returned account, call the balance and transaction endpoints with its account ID.

Field-level detail

Full request parameters and response fields are documented in the API Reference. See Transaction Data Object for the transaction shape.

Key takeaways

  • The Accounts endpoint lists every account the customer holds, each with a stable account ID.
  • You need an active consent before calling, reading data requires authorization.
  • Pass each account ID to the balance and transaction endpoints.

On this page