Brick API Documentation
Brick API

B2C Subaccount

Server

Manage B2C client subaccounts, public key setup, and API key rotation for multi-tenant Brick integrations. These endpoints help platforms isolate client credentials and operate subaccounts under a primary Brick workspace.


[B2C Client] Setup Public Key

POST
https://sandbox.onebrick.io
/v2/payments/general/client/public-key
publicAccessToken (header)
+X-Signature (header)
+X-Timestamp (header)

Upload the public key Brick should use to encrypt B2C client credentials generated for subaccounts. Call this before creating B2C subaccounts so the returned client secret material can be handled safely by your platform. The request requires Brick authentication headers and the response confirms that the encryption key is ready for subsequent subaccount provisioning.

[B2C Client] Setup Public Key › Request Body

publicKey
​string · binary

File containing your public Key in .pem format. Max size 100KB.

[B2C Client] Setup Public Key › Responses

200

status
​integer
Default: 0
data
​
error
​
​object

[B2C Client] Create Subaccount

POST
https://sandbox.onebrick.io
/v2/payments/general/b2c/sub-accounts
publicAccessToken (header)
+X-Signature (header)
+X-Timestamp (header)

Create a B2C subaccount under your Brick workspace for a client, tenant, merchant, or business unit. Send the required customer and account details with the B2C authentication headers; Brick returns subaccount identifiers and encrypted credentials that can be stored in your platform. Use this endpoint when you need credential separation across end customers while keeping central operational control.

[B2C Client] Create Subaccount › Request Body

name
​string · required

The name of the business or individual consumer

subAccountCode
​string · required

A unique alphanumeric code (max. 5 characters) used to identify the subaccount

email
​string · required

Contact email address for the subaccount

address
​string · required

Business or residential address associated with the subaccount

picture
​string · binary

(Optional) Logo image file (max. 2 MB) to visually represent the subaccount

[B2C Client] Create Subaccount › Responses

200

No data returned

[B2C Client] Regenerate API Key

POST
https://sandbox.onebrick.io
/v2/payments/general/b2c/sub-accounts/{subAccountCode}/regenerate-api-key
publicAccessToken (header)
+X-Signature (header)
+X-Timestamp (header)

Regenerate the API key pair for an existing B2C subaccount when credentials need to be rotated, compromised, or reissued. The previous key pair is invalidated after regeneration, so update downstream services before switching traffic. Only authorized B2C owner roles should call this endpoint, and the response should be treated as sensitive credential material.

[B2C Client] Regenerate API Key › path Parameters

subAccountCode
​string · required

[B2C Client] Regenerate API Key › Responses

200

status
​integer
Default: 0
message
​string
​object