Method: subscriptions.insert
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tạo hoặc chuyển gói thuê bao.
Tạo gói thuê bao cho tài khoản khách hàng mà bạn đã đặt bằng phương thức Đặt tài khoản khách hàng mới. Để biết thêm thông tin về cách tạo gói thuê bao cho các gói thanh toán khác nhau, hãy xem bài viết quản lý gói thuê bao.\
Nếu bạn không đặt hàng tài khoản của khách hàng bằng phương thức chèn khách hàng, hãy sử dụng customerAuthToken
của khách hàng khi tạo gói thuê bao cho khách hàng đó.
Nếu bạn chuyển một gói thuê bao G Suite có liên kết với gói thuê bao Google Drive hoặc Google Vault, hãy sử dụng tính năng thao tác hàng loạt để chuyển tất cả các gói thuê bao này. Để biết thêm thông tin, hãy xem cách chuyển gói thuê bao.
Yêu cầu HTTP
POST https://reseller.googleapis.com/apps/reseller/v1/customers/{customerId}/subscriptions
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
customerId |
string
Đây có thể là tên miền chính của khách hàng hoặc giá trị nhận dạng duy nhất của khách hàng. Nếu tên miền của khách hàng thay đổi, bạn không thể sử dụng tên miền cũ để truy cập vào khách hàng đó, nhưng bạn luôn có thể sử dụng giá trị nhận dạng duy nhất của khách hàng (do API trả về). Bạn nên lưu trữ giá trị nhận dạng duy nhất trong hệ thống của mình (nếu có).
|
Tham số truy vấn
Thông số |
customerAuthToken |
string
Chuỗi truy vấn customerAuthToken là bắt buộc khi tạo tài khoản được bán lại để chuyển gói thuê bao của khách hàng trực tiếp hoặc chuyển gói thuê bao của khách hàng đại lý khác sang tài khoản quản lý đại lý của bạn. Đây là mã thông báo xác thực thập lục phân cần thiết để hoàn tất quá trình chuyển gói thuê bao. Để biết thêm thông tin, hãy xem trung tâm trợ giúp dành cho quản trị viên.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Subscription
.
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một thực thể Subscription
mới tạo.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/apps.order
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-25 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 UTC."],[],[],null,["# Method: subscriptions.insert\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates or transfer a subscription.\n\nCreate a subscription for a customer's account that you ordered using the [Order a new customer account](/workspace/admin/reseller/v1/reference/customers/insert) method. For more information about creating a subscription for different payment plans, see [manage subscriptions](/workspace/admin/reseller/v1/how-tos/manage_subscriptions#create_subscription).\\\\\n\nIf you did not order the customer's account using the customer insert method, use the customer's `customerAuthToken` when creating a subscription for that customer.\n\nIf transferring a G Suite subscription with an associated Google Drive or Google Vault subscription, use the [batch operation](/workspace/admin/reseller/v1/how-tos/batch) to transfer all of these subscriptions. For more information, see how to [transfer subscriptions](/workspace/admin/reseller/v1/how-tos/manage_subscriptions#transfer_a_subscription).\n\n### HTTP request\n\n`POST https://reseller.googleapis.com/apps/reseller/v1/customers/{customerId}/subscriptions`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customerId` | `string` This can be either the customer's primary domain name or the customer's unique identifier. If the domain name for a customer changes, the old domain name cannot be used to access the customer, but the customer's unique identifier (as returned by the API) can always be used. We recommend storing the unique identifier in your systems where applicable. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `customerAuthToken` | `string` The `customerAuthToken` query string is required when creating a resold account that transfers a direct customer's subscription or transfers another reseller customer's subscription to your reseller management. This is a hexadecimal authentication token needed to complete the subscription transfer. For more information, see the [administrator help center](//support.google.com/a/bin/answer.py?answer=142336). |\n\n### Request body\n\nThe request body contains an instance of [Subscription](/workspace/admin/reseller/reference/rest/v1/subscriptions#Subscription).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Subscription](/workspace/admin/reseller/reference/rest/v1/subscriptions#Subscription).\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/apps.order`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]