Skip to main content
BVNK

Automate fiat-to-crypto transfers

Create payment rule​

To create a rule that links a fiat virtual account to a crypto blockchain address, send the POST /payment/v1/rules request with the following payload.

Note the following important parameters:

  • trigger specifies the originating event which triggers this automated action. For fiat-to-crypto on-ramping, use payment:payin:fiat.
  • customerIdentifier is the unique identifier of the customer.
  • legalEntityIdentifier is the company's Legal Entity Identifier. It's included with every payout made by the rule. Optional, companies only.
Wallet validation

When you create a payment rule to automatically on-ramp funds to a blockchain address, BVNK validates the address format. This ensures that funds converted to crypto settle successfully.

New: Legal Entity Identifier (LEI)

Company beneficiaries can now include their LEI in legalEntityIdentifier. It's optional and applies to all accounts. If you send it, it must be a valid 20-character LEI (ISO 17442). A blank value is refused.

Example request for Company
{
"reference": "REF558628",
"trigger": "payment:payin:fiat",
"walletId": "a:00045329329347:HsdJVh0:1",
"fees": {
"customerFee": {
"amount": 0.5,
"currency": "USD"
}
},
"beneficiary": {
"currency": "USDT",
"entity": {
"type": "COMPANY",
"customerIdentifier": "9401203948572394595",
"legalName": "3Com",
"relationshipType": "SELF_OWNED",
"registrationNumber": "ABC21D21FZC",
"legalEntityIdentifier": "74780082BJHJ5YN85Y44",
"address": {
"addressLine1": "Champs-Élysées 101",
"addressLine2": "Apartment 3B",
"city": "Paris",
"postalCode": "75008",
"country": "FR"
}
},
"cryptoAddress": {
"network": "ETHEREUM",
"address": "0x12323542636474747",
"tag": "332455"
}
}
}

Upon successful linking of the fiat virtual account to the blockchain address, the API returns an HTTP 200 OK status code along with a JSON object confirming the operation.

{
"id": "000020ba-634d-4538-8596-05dd27c3b2b6",
"reference": "REF558628",
"trigger": "payment:payin:fiat",
"status": "ACTIVE",
"fees": {
"customerFee": {
"amount": 0.5,
"currency": "USD"
}
},
"originator": {
"currency": "USD",
"walletId": "acc:00041242429000:3MPp0:0"
},
"beneficiary": {
"currency": "USDT",
"entity": {
"legalName": "3Com",
"type": "COMPANY",
"relationshipType": "SELF_OWNED",
"registrationNumber": "ABC21D21FZC",
"address": {
"addressLine1": "Champs-Élysées 101",
"addressLine2": "Apartment 3B",
"city": "Paris",
"region": "Île-de-France",
"postCode": "75008",
"country": "FR"
}
},
"cryptoAddresses": {
"network": "ETHEREUM",
"addresses": [
"0x12323542636474747"
],
"tag": "332455"
}
},
"metadata": {},
"updatedAt": "2025-07-01T13:31:02.52.000000000Z",
"createdAt": "2025-07-01T13:30:02.52.000000000Z"
}

Whenever funds land into your wallet (identified by the walletId in the response), the system automatically converts them to the specified crypto and sends them to the specified blockchain address (detailed in cryptoAddresses.addresses).

Handle errors​

If the operation was not successful, the API returns an HTTP 400 BAD REQUEST status code along with a JSON error code. See the Errors reference for details.

{
"code": "bvnk:payment:rules:4002",
"status": "BAD_REQUEST",
"message": "Address validation error"
}

If a legalEntityIdentifier is sent but isn't valid, the request is rejected with HTTP 400. The details.errors object names the field.

Example of Failed Request: Invalid LEI
{
"code": "bvnk:0000",
"traceId": "6b1114a02c468a2a7e77edbd72e89662",
"status": "Bad Request",
"message": "Validation failed",
"details": {
"documentLink": null,
"errors": {
"beneficiary.entity.legalEntityIdentifier": [
"must be a valid ISO 17442 Legal Entity Identifier"
]
}
}
}

Update payment rule​

To change a previously created payment rule, send the PATCH payment/v1/rules/{id} request with the id received in the successful response earlier, here, 000020ba-634d-4538-8596-05dd27c3b2b6.

In the request body, specify only properties that you want to update. The omitted fields will remain unchanged, and sending a null for a nullable property will clear it.

See the example payloads for different use cases:

{
"fees": {
"customerFee": {
"amount": 3.5,
"currency": "USD"
}
}
}

For legalEntityIdentifier, leaving it out or sending null keeps the stored value.

Deactivate payment rule​

To activate or deactivate a payment rule, send the POST /payment/v1/rules/{id}/action request with the id received in the successful response earlier, here, 000020ba-634d-4538-8596-05dd27c3b2b6.

To activate a payment rule, send the POST /payment/v1/rules/{id}/action request with the id received in the successful response earlier, here, 000020ba-634d-4538-8596-05dd27c3b2b6.

{
"type": "ACTIVATE"
}

Only one rule can be active for the same wallet. You can deactivate a rule and create another one for that wallet. However, if you activate the first wallet again, it won't be applied.

Payment webhooks​

To receive notifications about operations, use the following webhooks:

For more information about webhooks, refer to Configure webhooks.

Was this page helpful?