Skip to main content

Accounts

Access rights

Following access rights need to be enabled for your API user in the MyPuro Portal to use these endpoints:

  • Read Account to list and get account details
  • Write Account for creating and editing account details
  • Read Balance for listing the certificates the account has

See Access management for more details about enabling access to MyPuro resources.

To create a retirement you need to discover which CORCs are available in your accounts. To do this, you need to first list your accounts, and then fetch the balance of the account you want to retire from.

List Accounts

To list accounts which you have read access to, use the GET /mypuro/accounts endpoint.

info

If an account holder in the MyPuro Portal has shared access to an account for your MyPuro organisation, it will be seen from this endpoint alongside your own resources. The account's account holder is specified by the accountHolderId field, for which information can be fetched using the account holder endpoints.

See Access management for more details about enabling access to MyPuro resources.

List accounts
curl -X 'GET' "/accounts" \
-H "Accept: application/json" \
-H "Authorization: Basic $BASIC"
object (PaginationData)
Array of objects (Account) <= 100 items
{
  • "pagination": {
    },
  • "data": [
    ]
}

Get Account Balance

To list certificates of one account, use the GET /mypuro/accounts/{accountNumber}/balance endpoint.

List certificates of an account
curl -X 'GET' "/accounts/{accountNumber}/balance" \
-H "Accept: application/json" \
-H "Authorization: Basic $BASIC"
required
object (PaginationData)
required
Array of objects (CertificateBundle) <= 100 items

Account

{
  • "pagination": {
    },
  • "data": [
    ]
}

In the result you should see the certificates available in the account, which you can retire. If you do not see any certificates listed, please make sure you are listing the correct account, and you have the Read Account Balance access enabled for that particular account.

Copy the certificate ID and account number from the bundle you'd like to retire from. We will retire one certificate from this bundle in the next section.