Thinkific.Api.Coupons (Thinkific API SDK v0.1.3)

API calls for all endpoints tagged Coupons.

Link to this section Summary

Functions

deleteCouponByID Deletes a coupon identified by the provided id

getCouponByID Retrieve a Coupon

getCoupons Retrieve a list of all Coupons

updateCoupon Update an existing Coupon

Link to this section Functions

Link to this function

bulk_create_coupons(connection, promotion_id, body, opts \\ [])

Specs

bulkCreateCoupons Bulk Create Coupons

Parameters

  • connection (Thinkific.Connection): Connection to server
  • promotion_id (float()): The ID of the Promotion for which to bulk create the Coupons.
  • body (BulkCreateCouponRequest): New Coupon attributes
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

create_coupon(connection, promotion_id, body, opts \\ [])

Specs

createCoupon Create a Coupon

Parameters

  • connection (Thinkific.Connection): Connection to server
  • promotion_id (float()): ID of the Promotion to add the Coupon to in the form of an integer.
  • body (CreateCouponRequest): New Coupon attributes
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

delete_coupon_by_id(connection, id, opts \\ [])

Specs

delete_coupon_by_id(Tesla.Env.client(), float(), keyword()) ::
  {:ok, nil} | {:error, Tesla.Env.t()}

deleteCouponByID Deletes a coupon identified by the provided id

Parameters

  • connection (Thinkific.Connection): Connection to server
  • id (float()): The ID of the Coupon in the form of an integer.
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_coupon_by_id(connection, id, opts \\ [])

Specs

get_coupon_by_id(Tesla.Env.client(), float(), keyword()) ::
  {:ok, Thinkific.Model.CouponResponse.t()} | {:error, Tesla.Env.t()}

getCouponByID Retrieve a Coupon

Parameters

  • connection (Thinkific.Connection): Connection to server
  • id (float()): The ID of the Coupon in the form of an integer.
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure

Link to this function

get_coupons(connection, promotion_id, opts \\ [])

Specs

get_coupons(Tesla.Env.client(), float(), keyword()) ::
  {:ok, Thinkific.Model.GetCouponResponse.t()} | {:error, Tesla.Env.t()}

getCoupons Retrieve a list of all Coupons

Parameters

  • connection (Thinkific.Connection): Connection to server
  • promotion_id (float()): The ID of the Promotion for which to get the Coupons in the form of an integer.
  • opts (KeywordList): [optional] Optional parameters
    • :page (float()): The page within the collection to fetch.
    • :limit (float()): The number of items to be returned

Returns

} on success {:error, info} on failure

Link to this function

update_coupon(connection, id, body, opts \\ [])

Specs

updateCoupon Update an existing Coupon

Parameters

  • connection (Thinkific.Connection): Connection to server
  • id (float()): The ID of the Coupon in the form of an integer.
  • body (UpdateCoupon): Update an existing coupon
  • opts (KeywordList): [optional] Optional parameters

Returns

} on success {:error, info} on failure