Stripe

class stripe.Stripe(api_key)

Create a Stripe service.

Variables:api_key (str) – The API key.

Account

Stripe.account()

Return the resource corresponding to the logged account.

Account.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

BalanceHistory

Stripe.balance_history()

Return the resource corresponding to the balance history.

BalanceHistory.get(limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Charge

Stripe.charge(id)

Return the resource corresponding to a single charge.

Charge.dispute(obj)

Update a dispute

Variables:obj – a Python object representing the updated dispute.
Charge.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Charge.refund(amount=None)

Refunding a charge

Variables:amount (int) – A positive integer in cents representing how much of this charge to refund. Can only refund up to the unrefunded amount remaining of the charge. Default is entire charge.

Charges

Stripe.charges()

Return the resource corresponding to all charges.

Charges.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Charges.get(customer=None, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • customer (str) – Only return charges for the customer specified by this customer ID.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Coupon

Stripe.coupon(id)

Return the resource corresponding to a single coupon.

Coupon.delete()

Delete this resource.

Coupon.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Coupons

Stripe.coupons()

Return the resource corresponding to all coupons.

Coupons.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Coupons.get(limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Customer

Stripe.customer(id)

Return the resource corresponding to a single customer.

DiscountResource

Customer.discount()

Return the resource corresponding to a single discount.

DiscountResource.delete()

Delete this resource.

SubscriptionResource

Customer.subscription(subscription_id)

Return the resource corresponding to a single customer’s subscription.

Variables:subscription_id (str) – The subscription’s id.
SubscriptionResource.delete()

Delete this resource.

SubscriptionResource.get()

Fetch the object’s data.

SubscriptionResource.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

SubscriptionsResource

Customer.subscriptions()

Return the resource corresponding to the customer’s subscriptions.

SubscriptionsResource.get()

Fetch the object’s data.

Customer.delete()

Delete this resource.

Customer.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Customer.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Customers

Stripe.customers()

Return the resource corresponding to all customers.

Customers.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Customers.get(total_count=False, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • total_count (bool) – Include the total count of all customers.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Event

Stripe.event(id)

Return the resource corresponding to a single event.

Event.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Events

Stripe.events()

Return the resource corresponding to all events.

Events.get(type=None, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • type (str) – A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Invoice

Stripe.invoice(id)

Return the resource corresponding to a single invoice.

LineItems

Invoice.lines()

Return the resource corresponding to all invoice’s lines.

LineItems.get(customer=None, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • customer (str) – In the case of upcoming invoices, the customer of the upcoming invoice is required. In other cases it is ignored.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.
Invoice.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Invoice.pay()

Paying an invoice

Invoice.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

InvoiceItem

Stripe.invoiceitem(id)

Return the resource corresponding to a single invoiceitem.

InvoiceItem.delete()

Delete this resource.

InvoiceItem.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

InvoiceItems

Stripe.invoiceitems()

Return the resource corresponding to all invoiceitems.

InvoiceItems.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
InvoiceItems.get(customer=None, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • customer (str) – The identifier of the customer whose invoice items to return. If none is provided, all invoices will be returned.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.

Invoices

Stripe.invoices()

Return the resource corresponding to all invoices.

Invoices.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Invoices.get(customer=None, limit=None, ending_before=None, starting_after=None)

Fetch all of the objects.

Variables:
  • customer (str) – The identifier of the customer whose invoices to return. If none is provided, all invoices will be returned.
  • limit – A limit on the number of objects to be returned. Count can range between 1 and 100 objects.
  • ending_before (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be newer than the given object.
  • starting_after (str) – A cursor (object ID) for use in pagination. Fetched objetcs will be older than the given object.
Invoices.upcoming(customer)

Fetch a customer’s upcoming invoice.

Variables:customer (str) – The identifier of the customer whose invoices to return. If none is provided, all invoices will be returned.

Plan

Stripe.plan(id)

Return the resource corresponding to a single plan.

Plan.delete()

Delete this resource.

Plan.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Plan.update(obj)

Update this resource.

Variables:obj – a Python object representing the updated resource, usually in the same format as returned from get. Refer to the upstream documentation for details.

Plans

Stripe.plans()

Return the resource corresponding to all plans.

Plans.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.
Plans.get(limit=10)

Fetch all plans.

Variables:limit (int) – A limit on the number of objects to be returned. Limit can range between 1 and 100 items.

Token

Stripe.token(id)

Return the resource corresponding to a single token.

Token.get()

For single-object resources, fetch the object’s data. For collections, fetch all of the objects.

Tokens

Stripe.tokens()

Return the resource corresponding to all tokens.

Tokens.create(obj)

Create a new resource.

Variables:obj – a Python object representing the resource to be created, usually in the same format as returned from get. Refer to the upstream documentation for details.