使用訂單可以簡化交易預定流程,搭配多個不同的訂單操作(Order Action)可以建立複雜的交易結構,便於管理。
- 訂單本體(Order): 與客戶合約,可以影響同一個發票擁有者帳號的多個Subscription或Order Line Items,而這些項目可以由多個客戶擁有。
- 訂單的操作(Order Action): Create Subscription、Addition Product、Renewal,每張訂單可有多個操作並且個別操作可對一個Subscription操作
- 訂單數量變化(Order Delta Metrics): 異動量
- 基於訂單的項目(Order Line Items): 一次性費用之類的
Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders
訂單狀態:
- Executing
- Complete
- Canceled
** 一個訂閱只能有一個處理中的訂單 **
- Create Subscription: 該訂單中不可以有其他類型操作,但這張單可以建立多個Subscription
- Renew: 該訂單只能有一個續訂訂單操作,僅支援一個訂閱
- Add and Remove Product: 對於每個RatePlan而言,只能有一個Add 或 Remove操作,而且這張單只支援一個訂閱
- Create Subscription: 建立訂閱
- Renew or Upgrade: 續訂 OR 升級
- Add Product: 加入產品
- Remove Product: 移除產品
- Cancellation: 取消訂閱
Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders/Order_Actions
以下內容有做簡化
建立訂閱的訂單先決條件須具備: 訂單客戶、產品費率計畫ID(Proudct RatePlan ID)、日期(生效日期等等)
order:
orderDate: "20210908"
customerAccount: "user1"
subscriptions:
- orderActions:
- type: "CreateSubscription"
subscribeToRatePlans:
- productRatePlanId: "有線電視附加120M上網2021促銷專案"
triggerDates: # 定義觸發器
- name: "effective" # 觸發=>生效
triggerDate: "20210908" # 時間
createSubscription:
terms:
initialTerm: # 一開始綁約一年
startDate: "20210908" # TERM起始時間
period: 12 # TERM長度
periodType: "Month", # 單位
termType: TERMED # 有期限的設定, TERMED | EVERGREEN ,該選項為TERMED時才需要設定renewalSettings
renewalSetting: "RENEW_WITH_SPECIFIC_TERM" # RENEW_WITH_SPECIFIC_TERM(照續訂期限週期續訂) | RENEW_TO_EVERGREEN(續訂後會永遠"長春")
autoRenew: false # 如果未設定為auto renew,則在TERM結束時將會過期,並不會自動renew,要手動
renewalTerms: # 後續的訂閱週期,之後半年簽約一次
- period: 6
periodType: "Month"
Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Subscriptions/A_Subscription_Introduction
續訂的訂單需要具備: 訂單客戶、要操作的訂閱ID
order:
orderDate: "20220908"
customerAccount: "user1"
subscriptions:
- subscriptionNumber: "Sub001"
orderActions:
- type: "RenewSubscription"
triggerDates:
- name: "effective"
triggerDate: "20220908"
加入產品的訂單需要具備: 訂單客戶、要操作的訂閱ID
order:
orderDate: "20230908"
customerAccount: "user1"
subscriptions:
- subscriptionNumber: "Sub001"
orderActions:
- type: "AddProduct"
addProduct:
- ratePlanId: "有線電視附加240M上網2023優惠專案"
triggerDates:
- name: "effective"
triggerDate: "20230908"
移除產品的訂單需要具備: 訂單客戶、要操作的訂閱ID
order:
orderDate: "20230908"
customerAccount: "user1"
subscriptions:
- subscriptionNumber: "Sub001"
orderActions:
- type: "RemoveProduct"
removeProduct:
- ratePlanId: "有線電視附加120M上網2021促銷專案"
triggerDates:
- name: "effective"
triggerDate: "20230908"
移除產品的訂單需要具備: 訂單客戶、要操作的訂閱ID
order:
orderDate: "20240908"
customerAccount: "user1"
subscriptions:
- subscriptionNumber: "Sub001"
orderActions:
- type: "CancelSubscription"
triggerDates:
- name: "effective"
triggerDate: "20250908"
Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AC_Orders_Tutorials/D_Cancel_a_Subscription Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Subscriptions/H_Cancellations