Payments Reseller Subscription API . partners . subscriptions . lineItems

Instance Methods

close()

Close httplib2 connections.

patch(name, body=None, updateMask=None, x__xgafv=None)

Updates a line item of a subscription. It should be autenticated with a service account.

Method Details

close()
Close httplib2 connections.
patch(name, body=None, updateMask=None, x__xgafv=None)
Updates a line item of a subscription. It should be autenticated with a service account.

Args:
  name: string, Identifier. Resource name of the line item. Format: partners/{partner}/subscriptions/{subscription}/lineItems/{lineItem} (required)
  body: object, The request body.
    The object takes the form of:

{ # Individual line item definition of a subscription.
  "amount": { # Describes the amount unit including the currency code. # Output only. The price of the product/service in this line item. The amount could be the wholesale price, or it can include a cost of sale based on the contract.
    "amountMicros": "A String", # Required. Amount in micros (1_000_000 micros = 1 currency unit)
    "currencyCode": "A String", # Required. Currency codes in accordance with [ISO-4217 Currency Codes] (https://en.wikipedia.org/wiki/ISO_4217). For example, USD.
  },
  "bundleDetails": { # The bundle details for a line item corresponding to a hard bundle. # Output only. The bundle details for the line item. Only populated if the line item corresponds to a hard bundle.
    "bundleElementDetails": [ # Output only. The details for each element in the hard bundle.
      { # The details for an element in the hard bundle.
        "product": "A String", # Output only. Product resource name that identifies the bundle element. The format is 'partners/{partner_id}/products/{product_id}'.
        "userAccountLinkedTime": "A String", # Output only. The time when this product is linked to an end user.
      },
    ],
  },
  "description": "A String", # Output only. Description of this line item.
  "finiteBillingCycleDetails": { # Details for a subscriptiin line item with finite billing cycles. # Optional. Details for a subscription line item with finite billing cycles. If unset, the line item will be charged indefinitely. Used only with LINE_ITEM_RECURRENCE_TYPE_PERIODIC.
    "billingCycleCountLimit": "A String", # Required. The number of a subscription line item billing cycles after which billing will stop automatically.
  },
  "lineItemFreeTrialEndTime": "A String", # Output only. The free trial end time will be populated after the line item is successfully processed. End time of the line item free trial period, in ISO 8061 format. For example, "2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free trial promotion is specified.
  "lineItemIndex": 42, # Output only. A unique index of the subscription line item.
  "lineItemPromotionSpecs": [ # Optional. The promotions applied on the line item. It can be: - an introductory pricing promotion. - a free trial promotion. This feature is not enabled. If used, the request will be rejected. When used as input in Create or Provision API, specify its resource name only.
    { # Describes the spec for one promotion.
      "freeTrialDuration": { # Describes the length of a period of a time. # Output only. The duration of the free trial if the promotion is of type FREE_TRIAL.
        "count": 42, # number of duration units to be included.
        "unit": "A String", # The unit used for the duration
      },
      "introductoryPricingDetails": { # The details of a introductory pricing promotion. # Output only. The details of the introductory pricing spec if the promotion is of type INTRODUCTORY_PRICING.
        "introductoryPricingSpecs": [ # Output only. Specifies the introductory pricing periods.
          { # The duration of an introductory pricing promotion.
            "discountAmount": { # Describes the amount unit including the currency code. # Output only. The discount amount. The value is positive.
              "amountMicros": "A String", # Required. Amount in micros (1_000_000 micros = 1 currency unit)
              "currencyCode": "A String", # Required. Currency codes in accordance with [ISO-4217 Currency Codes] (https://en.wikipedia.org/wiki/ISO_4217). For example, USD.
            },
            "discountRatioMicros": "A String", # Output only. The discount percentage in micros. For example, 50,000 represents 5%.
            "recurrenceCount": 42, # Output only. The duration of an introductory offer in billing cycles.
            "regionCode": "A String", # Output only. 2-letter ISO region code where the product is available in. Ex. "US".
          },
        ],
      },
      "promotion": "A String", # Required. Promotion resource name that identifies a promotion. The format is 'partners/{partner_id}/promotions/{promotion_id}'.
      "type": "A String", # Output only. The type of the promotion for the spec.
    },
  ],
  "name": "A String", # Identifier. Resource name of the line item. Format: partners/{partner}/subscriptions/{subscription}/lineItems/{lineItem}
  "oneTimeRecurrenceDetails": { # Details for a ONE_TIME recurrence line item. # Output only. Details only set for a ONE_TIME recurrence line item.
    "servicePeriod": { # A description of what time period or moment in time the product or service is being delivered over. # Output only. The service period of the ONE_TIME line item.
      "endTime": "A String", # Optional. The end time of the service period. Time is exclusive.
      "startTime": "A String", # Required. The start time of the service period. Time is inclusive.
    },
  },
  "product": "A String", # Required. Product resource name that identifies one the line item The format is 'partners/{partner_id}/products/{product_id}'.
  "productPayload": { # Specifies product specific payload. # Optional. Product specific payload for this line item.
    "googleHomePayload": { # Payload specific for Google Home products. # Payload specific to Google Home products.
      "attachedToGoogleStructure": True or False, # Output only. This identifies whether the subscription is attached to a Google Home structure.
      "googleStructureId": "A String", # Optional. Structure identifier on Google side.
      "partnerStructureId": "A String", # Optional. This identifies the structure ID on partner side that the subscription should be applied to. Only required when the partner requires structure mapping.
    },
    "googleOnePayload": { # Payload specific to Google One products. # Product-specific payloads. Payload specific to Google One products.
      "campaigns": [ # Campaign attributed to sales of this subscription.
        "A String",
      ],
      "offering": "A String", # The type of offering the subscription was sold by the partner. e.g. VAS.
      "salesChannel": "A String", # The type of sales channel through which the subscription was sold.
      "storeId": "A String", # The identifier for the partner store where the subscription was sold.
    },
    "youtubePayload": { # Payload specific to Youtube products. # Payload specific to Youtube products.
      "accessEndTime": "A String", # Output only. The access expiration time for this line item.
      "partnerEligibilityIds": [ # The list of eligibility_ids which are applicable for the line item.
        "A String",
      ],
      "partnerPlanType": "A String", # Optional. Specifies the plan type offered to the end user by the partner.
    },
  },
  "recurrenceType": "A String", # Output only. The recurrence type of the line item.
  "state": "A String", # Output only. The state of the line item.
}

  updateMask: string, Required. The list of fields to update. Only a limited set of fields can be updated. The allowed fields are the following: - `product_payload.googleHomePayload.googleStructureId`
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Individual line item definition of a subscription.
  "amount": { # Describes the amount unit including the currency code. # Output only. The price of the product/service in this line item. The amount could be the wholesale price, or it can include a cost of sale based on the contract.
    "amountMicros": "A String", # Required. Amount in micros (1_000_000 micros = 1 currency unit)
    "currencyCode": "A String", # Required. Currency codes in accordance with [ISO-4217 Currency Codes] (https://en.wikipedia.org/wiki/ISO_4217). For example, USD.
  },
  "bundleDetails": { # The bundle details for a line item corresponding to a hard bundle. # Output only. The bundle details for the line item. Only populated if the line item corresponds to a hard bundle.
    "bundleElementDetails": [ # Output only. The details for each element in the hard bundle.
      { # The details for an element in the hard bundle.
        "product": "A String", # Output only. Product resource name that identifies the bundle element. The format is 'partners/{partner_id}/products/{product_id}'.
        "userAccountLinkedTime": "A String", # Output only. The time when this product is linked to an end user.
      },
    ],
  },
  "description": "A String", # Output only. Description of this line item.
  "finiteBillingCycleDetails": { # Details for a subscriptiin line item with finite billing cycles. # Optional. Details for a subscription line item with finite billing cycles. If unset, the line item will be charged indefinitely. Used only with LINE_ITEM_RECURRENCE_TYPE_PERIODIC.
    "billingCycleCountLimit": "A String", # Required. The number of a subscription line item billing cycles after which billing will stop automatically.
  },
  "lineItemFreeTrialEndTime": "A String", # Output only. The free trial end time will be populated after the line item is successfully processed. End time of the line item free trial period, in ISO 8061 format. For example, "2019-08-31T17:28:54.564Z". It will be set the same as createTime if no free trial promotion is specified.
  "lineItemIndex": 42, # Output only. A unique index of the subscription line item.
  "lineItemPromotionSpecs": [ # Optional. The promotions applied on the line item. It can be: - an introductory pricing promotion. - a free trial promotion. This feature is not enabled. If used, the request will be rejected. When used as input in Create or Provision API, specify its resource name only.
    { # Describes the spec for one promotion.
      "freeTrialDuration": { # Describes the length of a period of a time. # Output only. The duration of the free trial if the promotion is of type FREE_TRIAL.
        "count": 42, # number of duration units to be included.
        "unit": "A String", # The unit used for the duration
      },
      "introductoryPricingDetails": { # The details of a introductory pricing promotion. # Output only. The details of the introductory pricing spec if the promotion is of type INTRODUCTORY_PRICING.
        "introductoryPricingSpecs": [ # Output only. Specifies the introductory pricing periods.
          { # The duration of an introductory pricing promotion.
            "discountAmount": { # Describes the amount unit including the currency code. # Output only. The discount amount. The value is positive.
              "amountMicros": "A String", # Required. Amount in micros (1_000_000 micros = 1 currency unit)
              "currencyCode": "A String", # Required. Currency codes in accordance with [ISO-4217 Currency Codes] (https://en.wikipedia.org/wiki/ISO_4217). For example, USD.
            },
            "discountRatioMicros": "A String", # Output only. The discount percentage in micros. For example, 50,000 represents 5%.
            "recurrenceCount": 42, # Output only. The duration of an introductory offer in billing cycles.
            "regionCode": "A String", # Output only. 2-letter ISO region code where the product is available in. Ex. "US".
          },
        ],
      },
      "promotion": "A String", # Required. Promotion resource name that identifies a promotion. The format is 'partners/{partner_id}/promotions/{promotion_id}'.
      "type": "A String", # Output only. The type of the promotion for the spec.
    },
  ],
  "name": "A String", # Identifier. Resource name of the line item. Format: partners/{partner}/subscriptions/{subscription}/lineItems/{lineItem}
  "oneTimeRecurrenceDetails": { # Details for a ONE_TIME recurrence line item. # Output only. Details only set for a ONE_TIME recurrence line item.
    "servicePeriod": { # A description of what time period or moment in time the product or service is being delivered over. # Output only. The service period of the ONE_TIME line item.
      "endTime": "A String", # Optional. The end time of the service period. Time is exclusive.
      "startTime": "A String", # Required. The start time of the service period. Time is inclusive.
    },
  },
  "product": "A String", # Required. Product resource name that identifies one the line item The format is 'partners/{partner_id}/products/{product_id}'.
  "productPayload": { # Specifies product specific payload. # Optional. Product specific payload for this line item.
    "googleHomePayload": { # Payload specific for Google Home products. # Payload specific to Google Home products.
      "attachedToGoogleStructure": True or False, # Output only. This identifies whether the subscription is attached to a Google Home structure.
      "googleStructureId": "A String", # Optional. Structure identifier on Google side.
      "partnerStructureId": "A String", # Optional. This identifies the structure ID on partner side that the subscription should be applied to. Only required when the partner requires structure mapping.
    },
    "googleOnePayload": { # Payload specific to Google One products. # Product-specific payloads. Payload specific to Google One products.
      "campaigns": [ # Campaign attributed to sales of this subscription.
        "A String",
      ],
      "offering": "A String", # The type of offering the subscription was sold by the partner. e.g. VAS.
      "salesChannel": "A String", # The type of sales channel through which the subscription was sold.
      "storeId": "A String", # The identifier for the partner store where the subscription was sold.
    },
    "youtubePayload": { # Payload specific to Youtube products. # Payload specific to Youtube products.
      "accessEndTime": "A String", # Output only. The access expiration time for this line item.
      "partnerEligibilityIds": [ # The list of eligibility_ids which are applicable for the line item.
        "A String",
      ],
      "partnerPlanType": "A String", # Optional. Specifies the plan type offered to the end user by the partner.
    },
  },
  "recurrenceType": "A String", # Output only. The recurrence type of the line item.
  "state": "A String", # Output only. The state of the line item.
}