Guide to Receiving and Distributing Payments with Vibrant and ComplyPay

This guide walks you through receiving payments with Vibrant and distributing them using ComplyPay, by referring to the relevant places in Vibrant's documentation and the relevant places in ComplyPay's documentation. For Vibrant's own documentation and guides, refer to:

📘

Accepting multiple currencies with Vibrant

When you process payments in multiple currencies, Vibrant provides a dedicated account and API key for each currency. For example, if you accept payments in both EUR and DKK, you’ll receive separate credentials for each. To create a Payment Link for a DKK transaction, use the API key linked to your DKK account; similarly, use the EUR account’s API key for EUR transactions.


1. Create an Account for Each Vendor

For each vendor, create an account in ComplyPay using Create Vendor Account.

  • Store the account_identifier of the account with the vendor to create payments to it later.

Example Request Body:

{
    "iban": "DK3150519149467872",
    "currency": "EUR",
    "vendor_information": {
        "type": "INDIVIDUAL",
        "country": "DK",
        "email": "[email protected]",
        "first_name": "John",
        "last_name": "Doe",
        "reference_id": "id_123"
    }
}
{
    "iban": "DK8250517775359134",
    "currency": "EUR",
    "vendor_information": {
        "type":"COMPANY",
        "company_name": "Tabletops ApS",
        "brn": "1122334455",
        "country": "DK",
        "email": "[email protected]",
        "contact_name": "John Doe",
        "industry_title": "Wholesale of office furniture",
        "sic_code": "46650",
        "reference_id": "id_123",
    }
}

2. Accepting Payments with Vibrant

Follow the Vibrant Payment Link Guide. If you receive several currencies, make sure to use the API key for the right currency, as described in the beginning of this guide. If you want to imbed the page as an iFrame on your page, you can see how to do this in the iFrame integration section below.

Important: Ensure you add your order ID in the metadata, as shown in this example.

Once a payment is created, the response will contain a paymentIntentId.
There are two ways to track the status of the payment intent:

  1. Polling: Use Get Payment Intent to pull the payment intent every second and check its status.
  2. Webhooks: Set up a webhook to listen for payment_intent.succeeded events.

Event Example:

{
    "object": "event",
    "id": "evt_1321231231231231",
    "accountId": "acct_12313-123132-12313-123-fd13133211",
    "type": "payment_intent.succeeded",
    "data": {
        "accountId": "acct_12313-123132-12313-123-fd13133211",
        "amount": 190,
        "currency": "DKK",
        "created": 1742113082627,
        "id": "pi_123131313131",
        "invoice": "12321312311231",
        "latestCharge": "ch_213131231312321",
        "metadata": {
            "order_id": "103-194311-2560
        },
        "object": "payment_intent",
        "status": "succeeded",
        "updated": 1742113104177
    },
    "apiVersion": "v1",
    "source": "billing",
    "created": 1742113105182,
    "updated": 1742113105182
}

iFrame integration

If you want the payment page imbedded as an iFrame on your page, use the URL from the payment link as the src for the iFrame you create. A quick React implementation example is shown below.

React Implementation Example:

<div> 
  <h1>Embedded Payment</h1> 
  <iframe 
    src="{URL}" 
    sandbox="allow-forms allow-scripts allow-same-origin" 
    title="Vibrant Payment" 
    width="800" 
    height="800" 
    style="border: none;" 
    allowfullscreen
  ></iframe> 
</div>

Remember to add all attributes “allow-forms allow-scripts allow-same-origin” else some
browsers will reject to render the iFrame.


3. Distributing Payments to Vendors

Once a payment intent succeeds, follow these steps:

  1. Fetch the latest charge id, order id and payment intent id of the Payment Intent.
  2. From the order id, identify the vendors that need to be paid and retrieve their account_identifier.
  3. Use Create Payment Objects to make a payment to each of the vendor accounts that needs to receive funds.
    1. The Latest Charge ID from Vibrant's Payment Intent must be included in the Payment Object as a Reconciliation Condition with namespace Vibrant to map payouts correctly.
    2. Add the Payment Intent ID and your order ID into the payment object’s metadata for any reconciliation purposes later.

⚠️

Important Note:

The total amount of the payment objects should be less than the original payment amount.
Any remaining balance, after deducting acquirer fees, will be transferred to your Treasury account.

Example Request Body:

{  
    "amount":  amount,  
    "currency": "<currency>",  
    "payer": { "type": "SPLIT" },  
    "payee": { "id": "<account_identifier>" },  
    "iban_memo": "<your desired memo>",  
    "metadata": {
      "order_id": "<order_id>"
    },
    "conditions": [
        {"type": "Reconciled", "value": "<charge_id>"}
    ]
}
  1. When the payments are created, they need to be signed in the app, for strong customer authentication. You can do this once a day or once a week, depending on your payment flow and preference.

4. Processing Payment Objects

Once a payout from Vibrant includes the chargeId, we set this condition to true, meaning the funds for this Payment Object have been received.

  • The Payment Object will execute automatically when all conditions within the object are met. A standard condition, for all payments, is that app signing has been completed.
  • This ensures that payments are only processed when the corresponding funds are available.

The vendor’s funds will now be stored in their ComplyPay accounts.


5. Payout Funds to Bank Accounts

Vendors can withdraw their funds using one of the following methods:

1. Manual Payouts

2. Automatic Payouts

  • Vendors can be set up for automatic payouts upon receiving funds.
  • This service incurs a small fee.
  • To enable automatic payouts, contact the ComplyPay team.

Once a payout is executed, the vendor will receive the funds in their linked bank account.