Create Keys
Overview
This endpoint creates a new BreB Key by submitting the request to the Visionamos - Passport Bre-B Node. It registers a linkage between a Customer
, its Account
, and a specific payment key (e.g., email, phone, alphanumeric) for use in QR code generation and payment routing.
Endpoint Details
Definition | Description |
---|---|
Endpoint | https://bre-b-sandbox.api.visionamos.passportfintech.com/v1/paas/entities/customers/accounts/keys |
Method | POST |
Headers | Content-Type: application/json, Authorization |
Authentication | Access Token (Bearer Token) |
A Key can only be created after the Customer has been onboarded (refer to Create Customer) and has an Account with the Sponsor Bank.
Request Body
Parameter | Type | Constraints | Required | Description |
---|---|---|---|---|
account_id | string | UUID | Yes | Unique identifier of the account to associate the key with. |
key_type | string | ENUM: NRIC , M , E , O , B | Yes | Type of key. Accepted values:
|
key_value | string | Varies by key_type | Yes | The actual key to be registered. |
Example Request
curl --location 'https://bre-b-sandbox.api.visionamos.passportfintech.com/v1/paas/entities/customers/accounts/keys' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"account_id": "5acacacf-23e5-434a-af80-4a91aafc1612",
"key_type": "E",
"key_value": "jimmyjohns2000@passportfintech.com"
}'
Response Body
- HTTP Status Code: 200 OK.
- The response will contain the key details along with its unique identifier.
Example of Response
{
"account_id": "5acacacf-23e5-434a-af80-4a91aafc1612",
"key_value": "jimmyjohns2000@passportfintech.com",
"id": "f36d1f30-fa14-45eb-9c11-9204f92ccd80",
"key_type": "E"
}
Common Errors and Handling
HTTP Status Code | Meaning | Description |
---|---|---|
400 Bad Request | Invalid Data | Required fields are missing or contain incorrect values. |
401 Unauthorized | Expired Token | The access token is invalid or has expired. |
403 Forbidden | Access Denied | The request is not authorized to create an Key. |
500 Internal Server Error | Server Error | An unexpected error occurred while creating the Key. |
Best Practices
- Use appropriate key types: Make sure the key type matches the format of the value (e.g.,
E
for emails). - Avoid duplicate keys across accounts: Keys must be unique per user in the system (an account may have multiple keys associated with).