Create a Subordinate User

Create a customer.

Request URL

POST {base_url}/user/openapi/user/v1/client/save_user

Request parameters

Headers
Parameter Required Description
Content-Type Yes Specify the type of data that is sent in the body of the POST request.

Valid value: application/json.

User-Agent Yes Provide information about the user agent, such as the type of web browser, operating system, software version, etc., so as to help Yeastar Partner Portal to identify the user or the application that is making the request.

Example: User-Agent: OpenAPI.

Authorization Yes Pass the access token in the header, so as to authenticate the API request.

Format: Bearer {access_token}.

Body parameters
Parameter Required Type Description
userType Yes String User type.

Valid value: Customer

yeastarId Yes String Yeastar ID (email address).
company Yes String Company name.
country Yes String Country name.
Note: You can query country name using the Query Country List interface.
firstName No String First name.
Note: Either firstName or lastName is required.
lastName No String Last name.
Note: Either firstName or lastName is required.
phoneNumber No String Phone number.
stateProvince No String State/Province.
city No String City.
street No String Street.
zipCode No String ZIP/Postal Code.
taxType No String Tax type.
Valid value:
  • VAT_number
  • Tax_ID
  • TIN_number
  • RUC
  • CUIT
taxNum No String Tax number.
remark No String Remark.
sendUserActivationEmail No Boolean Whether to send account activation email to the user.
Valid value:
  • true: Enabled.
  • false: Disabled.

Response parameters

Parameter Type Description
code String The response message of the API request.
detailMessage String The detailed error information.

When the request is successful, this parameter returns empty.

requestId String The unique ID of the request, which can be used to quickly locate the request.
result Boolean Whether the operation is successful.
status Integer The HTTP status code of the API request.

Example

Request example

Create a customer.

POST /user/openapi/user/v1/client/save_user HTTP/1.1
Host: openapi.partner.yeastar.com
Content-Type: application/json
User-Agent: OpenAPI
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmVzMSJdLCJYLU1TLVVTRVIiOiJ7XCJleHByXCI6XCIwXCIsXCJ0eXBlXCI6XCJwYXJ0bmVyXCIsXCJ1Y0lkXCI6XCIzMDc2OTE1NDU0NDY4NzY3NzQ0XCIsXCJ1c2VyQ29kZVwiOlwiUGFydG5lclwiLFwidXNlcklkXCI6XCIzMDc2OTE1NDU0NDg5NzM5MjY0XCIsXCJ1c2VybmFtZVwiOlwicGFydG5lcmV4YW1wbGVAb3V0bG9vay5jb21cIn0iLCJ1c2VyX25hbWUiOiJwYXJ0bmVyZXhhbXBsZUBvdXRsb29rLmNvbSIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE3Mzk3MTc5MjYsInRva2VuX3R5cGUiOiJvcGVuYXBpIiwianRpIjoidmlzMkh0QkxaUStNQmxPbS9UdThWR1pyNFljPSIsImF1dGhvcml0aWVzIjpbIjc5Il0sImNsaWVudF9pZCI6IjE0NDI5NjM2ODBiMjM0YjA0YmRjZDVjMTZmODcyOWQ2In0.RPRoTJRkXCB4krDSwGRpUFyCfUVv2LHjIiBICA1pCiY

{
    "userType": "Customer",
    "yeastarId": "yaya@yeastar.com",
    
    "company": "ABC",
    "country": "China",
    "firstName": "yaya",
    "phoneNumber":"123456",
    "taxType":"VAT_number",
    "taxNum":"8888",
    "sendUserActivationEmail":true    
}
Response example
{
    "code": "success",
    "detailMessage": "",
    "requestId": "99b4f26bbcc625b98e4d4cc8658b3aeb",
    "result": true,
    "status": 200
}