# Balance API
source: https://developer.mastercard.com/cross-border-services/documentation/api-ref/transaction-apis/balance-api/index.md

Alert: If you are a Customer contracted with MTS EU or MTS UK, refer to the corresponding EU and UK specification inside the swagger file to ensure compliance with the relevant jurisdiction based Regulatory Technical Standards (either EU or UK) derived from the Revised Payment Services Directive (PSD2).

You can use this API to obtain account details including balances if you are contracted with a MTS legal entity and enabled for [prefunding settlement or collateral settlement](https://developer.mastercard.com/cross-border-services/documentation/api-ref/settlement-model/index.md).

## Environment Domains {#environment-domains}

### Retrieve All Accounts and Balances {#retrieve-all-accounts-and-balances}

* Sandbox/MTF
* MTF-EU
* MTF-UK
* Production
* Production-EU
* Production-UK

```Sandbox/MTF
https://sandbox.api.mastercard.com/send/partners/{partner_id}/crossborder/accounts
```

```MTF-EU
https://mtf.api.xbs.mastercard.eu/send/partners/{partner_id}/crossborder/accounts
```

```MTF-UK
https://mtf.api.xbs.mastercard.uk/send/partners/{partner_id}/crossborder/accounts
```

```Production
https://api.mastercard.com/send/partners/{partner_id}/crossborder/accounts
```

```Production-EU
https://api.xbs.mastercard.eu/send/partners/{partner_id}/crossborder/accounts
```

```Production-UK
https://api.xbs.mastercard.uk/send/partners/{partner_id}/crossborder/accounts
```

### Retrieve Account Balances by Account ID {#retrieve-account-balances-by-account-id}

* Sandbox
* MTF-EU
* MTF-UK
* Production
* Production-EU
* Production-UK

```Sandbox
https://sandbox.api.mastercard.com/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

```MTF-EU
https://mtf.api.xbs.mastercard.eu/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

```MTF-UK
https://mtf.api.xbs.mastercard.uk/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

```Production
https://api.mastercard.com/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

```Production-EU
https://api.xbs.mastercard.eu/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

```Production-UK
https://api.xbs.mastercard.uk/send/partners/{partner_id}/crossborder/accounts/{account_id}
```

Note: **Sandbox** and **MTF** environments share the same url but are differentiated by partner id.

## API {#api}

### Retrieve All Accounts and Balances {#retrieve-all-accounts-and-balances-1}


API Reference: `GET /send/partners/{partner_id}/crossborder/accounts`

### Retrieve Account Balances by Account ID {#retrieve-account-balances-by-account-id-1}


API Reference: `GET /send/partners/{partner_id}/crossborder/accounts/{account_id}`

* **Formats supported** : JSON   
* **HTTP Version**: 1.0/ 1.1
* **Required HTTP header parameters** :   
  content-type : Format of the inbound content being submitted. example: application/ json   
  content-length: Length of the inbound content body in octets.

## API Convention {#api-convention}

Take a look at the [API Conventions](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#api-conventions) for general guidelines.

## Payload Encryption {#payload-encryption}

All the request payload sent by you to Mastercard must be encrypted. And you will need to decrypt the payload sent by Mastercard.   

For more detailed information on payload **Encryption/ Decryption** , please see [here](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#transport-encryption)

## Next step {#next-step}

Proceed to [Balance API: Sandbox Testing](https://developer.mastercard.com/cross-border-services/documentation/testing/balance-api/index.md) to test the Balance API in the Sandbox environment.
