Skip to main content

Authorised API client

An Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/). lets your backend call the Weavr API on your own corporate identity, without a user signing in. Use it to automate your own operations, such as managing your cards and accounts, running bulk updates, and reading statements.

Intended use

An Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/). operates only on your embedderEmbedder (Embedded Finance Provider). A company or developer that integrates Weavr's embedded finance services into their own application to provide financial services to their end customers. corporate: your own business on your programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.. You can't use it to act on behalf of your customers. To automate operations for customers who have given consent, use a Delegated API client instead.

Allowed operations

The operations your Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/). can perform are agreed case by case with our support team, based on what your integration needs. Contact support to begin the process. Calls outside that set return 403 INSUFFICIENT_PERMISSIONS.

Some operations should stay with a user

Operations that need a person present are normally kept on user authentication, so the user can complete strong customer authentication (SCASCA (Strong Customer Authentication). Strong Customer Authentication - a two-factor authentication solution required by PSD2 regulations for when end-users are accessing their payment account sensitive information or initiating transactions. SCA requires at least two of the following: something you know (password), something you have (device), or something you are (biometrics).). Typical examples are confirming outgoing wire transfersWire TransferA transaction that moves funds between accounts. An incoming wire transfer moves funds from a third-party bank account to a Weavr managed account, while an outgoing wire transfer moves funds from a Weavr managed account to a third-party bank account. Wire transfers require the managed account to have an assigned IBAN (for EUR) or sort code and account number (for GBP)., adding beneficiaries, and showing card details in clear through the Secure UI components. If agreed, your backend can still retrieve card details in tokenizedTokenizeReplace a card's primary account number (PAN) with a unique digital token that stands in for the real card during a transaction. When a cardholder adds a card to Apple Pay or Google Pay via push provisioning, the wallet provider stores a device-specific token rather than the underlying PAN, so the real card number isn't exposed on the device or shared with merchants. form.

Enabling an Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/). doesn't change user authentication. Users can keep signing in as before, so you can move your backend calls across gradually.

How it differs from other API clients​

All three client types call the same Weavr API. They differ in who they act for, how they authenticate, and who decides what they can do.

User API clientUser API clientThe standard API client type. End users authenticate with their own credentials and operations run in the context of their session, so sensitive operations require Strong Customer Authentication step-up. Contrast with a Delegated API client and an Authorised API client.Delegated API clientDelegated API clientAn API client type used with [Delegation of Authority](/apis/authentication/delegation-overview/) that authenticates with a client assertion (a JWT signed with a private key whose X.509 certificate is registered with Weavr) instead of end-user credentials. It receives access tokens scoped to a specific identity user and can perform operations server-to-server without triggering Strong Customer Authentication step-up.Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/).
Acts forThe signed-in userYour customers' identities, with their consentYour own corporate identity only
How it authenticatesUser credentials (password, biometrics), then POST /access_tokenClient assertion signed with your private key, then POST /access_tokenClient assertion signed with your private key, then POST /access_token
SCASCA (Strong Customer Authentication). Strong Customer Authentication - a two-factor authentication solution required by PSD2 regulations for when end-users are accessing their payment account sensitive information or initiating transactions. SCA requires at least two of the following: something you know (password), something you have (device), or something you are (biometrics). step-upRequired where the endpoint asks for itNot required on supported endpointsNot required
Operations allowedThe user's roleThe endpoints listed for delegationA set agreed with our support team for your integration
Who sets it upYou, in the Embedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data.You, once Weavr has enabled delegation for your programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.Our support team, with you
Customers who can use itWhoever signs inCustomers who consented during onboardingCorporatesCorporates (Corporate Identity). Business entities that can be onboarded as customers on Weavr. Corporate customers represent companies and require Know Your Business (KYB) verification. They can have multiple authorised users and issue cards to card assignees. Weavr has authorized on your programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.
Which client type do you need?

If your backend works on your own business's cards and accounts, use an Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/).. If it works on your customers' cards and accounts, use a Delegated API clientDelegated API clientAn API client type used with [Delegation of Authority](/apis/authentication/delegation-overview/) that authenticates with a client assertion (a JWT signed with a private key whose X.509 certificate is registered with Weavr) instead of end-user credentials. It receives access tokens scoped to a specific identity user and can perform operations server-to-server without triggering Strong Customer Authentication step-up.. If a person is present and signs in, use a User API clientUser API clientThe standard API client type. End users authenticate with their own credentials and operations run in the context of their session, so sensitive operations require Strong Customer Authentication step-up. Contrast with a Delegated API client and an Authorised API client..

Set up an Authorised API client​

Contact our support team to start. Set-up is done together, separately for Sandbox and Live, and for each programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes. you want to automate.

  1. Agree the operations. Tell support which operations your backend needs. Support agrees the set with you and configures it.
  2. Weavr enables the client. Support enables Authorised API clientAuthorised API clientAn API client type that lets your backend call the Weavr API on your own corporate identity, without a user signing in. It authenticates with a signed client assertion, can perform only the operations agreed with Weavr for your integration, and can't act on behalf of your customers. See [Authorised API client](/apis/authentication/authorised-api-client/). mode on your programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes., authorizes your corporate identity on it, and creates the API client.
  3. Find your credentials. In the Embedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data., open Developers > API credentials > API clients for the programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.. Note the API client ID and the programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.'s API key. Only the root userRoot userThe individual who creates the customer. For corporates, the root user needs to be a legal representative of the company, such as a director or someone with power of attorney. For consumers, the root user is the customer. Every customer must always have one root user. can see these details, so the root userRoot userThe individual who creates the customer. For corporates, the root user needs to be a legal representative of the company, such as a director or someone with power of attorney. For consumers, the root user is the customer. Every customer must always have one root user. must sign in to the portal to retrieve them.
  4. Generate and upload a certificate. See Generate and upload a certificate.
  5. Test in Sandbox. Request a token and call one agreed endpoint before moving to Live.
Everything is per programme

An API client, its certificate, the API key, and the authorized corporate all belong to one programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.. A token request must use all four from the same programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes., or it's refused. If you have several programmesProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes., repeat the set-up for each.

You needWhere to find it
API client IDEmbedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data. > API clients
API keyEmbedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data., for the same programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes. as the API client
Corporate identity IDYour corporate's ID, as authorized by Weavr on that programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.
Private key and certificateYou generate them, as described in the following section

Generate and upload a certificate​

Weavr checks your client assertion against an X.509 certificate that you upload for the API client. You keep the matching private key and sign with it. The certificate is safe to share; the private key never leaves your systems.

Upload a certificate, not a public key

The upload needs a file that starts with -----BEGIN CERTIFICATE-----. A public key (-----BEGIN PUBLIC KEY-----) is rejected, as are a private key, a certificate chain, and a non-RSA key.

Certificate requirements​

RequirementValue
FormatX.509 certificate, PEM encoded (Base64 text between the BEGIN CERTIFICATE and END CERTIFICATE lines)
Key typeRSA, 2048 bits or more. EC keys aren't supported
ContentsOne certificate. Not a chain, bundle, or key file
ValidityMust have an expiry date. Assertions fail once it has expired
FilenameAny. .crt and .pem both work; Weavr reads the content, not the extension
Certificates per API clientUp to 5 active
Self-signedAccepted. A CA-issued certificate isn't required

1. Generate a key pair and certificate​

openssl req -x509 -newkey rsa:2048 -sha256 -nodes \
-keyout private-key.pem \
-out certificate.pem \
-days 365 \
-subj "/CN=${YOUR_COMPANY}-weavr-api-client"

This creates two files:

  • certificate.pem: upload this to Weavr.
  • private-key.pem: keep it secret and use it to sign client assertions. Never upload or share it.

To reuse a key you already have, create a certificate from it:

openssl req -x509 -key private-key.pem -sha256 -days 365 \
-subj "/CN=${YOUR_COMPANY}-weavr-api-client" \
-out certificate.pem

2. Check the files before uploading​

# Must print one certificate with "Public Key Algorithm: rsaEncryption" and a "Not After" date
openssl x509 -in certificate.pem -noout -text

# The two values must match: the private key belongs to this certificate
openssl x509 -in certificate.pem -noout -modulus | openssl sha256
openssl rsa -in private-key.pem -noout -modulus | openssl sha256

If the first command fails with unable to load certificate, the file isn't a certificate. You may have exported the public key instead.

3. Upload the certificate​

In the Embedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data., open API clients, select the API client, and upload certificate.pem. Upload the whole file, including the BEGIN and END lines. You need the API client management permission, and the portal may ask you to confirm with a one-time code from your authenticator app.

Rotate a certificate​

Weavr accepts an assertion signed by the private key of any active certificate on the API client, so you can rotate without downtime:

  1. Generate a new key pair and certificate.
  2. Upload the new certificate. Both are now active.
  3. Switch your backend to sign with the new private key.
  4. Delete the old certificate in the Embedder PortalEmbedder PortalA web-based portal where embedders manage their Weavr account: browse customers and instruments, configure programmes, find API credentials and profile IDs, run Sandbox simulations, and inspect webhook deliveries. Sandbox and Live are separate, with their own credentials and data..

Set a reminder well before the expiry date. After expiry, token requests fail with Invalid assertion - no matching certificate registered.

Build the client assertion​

The client assertion is a short-lived JWT that proves the request comes from your API client. Create a new one for every token request.

sub is your API client ID

Put your API client ID in sub, as a string. The identity you want to act as goes in the request body, not in the JWT.

PartFieldValue
HeaderalgRS256 (RS384, RS512, and PS256 to PS512 also work)
HeadertypJWT
PayloadsubYour API client ID, as a JSON string, for example "${API_CLIENT_ID}". Required
PayloadissYour API client ID again. Recommended
PayloadiatCurrent time, Unix seconds
Payloadexpiat + 300 or less (5 minutes)
SignatureSigned with the private key whose certificate you uploaded to this API client
// Header
{ "alg": "RS256", "typ": "JWT" }

// Payload
{
"sub": "${API_CLIENT_ID}",
"iss": "${API_CLIENT_ID}",
"iat": 1793715390,
"exp": 1793715690
}
Keep IDs as strings

Weavr IDs are longer than JavaScript can hold exactly as numbers. Send sub as a string; as a number it can lose its last digits and no longer match your API client.

Node.js (jose)​

import { readFileSync } from "node:fs";
import { importPKCS8, SignJWT } from "jose";

const apiClientId = process.env.WEAVR_API_CLIENT_ID; // string
const privateKey = await importPKCS8(
readFileSync("private-key.pem", "utf8"),
"RS256",
);

const clientAssertion = await new SignJWT({})
.setProtectedHeader({ alg: "RS256", typ: "JWT" })
.setSubject(apiClientId)
.setIssuer(apiClientId)
.setIssuedAt()
.setExpirationTime("5m")
.sign(privateKey);

importPKCS8 needs a key starting with -----BEGIN PRIVATE KEY-----, which is what the preceding openssl req command produces. For an older -----BEGIN RSA PRIVATE KEY----- file, convert it first:

openssl pkcs8 -topk8 -nocrypt -in old-key.pem -out private-key.pem

Python (PyJWT)​

import os, time
import jwt # pip install "pyjwt[crypto]"

api_client_id = os.environ["WEAVR_API_CLIENT_ID"] # string
with open("private-key.pem", "rb") as f:
private_key = f.read()

now = int(time.time())
client_assertion = jwt.encode(
{"sub": api_client_id, "iss": api_client_id, "iat": now, "exp": now + 300},
private_key,
algorithm="RS256",
headers={"typ": "JWT"},
)

To inspect an assertion while debugging, decode its header and payload only, for example with jwt.decode(token, options={"verify_signature": False}). Never paste a full signed assertion or your private key into a support ticket or an online tool.

Get an access token and call the API​

Exchange the client assertion for an access token scoped to your corporate identity, then call the API with it.

1. Request an access token​

Call POST/access_token with the client assertion and your corporate identity:

POST https://sandbox.weavr.io/multi/access_token
api-key: ${YOUR_API_KEY}
Content-Type: application/json

{
"identity": {
"type": "CORPORATE",
"id": "${CORPORATE_ID}"
},
"clientAssertion": "${CLIENT_ASSERTION}"
}
FieldValue
api-key headerThe API key of the same programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes. as the API client
identity.typeAlways CORPORATE
identity.idYour corporate identity ID, as authorized by Weavr on that programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.
clientAssertionThe signed JWT from the previous step

The response contains the access token in token. See POST/access_token for the full schema.

2. Call the API​

GET https://sandbox.weavr.io/multi/managed_cards
api-key: ${YOUR_API_KEY}
Authorization: Bearer ${ACCESS_TOKEN}

The token acts as your corporate identity, within the operations agreed with Weavr. Agreed endpoints don't ask for an SCASCA (Strong Customer Authentication). Strong Customer Authentication - a two-factor authentication solution required by PSD2 regulations for when end-users are accessing their payment account sensitive information or initiating transactions. SCA requires at least two of the following: something you know (password), something you have (device), or something you are (biometrics). step-up.

Token lifetime​

There is no refresh endpoint. When a token expires, create a new client assertion and request a new token. Cache the token and reuse it while it's valid, rather than requesting one per call.

Errors and troubleshooting​

Most failures come from a file that isn't a certificate, or from IDs that belong to different programmesProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes..

Certificate upload​

ResponseCauseFix
409 INVALID_CERTIFICATEThe file isn't a single, complete X.509 certificate with an RSA key: a public key, private key, chain, truncated file, or EC keyRun the openssl x509 check and upload certificate.pem whole
409 CERTIFICATE_NO_EXPIRY_DATEThe certificate has no expiry dateGenerate it with -days set
409 LIMIT_EXCEEDEDThe API client already has 5 active certificatesDelete one you no longer use
403Certificate management isn't enabled for your account, or you lack the API client management permissionContact our support team

Token request​

These errors come from POST/access_token.

ResponseCauseFix
400 Invalid assertion. Expected a valid JWTclientAssertion isn't a well-formed signed JWTCheck the JWT has three Base64URL parts and the claims described in this guide
400 Invalid assertion subjectsub isn't an API client ID, for example it holds an identity ID or a namePut your API client ID in sub
400 Invalid assertion - no matching certificate registeredNo active certificate on that API client verifies the signature: no certificate uploaded to this client, signed with a different private key, unsupported alg, or the certificate has expiredUpload the certificate to this client, compare the moduli, and sign with RS256
403 INSUFFICIENT_PERMISSIONSThe assertion is valid, but the request doesn't line up: the API key, API client, and corporate are from different programmesProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.; identity.type isn't CORPORATE; or the corporate isn't authorized on the programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes.Use the API key and corporate of the programmeProgrammeA programme represents your application within Weavr. Everything you create - customers, instruments, and transactions - sits beneath a programme. When you register as an Embedder, you receive a programme in the Sandbox and, once approved, one in Live. A programme is not a Workspace: a workspace is your company's account, and it can hold several programmes. the API client belongs to

Calling the API​

ResponseCauseFix
401Token missing or expiredRequest a new token
403 INSUFFICIENT_PERMISSIONSThe operation isn't in the set agreed for your API clientContact our support team to add it