Create a payment form using the Rebilly API
This tutorial describes how use the Rebilly API to create a customer, an order, and process a payment using a hosted payment form in the sandbox environment.
Rebilly hosted payment forms simplify the process of accepting payments. Rebilly hosts your payment form and ensures that your payments process is secure and PCI compliant.
The steps in this tutorial interact with the Rebilly API and enters the following required fields automatically using a demo account:
- Sandbox secret key
{process.env.PUBLIC_SANDBOX_KEY}
: entered inREB-APIKEY
header security scheme. - Sandbox
organizationId
:b952f205-4023-4484-b808-5d3a1e410751
as a server variable. - Sandbox
websiteId
:docs.redocly.com
.
To use your own values, see Get started.
Step 1: Upsert a customer
The id
value from this response is used in the next request as the customerId
value.
- Click Parameters, then in the id field, enter an ID value for a new customer.
- Click Send.
For more information, see Upsert a customer with predefined ID.
Step 2: Create an order
Use the customerId
value from the previous response as the customerId
value in this request.
The recentInvoiceId
value from this response is used in the next request.
For more information, see Create an order.
Step 3: Pay the invoice
Use the customerId
and recentInvoiceId
values from the previous response as the customerId
and invoiceIds
values in this request.
For more information, see Create a transaction.