Skip to content

Instantly share code, notes, and snippets.

@edward-hsu-1994
Last active September 8, 2021 15:10
Show Gist options
  • Save edward-hsu-1994/fc481de5c763573d132eeb89e0ba4843 to your computer and use it in GitHub Desktop.
Save edward-hsu-1994/fc481de5c763573d132eeb89e0ba4843 to your computer and use it in GitHub Desktop.
Zoura筆記
https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/BA_Orders_Object_Model
https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/A_Zuora_Billing_business_object_model/Introduction_to_Account_object
https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders/Order_Actions
https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/A_Zuora_Billing_business_object_model
https://www.zuora.com/vision/9-keys-subscription-business-success/
https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders
https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AC_Orders_Tutorials/D_Remove_a_Product_from_a_Subscription
https://knowledgecenter.zuora.com/Billing/Subscriptions/Product_Catalog/B_Charge_Models

訂單(Order)

使用訂單可以簡化交易預定流程,搭配多個不同的訂單操作(Order Action)可以建立複雜的交易結構,便於管理。

訂單的組成

  1. 訂單本體(Order): 與客戶合約,可以影響同一個發票擁有者帳號的多個Subscription或Order Line Items,而這些項目可以由多個客戶擁有。
  2. 訂單的操作(Order Action): Create Subscription、Addition Product、Renewal,每張訂單可有多個操作並且個別操作可對一個Subscription操作
  3. 訂單數量變化(Order Delta Metrics): 異動量
  4. 基於訂單的項目(Order Line Items): 一次性費用之類的

Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders

訂單生命週期

image

image

訂單狀態:

  • Executing
  • Complete
  • Canceled

Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/Order_Line_Items/AB_Order_Line_Item_States_and_Order_States

處理中訂單的限制

** 一個訂閱只能有一個處理中的訂單 **

  • Create Subscription: 該訂單中不可以有其他類型操作,但這張單可以建立多個Subscription
  • Renew: 該訂單只能有一個續訂訂單操作,僅支援一個訂閱
  • Add and Remove Product: 對於每個RatePlan而言,只能有一個Add 或 Remove操作,而且這張單只支援一個訂閱

Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AA_Overview_of_Orders/Pending_Order_and_Subscription

訂單的操作(Order Action)

  • 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/Orders/AC_Orders_Tutorials/AA_Create_a_Subscription

Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Subscriptions/A_Subscription_Introduction

Ref. https://knowledgecenter.zuora.com/Central_Platform/API/G_SOAP_API/E1_SOAP_API_Object_Reference/Subscription

續訂

續訂的訂單需要具備: 訂單客戶、要操作的訂閱ID

order:
  orderDate: "20220908"
  customerAccount: "user1"
  subscriptions:
    - subscriptionNumber: "Sub001"
      orderActions:
        - type: "RenewSubscription"
          triggerDates: 
            - name: "effective"
              triggerDate: "20220908"

Ref. https://knowledgecenter.zuora.com/Billing/Subscriptions/Orders/AC_Orders_Tutorials/C_Renew_a_Subscription_and_Upgrade_a_Product

加入產品

加入產品的訂單需要具備: 訂單客戶、要操作的訂閱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

訂閱(Subscription)

subscriptionNumber: "S-0001"
customerName: "OOO"
status: active # Draft, Pending Activation, Pending Acceptance, Active, Pending, Expired, Cancelled, Suspended
initialTerm:

currentTerm:

renewalTerm:
autorenew: false
notes: ""
version: 1
products: 
  - 上網
  - 看電視(第四台+高畫質套餐)
  - myVideo
ratePlans:
  - 網路門市限定
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment