Skip to main content
POST
/
v1
/
customer
/
signUp
sign up
curl --request POST \
  --url https://api.unprice.dev/v1/customer/signUp \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "John Doe",
  "email": "[email protected]",
  "successUrl": "https://example.com/dashboard",
  "cancelUrl": "https://example.com/login",
  "timezone": "UTC",
  "defaultCurrency": "USD",
  "billingInterval": "month",
  "planSlug": "PRO",
  "planVersionId": "pv_1234567890",
  "config": [
    {
      "featurePlanId": "feature_plan_123",
      "featureSlug": "feature_slug_123",
      "isUsage": true,
      "units": 100
    }
  ],
  "externalId": "1234567890"
}
'
{
  "success": true,
  "url": "https://example.com/dashboard",
  "customerId": "cus_1234567890"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Body of the request

The customer sign up request

name
string
required

The name of the customer

Minimum string length: 1
Example:

"John Doe"

email
string<email>
required

The email of the customer

Minimum string length: 1
successUrl
string<uri>
required

The success url if the customer signs up. This is the url after the signup process, normally your dashboard

Example:

"https://example.com/dashboard"

cancelUrl
string<uri>
required

The cancel url if the customer cancels the signup. This is the url after the signup process, normally your login page

Example:

"https://example.com/login"

timezone
string

The timezone of the customer, if passed null the system will use the project timezone

Example:

"UTC"

defaultCurrency
enum<string>

The default currency of the customer, if passed null the system will use the project currency

Available options:
USD,
EUR
Example:

"USD"

billingInterval
enum<string>

The billing interval of the customer to be used for the subscription. If plan version is provided, the billing interval will be the same as the plan version. If plan slug is provided, the billing interval will be the default billing interval of the plan.

Available options:
month,
year,
day,
minute,
onetime
Example:

"month"

planSlug
string

If the plan id is not provided, you can pass a plan slug and the system will intelligently pick the lastest plan for that slug and sign up the customer for it

Example:

"PRO"

planVersionId
string

The plan version the customer is signing up for

Example:

"pv_1234567890"

config
object[]

The configuration of the subscription items. This is required if your features are quantity based when the customer needs to set them. Pass as empty if you want the system to automatically set the units from the plan defaults.

Example:
[
{
"featurePlanId": "feature_plan_123",
"featureSlug": "feature_slug_123",
"isUsage": true,
"units": 100
}
]
externalId
string

The external id you want to associate with the customer. Could be the id of the user in your database

Example:

"1234567890"

Response

The result of the customer sign up

success
boolean
required

Whether the signup was successful

Example:

true

url
string<uri>
required

The url to redirect the customer to, either to the success or cancel url

Example:

"https://example.com/dashboard"

customerId
string
required

The unprice customer id generated by the system for this customer

Example:

"cus_1234567890"