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.
Pay for a course with a coupon.
- get_all_coupons(*, price_id, page_size=20)[source]#
Get the coupons of a price.
- Parameters:
price_id (
str
) – The price id for which you want to get all coupons.page_size (
int
) – The size of a single page, maximum is 50.self (CoursePriceService[AuthenticatedClient]) –
- 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. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or as a dictionary.price_id (
str
) – The price you want to create a coupon for.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
The coupon created for this course price.
- Return type:
- delete_coupon(*, price_id, coupon_id)[source]#
Delete a coupon.
- Parameters:
price_id (
str
) – The id of the price the coupon is connected to.coupon_id (
str
) – The id of the coupon you want to delete.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type:
None
- 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. SeeCouponDataParser
for information about the possible fields. You can provide this data as aCouponDataParser
or 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.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
The updated coupon
- Return type:
- start_payment(json_body, *, price_id)[source]#
Create a new payment for the current user.
- Parameters:
json_body (
Union
[StartPaymentCoursePriceRedirectData
,StartPaymentCoursePriceCloseTabData
]) – The body of the request. SeeStartPaymentCoursePriceData
for information about the possible fields. You can provide this data as aStartPaymentCoursePriceData
or as a dictionary.price_id (
str
) – The price you want to pay for.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
A transaction for this course price with a stripe_url key that can be used to pay. Be careful to check the state of the transaction, as a payment might already be in progress.
- 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. SeePayWithCouponCoursePriceData
for information about the possible fields. You can provide this data as aPayWithCouponCoursePriceData
or as a dictionary.price_id (
str
) – The id of the price you want to pay for.self (CoursePriceService[AuthenticatedClient]) –
- Returns:
Nothing
- Return type: