Pseudo credentials
Pay for a client company with the code you already have. Pseudo credentials are a client company's own API credentials, issued to you as its managing platform, so every call you make with them acts for that company.
With a client company's pseudo credentials you can do anything the company could do with its own keys: fund its wallets, add and pay its recipients, and follow its batches. The requests are the ones documented everywhere else on this site. Only the credentials and the IssuerAccountNumber change.
#Who can get them
Pseudo credentials require manager services: Xtrm has to turn manager services on for your company before you can get or use a client company's pseudo credentials. You can get a client company's pseudo credentials when all of these are true:
- Xtrm has approved your company as a manager.
- Xtrm has turned on manager services for your company, including Get API Credentials, and you sign in to the web app as your master admin or a team member with the Connected Manager Services permission. See Manager services.
- You're connected to the client company, and its account is active.
For the client company to make payments, it also has to be fully onboarded and approved, with its identity documents uploaded in the web app: no API call uploads documents, even with pseudo credentials. See Onboard a client company.
#Get them in the web app
In the Xtrm web app, open Contacts > Company Contacts and find the client company: a blue link icon next to its name shows it's connected (see Icons in the web app). Open its profile (⋮ > View Profile), select Get API Credentials in its Connected Manager Services menu, then copy the client ID and secret. The menu shows Get API Credentials once Xtrm has turned on that manager service for your company.
If you create the client company yourself with CreateBeneficiary once Xtrm has turned on manager services for your company, the ClientID and SecretKey in the response are your pseudo credentials for the new company. Request a token with them and send the new company's SPN in IssuerAccountNumber to act as it. If you call CreateBeneficiary with a client company's pseudo credentials, the pair is issued to that client company instead, for the business it creates.
Treat them like your own keys
Pseudo credentials can move the client company's money. Keep them on your server, in a secrets manager or encrypted store, and never in browser or mobile app code or in source control. Store each client company's credentials separately so one company's keys are never used for another.
#Request a token as the client company
Pseudo credentials go through the same token request as your own: send the client company's client ID and secret to /oAuth/token. The sample below reads them from XTRM_CLIENT_ID and XTRM_CLIENT_SECRET, so set those to the client company's pseudo credentials. Authentication has the same request in all six languages, plus the token response, expiry and renewal.
curl -X POST "https://xapisandbox.xtrm.com/oAuth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=password" \
--data-urlencode "client_id=$XTRM_CLIENT_ID" \
--data-urlencode "client_secret=$XTRM_CLIENT_SECRET"#Call the API as the client company
Send the token as Authorization: Bearer <access_token>, and put the client company's SPN (for example Contoso Ltd's SPN7777555) in IssuerAccountNumber on every request. Each token acts for exactly one company: Xtrm checks the token against the account in IssuerAccountNumber, and a mismatch fails with 401. Your own token can't act for a client company; only that company's pseudo credentials can.
- Your servers, your IP addresses. Calls made with pseudo credentials are checked against the IP addresses Xtrm approved for your company, not the client company's.
- Wallets.
GetCompanyWalletslists the client company's wallets. The one you send asSourceWalletIdpays the batch. - Recipients. Individual and business recipients you create with the client company's credentials belong to the client company. They're connected to the client company and to your platform.
- Calls that name a second account, such as linking a bank account for a recipient, take the client company's
SPNinIssuerAccountNumberand the recipient's account in the second field. See Calls that name two accounts. - A disconnection ends access. If the connection between your company and the client company ends, its pseudo credentials and their tokens stop working. See How a connection ends.
#Run many client companies side by side
- One token per client company. Request and cache a token for each company, keyed by its
SPN, and renew each on its own schedule. Never reuse one company's token for another. - Keep IDs unique across all your client companies.
CustomerBatchIdvalues are shared across every Xtrm account, so include the client company'sSPNor a UUID in each one. See Retries & idempotency. - One webhook endpoint per client company. Xtrm registers webhooks per company account, so ask Xtrm support to set up an endpoint for each client company. Each company has one active subscription with its own signing secret, which Xtrm support sets up with you when it configures the webhook, and events for a client company's batches go only to its subscription. Payloads don't name the paying company, so we recommend a separate URL for each one, for example with the client company's
SPNin the path. See Webhooks. - Fund and reconcile per company. Each client company pays from its own wallets, so track balances, funding and reconciliation per company. See Fund your wallet and Track & reconcile payments.