stripe_coupon: Coupon Object

stripe_couponR Documentation

Coupon Object

Description

The stripe_coupon object represents the complete set of data required to manage coupons at Stripe. A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an amount_off of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an amount_off of 20000 is applied to it.

Format

An R6 Class object

Methods

  • create: Creates a coupon on Stripe.

  • retrieve: Retrieves coupon information from Stripe based on the id passed to the method.

  • update: Updates coupon metadata at Stripe.

  • delete: Deletes the coupon with the provided id at Stripe.

Methods

Public methods


Method new()

Usage
stripe_coupon$new(..., metadata = list())

Method create()

Usage
stripe_coupon$create(
  id = NULL,
  amount_off = NULL,
  created = NULL,
  currency = NULL,
  duration,
  duration_in_months = NULL,
  max_redemptions = NULL,
  metadata = list(),
  percent_off = NULL,
  redeem_by = NULL
)

Method retrieve()

Usage
stripe_coupon$retrieve(coupon_id)

Method update()

Usage
stripe_coupon$update(metadata = list())

Method delete()

Usage
stripe_coupon$delete(coupon_id)

Method clone()

The objects of this class are cloneable with this method.

Usage
stripe_coupon$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


MrDAndersen/stRipe documentation built on March 17, 2024, 7:25 p.m.