This topic describes how to set up your Rebilly environment and add data needed to process transactions such as products, pricing plans, customers, and orders.
To process transactions, you must have at least one payment gateway configured in your Rebilly account. If you are testing in the sandbox environment, a test payment gateway called TestProcessor
is already configured. For more information, see Set up a payment gateway.
To route transactions dynamically between payment gateways based on real-time data and selected parameters, see Payment gateway routing.
Payment methods that are displayed in payment forms, such as payment cards and digital wallets, are configured when setting up a gateway account. If you are testing in the sandbox environment, configure payment methods to display in the TestProcessor
gateway.
- To add a digital wallet, such as Google Pay™, Apple Pay, or Samsung Pay, as a payment method, see Set up digital wallets.
- To add other payment methods, such as ACH, PayPal, and more, see Set up a payment gateway.
To learn about payment method automation, such as payment method display order and display payment methods by location, see Payment method automations.
To process payouts, you must have an active payment gateway with payout settings configured. This process describes how to activate the ready to payout instruction on the TestProcessor
payment gateway in the sandbox environment.
The TestProcessor
payment gateway is automatically configured in the sandbox environment when you sign up to Rebilly. For more information on payment gateway settings, see Set up a payment gateway.
- Log in or sign up to Rebilly.
- In the left navigation bar, press Settings .
- In the Configuration section, press Gateway accounts.
- In the ID column, press TestProcessor.
- In the right of the page, press Edit gateway account.
- Scroll down to the Ready to payout instruction section, and turn on the Activate this gateway for payouts toggle.
- Select one of the following options:
- Covered payout: Use this gateway if it previously processed a payment for the same, or a greater, amount.
- Approved payments: Use this gateway if it previously processed a payment for the same amount. The customer must have a previously approved transaction, in the same currency, on this gateway.
- All payments: Use this gateway for any amount.
- Scroll to the bottom of the page and press Save gateway account.
Learn how to get your website ID, organization ID, and API keys in your Rebilly sandbox account.
When you first log in to Rebilly, you create an organization as part of the setup process. A default website is created when a new organization is created. For more information, see Organizations and websites.
Obtain your organization ID and website ID
- Log in or sign up to Rebilly.
- In the left navigation bar, press Settings .
- In the Management section, press My organization & websites.
- In the Organization details section, note the ID value.
- In the Website section, note the ID value.
Obtain your publishable API key
- Log in or sign up to Rebilly.
- In the left navigation bar, press Automations .
- In the Development section, press API keys.
- Optionally, if you have not created a publishable key:
- In top right of the screen, press Create API key.
- In the API key type section, select Publishable.
- Optionally, in the Organizations dropdown, select the organizations that can use the API key.
- Optionally, in the Allowed IPs field, enter the IP addresses that are permitted to use the API key.
- Press Save API key.
- Go to the API keys page.
- Select a publishable key and copy the Key value.
Obtain your secret API key
- Log in or sign up to Rebilly.
- In the left navigation bar, press Automations .
- In the Development section, press API keys.
- Optionally, if you have not created a secret key:
- In top right of the screen, press Create API key.
- In the API key type section, select Secret.
- Optionally, in the Organizations dropdown, select the organizations that can use the API key.
- Optionally, in the Allowed IPs field, enter the IP addresses that are permitted to use the API key.
- Press Save API key.
- Go to the API keys page.
- Select a secret key and copy the Key value.
This section describes how to add data to your sandbox environment using the Rebilly API.
This API interaction creates a product in your Rebilly sandbox account. For more information, see Create a product.
To create a product you must have your Rebilly website ID, organization ID, and secret API key. For more information, see Obtain IDs and API keys.
How to use the interactive example
- Enter your organization ID:
- Beneath the Environment field, press
{{server}}
. - Beneath the URL, press Show nested variables, then press Edit.
- In the Value field, enter your organization ID and press Save.
- Beneath the Environment field, press
- Enter your secret API key:
- Press Security.
- In the API key field, press
{{SecretApiKey}}
, then press Set value. - In the Value field, enter your secret Rebilly sandbox API key and press Save. For more information, see Obtain IDs and API keys.
- Optionally, to change the product details, press Body.
- Press Send.
The id
value from this response is used in Create a pricing plan.
This API interaction creates a pricing plan for a product in your Rebilly sandbox account. For more information, see Create a plan.
To create a pricing plan, you must have a product ID. For more information, see Create a product.
How to use the interactive example
- Enter your organization ID:
- Beneath the Environment field, press
{{server}}
. - Beneath the URL, press Show nested variables, then press Edit.
- In the Value field, enter your organization ID and press Save.
- Beneath the Environment field, press
- Enter your secret API key:
- Press Security.
- In the API key field, press
{{SecretApiKey}}
, then press Set value. - In the Value field, enter your secret Rebilly sandbox API key and press Save. For more information, see Obtain IDs and API keys.
- Enter the product ID from the Create a product response.
- Press Body.
- In the
productId
field, enter theid
value from the Create a product response. - Optionally, change the plan details.
- Press Send.
For the purposes of this tutorial, you must create a customer in your system. A deposit request must be associated with a customer.
This API operation prevents duplicate customers. If the customer already has an identifier within your system, that customer is updated. If the customer does not have an identifier, a new customer is created.
For detailed information about this API operation, see Upsert a customer.
How to use the interactive example
- Enter your organization ID:
- Beneath the Environment field, press
{{server}}
. - Beneath the URL, press Show nested variables, then press Edit.
- In the Value field, enter your organization ID and press Save.
- Beneath the Environment field, press
- Enter your secret API key:
- Press Security.
- In the API key field, press
{{SecretApiKey}}
, then press Set value. - In the Value field, enter your secret Rebilly sandbox API key and press Save. For more information, see Obtain IDs and API keys.
- Enter a customer ID:
- In the URL field beneath the Environment field, press
{{id}}
. - Press Set value.
- In the Value field, enter a customer ID.
Example:cus_01HDP7FFX2PGDVH1995EA4QY95
.
- In the URL field beneath the Environment field, press
- Enter your website ID:
- Press Body.
- In the
websiteId
, enter your website ID. - Optionally, change the customer details.
- Press Send.
Take note of theid
value from this response. This value is used as thecustomerId
later in this tutorial.
This API interaction creates an order in your Rebilly sandbox account.
To create an order, you must have a customer ID and a plan ID. For more information, see Create a customer and Create a pricing plan.
How to use the interactive example
- Enter your organization ID:
- Beneath the Environment field, press
{{server}}
. - Beneath the URL, press Show nested variables, then press Edit.
- In the Value field, enter your organization ID and press Save.
- Beneath the Environment field, press
- Enter your secret API key:
- Press Security.
- In the API key field, press
{{SecretApiKey}}
, then press Set value. - In the Value field, enter your secret Rebilly sandbox API key and press Save. For more information, see Obtain IDs and API keys.
- Enter the customer ID, plan ID, and website ID:
- Press Headers, then in the
Organization-Id
field, enter your organization ID. - Press Body.
- In the
customerId
field, enter theid
value from the create a customer response. - In the
id
field, enter theid
value from the create a pricing plan response. - In the
websiteId
field, enter your website ID.
- Press Headers, then in the
- Press Send.