When you build an application that integrates with Yorlet, you might need to make requests on behalf of your users. For example, you might need to create a payment session for a customer or retrieve a list of payouts for an owner. To make these requests, you need to authenticate your requests using the account’s ID.

Authenticate requests on-behalf of accounts

You can make an API call on-behalf of an account by passing their Account ID into requests in the Yorlet-Account header.

In the following example, we create a new customer on behalf of an account:

curl https://api.yorlet.com/v1/customers \
  -H "Authorization: Bearer {{API_KEY}}" \
  -H "Content-Type: application/json" \
  -H "Yorlet-Account: {{ACCOUNT_ID}}" \
  -d '{
        "email": "[email protected]"
      }'