---
title: Stripe Connect via Affiliate
slug: oms/stripe-connect-via-affiliate
docTags: 
createdAt: 2022-09-16T17:38:24.000Z
---

:::ExpandableHeading
### Introduction

[Stripe Connect](https://docs.stripe.com/connect/how-connect-works) allows for you to manage and route payments and payouts between sellers, customers, service providers, and other entities.

Piggybacking on Chord's [Affiliate Program](https://docs.chord.co/affiliate-programs) infrastructure, Chord allows for the routing and transfer of payments dowsntream to a connected Stripe account by enabling a few store variables in your Chord OMS and by passing the connected Stripe account's account ID (i.e. `affiliate_id`) into each line item of your order payload.

***NOTE:&#x20;***&#x54;he account ID variable (i.e. to be referred to as `affiliate_id`) ***must*** be added in the `metadata` object of each line item intended to be paid out to a Stripe Connected Account. This line-item-based set-up allows for multiple line items within an order to be paid for and paid out to separate merchants, if necessary.

### Chord OMS Store Variables to Configure

| **Affiliate**                              | <br />              | <br />                                                                                                                                                                                |
| ------------------------------------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **AFFILIATE\_COMMISSION\_PERCENTAGE**      | Integer             | The default commission amount paid on affiliate orders or line items. (defaults to `10`)                                                                                              |
| **AFFILIATE\_REVERSALS\_ENABLED**          | enabled or disabled | When enabled, when a refund is processed for an order with an associated affiliate payment, a transfer reversal will occur to reverse the commission payment.(defaults to `disabled`) |
| **AFFILIATE\_TRANSFER\_TIME\_IN\_MINUTES** | Integer             | Number of minutes after a payment is captured or a return is processed to wait before initiating the transfer or reversal with Stripe Connect. (defaults to `10`)                     |
:::

::::ExpandableHeading
### Enabling the Account ID at the Line Item Level

:::hint{type="warning"}
You must acquire your connected account's ***Account ID*** prior to this step. See steps below.
:::

In order to associate the appropriate ***Account ID&#x20;***(known moving forward as `affiliate_id`) to each line-item within your order, the *affiliate\_id* must be added to each line item's *metadata&#x20;*&#x6F;bject.

Example `Metadata` object:

```json
{
    "metadata": {
        "affiliate_id" : "acct_#######" 
    }
}
```

Example `line_items` array:

```json
"line_items": [
        {
            "id": 42790,
            ...
            "metadata": {
                "affiliate_id": "acct_111111122222333"
            },
           ...
      }
]     
```

Example of updating `line_item.metadata.affiliate_id` in addToCart (using Chord's [Update Order Line Item](https://chord.stoplight.io/docs/chord-oms/5ca7631abac5c-update-order-line-item) endpoint):

```javascript
async addToCart(cart, sku, quantity, affiliateCode, brand) {
    const url = `/api/orders/${cart.number}/line_items`

    const payload = {
      line_item: {
        sku: sku,
        quantity: quantity,
        metadata: {}
      }
    }

    if (affiliateCode) {
      payload.line_item.metadata.affilate_id = affiliateCode
    }

    const response = await axiosClient.post(url, payload)
    return response.data
  }
```
::::

::::ExpandableHeading
### Creating a Connected Account in Stripe

:::hint{type="warning"}
Proceed with the steps below if your merchant's Connected Account has *not&#x20;*&#x79;et been created.
:::

To connect a **Connected Account** in Stripe, you have to create and share an invite link with the merchant by completing the following steps:

::loom{url="https://www.loom.com/embed/a22006fff2a94006b08da5f4809d15bc"}

Click on “**Connected Accounts”** in the left panel of your stripe dashboard and click on “**Create**” to create a new invite link

Is it recommended to select “**Express** - Select your Country and click **Continue**

****

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/nNWab_RZFsv78JYUvUTBr_image-9.png" size="80" width="642" height="436" position="flex-start" showCaption="false"}

You might need to adjust a few of your settings before being able to click Continue - Navigate to your **Settings**

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/OftZQz_jQIQ9GCpwxxj74_image-11.png" size="80" width="1600" height="587" position="flex-start" showCaption="false"}



Stripe has determined some basic recommendations for creating connected accounts, for your users to receive funds on your platform. These recommended settings can be found [here](https://dashboard.stripe.com/connect/settings/profile).

‌Click Create if you had to make modifications to your settings and click Continue after selecting Express

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/IW414S-dCJ13jS9oBzSo6_image-12.png" size="84" width="904" height="806" position="flex-start" showCaption="false"}

Copy the link and share it with the affiliate so that they can follow the steps to connect to stripe.

Once copied and shared, you can select **Done.**

****
::::

:::ExpandableHeading
### Connected Account Side

The merchant will copy and paste the link to a new browser.  Then, the merchant will be taken through the following steps to provide all necessary information about their entity, such as SSN, Name, Nature of business, and Bank account info.



::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/tS-efZ7KlAFo3ot6igM1X_image-1-27-2023-at-228-pm.jpg" size="50" width="824" height="1002" position="flex-start" showCaption="false"}



Provide the name of your Company or Individual along with the phone number and email address

Click **Continue.** &#x20;

A verification code will be sent to your phone number provided.

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/kNZ-eNRgzjzQn2CnPGffB_image-1-27-2023-at-229-pm.jpg" size="50" width="806" height="824" position="flex-start" showCaption="false"}

Fill out pertinent information and click **Continue**.

Once done, you will be able to access a Dashboard in Stripe and create settings for your payouts
:::

:::ExpandableHeading
### Fetch Connected Account's Stripe Account

Once the merchant has created their stripe account, they will display under C**onnected Accounts**, along with the Status of their application.



::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/6Gcn7WEtzAhIsxsYr1DwT_image-15.png" size="88" width="1600" height="254" position="flex-start" showCaption="false"}

Once it has a Status of Complete, open that record and copy the **Account ID**
:::

:::ExpandableHeading
### Miscellaneous

By default, Stripe automatically creates payouts of your available account balance based on the schedule specified in the [Dashboard](https://dashboard.stripe.com/account/payouts). The schedule depends on your country and whether your business operates in a higher-risk industry.

When a payment is received, it’s initially reflected as a pending balance (less any Stripe fees). This balance becomes available according to your payout schedule. For instance, it takes seven calendar days from receiving payment to being paid out for Stripe accounts on a [7 calendar day](https://stripe.com/docs/payouts#standard-7-day) schedule.

Most banks deposit payouts into your bank account as soon as they receive them, though some may take a few extra days to make them available. To edit the payout, navigate to your Connected Account and click on the specific account.



::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/owgcJ304MaPCh0udcEtgl_image-4.jpeg" size="78" width="1600" height="484" position="flex-start" showCaption="false"}

Click **Edit payout schedule**

And create your own schedule&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/M0NSOoXG2wJpWn5kneUpm_image-20.png" size="80" width="1262" height="692" position="flex-start" showCaption="false"}
:::



