Create new organizations

Software platforms may need to create new organizations on behalf of another merchant.

In about 10 minutes, this guide will walk through API requests to create a new organization and connect a gateway account:

  1. create an organization
  2. connect a gateway account

To do this, you should have already gone through the getting ready prerequisites.

Create an organization

First, we'll create the organization.

You'll need:

  • The name of the organization
  • A website address for the organization
  • Your secret API key
info

The API key will be pre-populated if you are logged into the Rebilly app in the sandbox environment.

Go to the create organization API, and use the "Try it" console to create your organization.

Body

Only a few pieces of information are required at this point. In this example, we are using PetFlix as our organization.

Replace "PetFlix" with your desired organization name and replace "petflix.club" with the new website address.

Specify the country and the reporting currency.

Optionally, you may provide additional information like a full address and email, but it is not required.

info

A full address is required to use our tax calculations.

Copy
Copied
{
  "name": "PetFlix",
  "website": "https://www.petflix.club",
  "country": "US",
  "reportCurrency": "USD"
}

Parameters

In the parameters tab, add your secret API key (if it is not already pre-populated).

warning

Before you click send, be sure that your target is set to the correct environment. The target is set as the sandbox server by default.

Click send to submit your request.

Response

We created the organization. Now, let's inspect that API response.

The organization has an id. Store the organizationId to your clipboard, you will need it in the next step.

In the Rebilly app, you can see your new organization is now available in the organization switcher:

organization switcher

Create a gateway account

You'll need:

  • The organizationId for the organization created in the previous step
  • Credentials or settings, dependent on the gateway account you are trying to connect. In this example, we'll use Stripe.

Go to the create gateway account API, and use the "Try it" console to create your gateway account.

Body

Specify one or more currencies that will be accepted by this gateway account. In this example we will use USD and CAD.

Specify the payment method you will accept using this gateway account. In this example, we will use payment-card and specify the paymentCardSchemes.

The required settings for Stripe is a redirectUrl where the user will be redirected after completing the off site gateway account verification. The link for the offsite verification is the onBoardingUrl found in the response.

Optionally, you may specify advanced configurations like additional filters and the approval window TTL, but they are not required.

Copy
Copied
{
  "gatewayName": "Stripe",
  "acceptedCurrencies": [
    "USD", "CAD"
  ],
  "method": "payment-card",
  "paymentCardSchemes": [
    "Visa", "MasterCard", "American Express", "Discover"
  ],
  "settings": {
    "redirectUrl": "https://www.example.com",
  }
}

Parameters

In the parameters, enter the organizationId for the organization created in step 1.

warning

Before you click send, be sure that your target is set to the correct environment. The target is set as the sandbox server by default.

Click send to submit your request.

Response

Now let's take a look at the gateway account created response.

For Stripe, you'll see that the gateway account is created in a pending status. The merchant must follow the onBoardingUrl to complete the gateway account set up process.

onBoardingUrl

Follow the onBoardingUrl to connect your Stripe gateway account. When finished, the user will be redirected to the URL specified as the redirectUrl.

The gateway account is active and the organization is ready to start processing payments!