Skip to main content
The REST API lets you create and activate subscriptions programmatically — the foundation of a self-serve or product-led signup flow in your own app. Every flow shares the same first three steps: create a customer, add a contact, and create a subscription. Only the final activation step differs.

Which flow would you like to build?

Checkout

Send the customer to a Salesbricks-hosted page to pay. Best for self-serve signup.

Signature

Send the customer to execute the contract by signing an order form. Best for enterprise or sales-assisted deals.

Direct start

Activate server-side with no customer interaction. Best for existing customers and migrations.

Before you begin

You will need a Public API Token and a published plan. All examples use the production base URL https://api.salesbricks.com/api/v2.
Find the plan_id and the brick_id values you want to sell with List all plans:
cURL
Send an X-SALESBRICKS-IDEMPOTENT-OPERATION-KEY header on every POST in this guide so a network retry cannot create a duplicate customer or subscription. See Idempotent Requests.

Shared steps

1

Create a customer

POST /customers creates the record representing the purchasing company. Only name is required.
cURL
JSON
Customer names must be unique. Creating a customer with a name already in use returns 400. Set external_id to your own identifier so you can find the customer again with Search customers.
Save the customer_id.
2

Add a contact

POST /customers/{customer_id}/persons adds a person to the customer. This person can be used as the subscription point of contact, the signatory, or both. first_name, last_name, email, and role are all required.
cURL
JSON
Save the person_id. The same person can act as both the point of contact and the signatory, or you can create a separate contact for each role.
3

Create the subscription

POST /subscriptions builds the agreement. These fields are all required: customer_id, point_of_contact_id, signatory_user_id, plan_id, bricks, starts_at, contract_length, and billing_frequency.
cURL
JSON
Save the subscription_id — the activation step needs it.
billing_frequency accepts MONTHLY, QUARTERLY, SEMI_ANNUALLY, ANNUALLY, or ALL_UPFRONT. contract_length is the total term in months, which is separate from how often you invoice.
Useful optional fields include currency (defaults to USD), payment_terms, auto_renews, discount_coupons, accounts_payable_emails, first_charge_date, and metadata for your own key-value data.

Preview the price first

To show a total before committing — a pricing page or an in-app plan picker — post the same body to POST /subscriptions/estimate. It returns the billing schedule and grand total without creating anything.
cURL

Activate the subscription

Pick one of the three endpoints below.

Option 1 — Hosted checkout

GET /subscriptions/{subscription_id}/checkout returns a hosted checkout URL showing the subscription summary and a payment form.
cURL
JSON
Redirect the customer to this URL, or email it to them. The subscription activates once they complete payment — listen for the order.complete webhook to provision access in your app.

Option 2 — Order form signature

POST /subscriptions/{subscription_id}/sign returns a URL where the customer signs the order form. A redirect_url is required — that is where the customer lands after signing.
cURL
JSON

Option 3 — Direct start

POST /subscriptions/{subscription_id}/start activates the subscription server-side, with no checkout or signature. Use it when the customer already has a payment method on file, or when migrating subscriptions in from another system.
cURL
A 200 response returns the full subscription detail and confirms activation.
charge_immediately takes the string yes or no, not a boolean. With yes and no default payment method on the customer, the request returns 400 — either add a payment method first, or pass charge_immediately=no.
This endpoint applies to new subscriptions only. To change an existing subscription, use upgrade to add or remove add-ons, or recast to replace the current agreement.

Common errors

Endpoint reference