Skip to main content
Version: v2alpha1

Account links using the API

To granting the third-party integrator to interact with the getpaid API, it requires:

  • The creation of the integrator account.
  • The creation of client credentials for the integrator account delegating the permissions needed to the operations you want to allow the integrator to do.
  • The configuration of account links between the integrator account and the rest of accounts you want to allow the integrator to operate over.

Steps

1. Create integrator account

getpaid creates the integrator account with the new manage_resources capability enabled allowing the integrator to own client credentials to operate with getpaid platform.

2. Create client credentials

You can create client credentials for the integrator, using the account ID provided in the previous step, to delegate permissions to interact with the getpaid API.

In this scenario, the credentials are configured to issue invoices, therefore invoices:read_write scope is the only one needed.

See how client credentails are used to develop with getpaid API to understand the usage of the created credentials.

Request

POST /accounts/{account_id}/client_credentials
{
"name": "Integrator Invoices",
"scopes": [
"invoices:read_write"
]
}

Response

201 Created
{
"id": "ccs_789gcp0z7q76j18sw9kr3a9w5q",
"client_id": "cH76iNgf9FuTNyOZ6hetvDm7hxaMjdsg",
"client_secret": "PQ_TNT2ver-SylNat-_KqMmd-1a0Wams0ew1troztBniSChEw9aolQewOs8Lo32A",
[...]
}

You can create account links to grant the integrator access to specific accounts. These account link IDs can either be stored by the platform or retrieved later using the account links endpoints.

In this scenario, the account link can be use to grant access to issue invoices in the name of your sellers to specific buyers. You must add an account link between each of the accounts you are allowing the integrator to use (destination account) and the integrator account (source account).

Once the account links are set up, the integrator is ready to use the getpaid API.

warning

Currently, it is only available for invoicing.

Request

POST /account_links
{
"type": "can_use",
"source": "acc_44678r08jtm8zbt227tzhc4nw5",
"destination": "acc_41kb50w1qfgkxfqh6tp8k8pzwf"
}

Response

201 Created
{
"id": "alk_397a1eb5c87a4f14bdf0924044"
}