Tutorial: Renew Custom Domain Name Using API
This tutorial introduces the request parameters and provides a request example to show you how to renew Custom Domain Name using API.
Before you begin: Understand the request parameters
Before renewing Custom Domain Name using API, we recommend that you read the table below to understand the request parameters and collect the corresponding values.
| Item | Parameter | Description |
|---|---|---|
| Operation Type | operationType |
The operation type. In this scenario, the value is fixed at
|
| Product ID | productId |
Specify the product that you want to renew. The Product ID
for Add-on Service is |
| Partner ID | partnerId |
Specify the user for whom you want to renew Custom Domain
Name. Note: This parameter is required
only when you renew for a subordinate user. You will need to
query the information as described in the following
steps. |
| Billing Contact ID | billingId |
Specify the contact who can receive the invoice after you
renew Custom Domain Name. You will need to query the Billing Contact ID as described in the following steps. |
| Service Type | serviceType |
The service type. In this scenario, the value is fixed at
|
| Service ID | serviceId |
Specify the specific service that you want to renew. You will need to query the Service ID for Custom Domain Name as described in the following steps. |
| Purchase Type | purchaseType |
The purchase type. In this scenario, the value is fixed at
|
| Quantity | quantity |
Specify the number of custom domain names that you want to renew. |
| Billing Model | billingModel |
The billing model. In this scenario, the value is fixed at
|
| Billing Cycle | billingCycle |
The billing cycle. In this scenario, the value is fixed atannually. |
| Multi Cycle | multiCycle |
The interval of recurring billing. In this scenario, the value is fixed at0. |
(Optional) Step 1. Get subordinate user ID
- Make a request to the Query Subordinate User List API endpoint.
GET {base_url}/user/openapi/user/v1/client/partner_list - Note down the returned value of
partnerIdfor the desired subordinate user.
Step 2. Get service ID
- Make a request to the Query Available Subscription / Trial Plans and Services for a Product API endpoint with the Product ID
19.GET {base_url}/pricing/openapi/purchase/v1/purchase_product_info?productId=19 - Note down the returned value of
serviceIdfor Custom Domain Name.
Step 3. Get billing contact ID
- Make a request to the Query Billing Contact List API endpoint.
GET {base_url}/user/openapi/user/v1/client/billing_contact_list - Note down the returned value of
billingContactIdfor the desired billing contact.
Step 4. Renew Custom Domain Name
Make a request to the Create an Order API endpoint with the collected values.
POST {base_url}/order/openapi/order/v1/save
In this tutorial, the values we collect are shown below:
| Item | Parameter | Value |
|---|---|---|
| Operation Type | operationType |
renew_service |
| Product ID | productId |
19 |
| Billing Contact ID | billingId |
3197218168379846218 |
| Service Type | serviceType |
service |
| Service ID | serviceId |
3181927247249457152 |
| Purchase Type | purchaseType |
renew |
| Quantity | quantity |
2 |
| Billing Model | billingModel |
recurring |
| Billing Cycle | billingCycle |
annually |
| Multi Cycle | multiCycle |
0 |
The sample request to renew Custom Domain Name for 1 year is shown below:
POST /order/openapi/order/v1/save HTTP/1.1
Host: openapi.partner.yeastar.com
Content-Type: application/json
User-Agent: OpenAPI
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmVzMSJdLCJYLU1TLVVTRVIiOiJ7XCJleHByXCI6XCIwXCIsXCJ0eXBlXCI6XCJwYXJ0bmVyXCIsXCJ1Y0lkXCI6XCIzMDc2OTE1NDU0NDY4NzY3NzQ0XCIsXCJ1c2VyQ29kZVwiOlwiUGFydG5lclwiLFwidXNlcklkXCI6XCIzMDc2OTE1NDU0NDg5NzM5MjY0XCIsXCJ1c2VybmFtZVwiOlwicGFydG5lcmV4YW1wbGVAb3V0bG9vay5jb21cIn0iLCJ1c2VyX25hbWUiOiJwYXJ0bmVyZXhhbXBsZUBvdXRsb29rLmNvbSIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE3Mzk3MTc5MjYsInRva2VuX3R5cGUiOiJvcGVuYXBpIiwianRpIjoidmlzMkh0QkxaUStNQmxPbS9UdThWR1pyNFljPSIsImF1dGhvcml0aWVzIjpbIjc5Il0sImNsaWVudF9pZCI6IjE0NDI5NjM2ODBiMjM0YjA0YmRjZDVjMTZmODcyOWQ2In0.RPRoTJRkXCB4krDSwGRpUFyCfUVv2LHjIiBICA1pCiY
{
"operationType": "renew_service",
"productId": 19,
"billingId": 3197218168379846218,
"serviceList": [
{
"serviceType": "service",
"serviceId": 3181927247249457152,
"purchaseType": "renew",
"quantity": 2,
"billingModel": "recurring",
"billingCycle": "annually",
"multiCycle": 0
}
]
}
Result
The sample response is shown below:
{
"code": "success",
"detailMessage": "",
"requestId": "286f4f54c8fb10832419646b7f6c831c",
"result": {
"instanceId": "1944688",
"orderId": "1780010",
"orderNo": "XG3400805442415702016",
"orderStatus": "succeed",
"productNo": "3076913644890832896",
"transactionNo": "NJ3400805444802260993"
},
"status": 200
}