Create Customer with Auto Subscribe
Run in Apidog
This API endpoint allows you to create a new customer and automatically subscribe them to a specified plan in a single request. It simplifies the process by combining customer creation and subscription activation into one step. Request Parameters# company_id
(string, required): The unique identifier of the company.
country_id
(string, required): The unique identifier of the country.
Authorization
(string, required): The authorization token in the format Bearer
.
Content-Type
(string, required): The content type of the request, should be application/json
.
email
(string, required): The email address of the customer.
customer_identifier
(string, required): A unique identifier for the customer.
first_name
(string): The first name of the customer.
last_name
(string): The last name of the customer.
phone
(string): The phone number of the customer.
state_code
(string): The state code of the customer's location.
city
(string): The city of the customer's location.
zipcode
(string): The ZIP code of the customer's location. required if country_code
is USA
trial_days
(number): Use this parameter to specify custom trial days, overriding the default value.
plan_id
(string): Use this parameter to specify auto assign plan on sign up, overriding the default value.
Request Provide your bearer token in the Authorization
header when making requests to protected resources. Example: Authorization: Bearer ********************
Example: Bearer {{AUTH_TOKEN}}
Body Params application/json
customer_identifier
string
required
{
"email" : "onkar.kore@stykite.com" ,
"customer_identifier" : "{{CUSTOMER_IDENTIFIER}}" ,
"first_name" : "Onkar" ,
"last_name" : "Kore" ,
"phone" : 8149712450 ,
"country_code" : "IN" ,
"state_code" : "KA" ,
"city" : "Bangalore" ,
"zipcode" : 416013
}
Request samples curl --location -g --request POST 'https://sandbox.api.stykite.com/v1/company/COM-0FR3TQHKW0YBJ/country/CON-0AZZVPQHM475V/customer' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJvbmthci5rb3JlQHN0eWtpdGUuY29tIiwiaWF0IjoxNzE1NzM2MzY1LCJleHAiOjQ4Mzk3ODc1NjV9.4-0nnrj9SQKmgIFvSnuASttviX1KlOj6YbgSb52ONNTU-emzJlGpQ1mk7ol1qUY1PFMOQmV_alrpKytPwcnGsg' \
--header 'content-type: application/json' \
--data-raw '{
"email": "onkar.kore@stykite.com",
"customer_identifier": "c56164ad-3d54-4eaa-ae3d-46fe3969972b",
"first_name": "Onkar",
"last_name": "Kore",
"phone": 8149712450,
"country_code": "IN",
"state_code": "KA",
"city": "Bangalore",
"zipcode": 416013
}'
Responses application/json Generate Code
customer_identifier
string
required
{
"status" : true ,
"value" : {
"email" : "onkar.kore@stykite.com" ,
"firstName" : "Onkar" ,
"lastName" : "Kore" ,
"phone" : "8149712450" ,
"address" : {
"city" : "Bangalore" ,
"country" : "India" ,
"line1" : null ,
"line2" : null ,
"state" : "Karnataka" ,
"city_code" : "Bangalore" ,
"country_code" : "IN" ,
"postal_code" : "416013" ,
"state_code" : "KA"
} ,
"tsid" : "CUS-0G9HCNK3E4P1Y" ,
"customer_identifier" : "c56164ad-3d54-4eaa-ae3d-46fe3969972b" ,
"created_at" : 1717837601565 ,
"updated_at" : 1717837601565 ,
"company_tsid" : "COM-0FR3TQHKW0YBJ" ,
"country_tsid" : "CON-0AZZVPQHM475V"
}
}
Modified at 2025-02-15 17:20:12