CoursePriceService¶
- class CoursePriceService[source]¶
Methods
Get the coupons of a price.
Create a new coupon for a course price.
Delete a coupon.
Update the given coupon with new values.
Create a new payment for the current user, either for the course directly or for a tenant-wide access pass.
Pay for a course with a coupon.
- get_all_coupons(*, price_id, page_size=20)[source]¶
Get the coupons of a price.
- Parameters:
- Returns:
The coupons (that the current user may see) of the price.
- Return type:
Response[CouponWithCode | CouponWithoutCode]
- create_coupon(json_body, *, price_id)[source]¶
Create a new coupon for a course price.
- Parameters:
json_body (
CouponDataParser) – The body of the request. SeeCouponDataParserfor information about the possible fields. You can provide this data as aCouponDataParseror as a dictionary.price_id (
str) – The price you want to create a coupon for.
- Returns:
The coupon created for this course price.
- Return type:
- delete_coupon(*, price_id, coupon_id)[source]¶
Delete a coupon.
- update_coupon(json_body, *, price_id, coupon_id)[source]¶
Update the given coupon with new values.
- Parameters:
json_body (
CouponDataParser) – The body of the request. SeeCouponDataParserfor information about the possible fields. You can provide this data as aCouponDataParseror as a dictionary.price_id (
str) – The price to which the coupon is connected.coupon_id (
str) – The id of the coupon you want to update.
- Returns:
The updated coupon
- Return type:
- start_payment(json_body, *, price_id)[source]¶
Create a new payment for the current user, either for the course directly or for a tenant-wide access pass.
- Parameters:
json_body (
Union[StartPaymentCloseTabData,StartPaymentRedirectData]) – The body of the request. SeeStartPaymentCoursePriceDatafor information about the possible fields. You can provide this data as aStartPaymentCoursePriceDataor as a dictionary.price_id (
str) – The price of the course you want to gain access to.
- Returns:
A transaction object with a payment_url key that can be used to complete the payment.
- Return type:
- pay_with_coupon(json_body, *, price_id)[source]¶
Pay for a course with a coupon.
- Parameters:
json_body (
PayWithCouponCoursePriceData) – The body of the request. SeePayWithCouponCoursePriceDatafor information about the possible fields. You can provide this data as aPayWithCouponCoursePriceDataor as a dictionary.price_id (
str) – The id of the price you want to pay for.
- Returns:
Nothing
- Return type: