Skip to content

nutrivetpet/rstripe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rstripe

Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

The goal of rstripe is to interact with the Stripe API, from R.

It is an independent, community-developed R package for Stripe (not created by or affiliated with Stripe).

Installation

You can install the development version of rstripe like so:

pak::pak("nutrivetpet/rstripe")

Getting Started

API Key Setup

The package requires environment variables for API authentication:

  • STRIPE_API_KEY_TEST for test mode operations
  • STRIPE_API_KEY_LIVE for live mode operations

Set these in your .Renviron file with:

# pak::pak("usethis")
usethis::edit_r_environ()

Don’t forget to restart R afterwards.

Example

Current API Coverage

The package currently provides limited but useful coverage of the Stripe API. You can fetch data from these Stripe resources:

library(rstripe)

# Create a client (uses STRIPE_API_KEY_TEST from your environment)
client <- rstripe("test")

# Fetch charges (payments)
charges <- list_charges(client, limit = 10)

# Fetch customers
customers <- list_customers(client, limit = 10)

# Fetch products from your catalog
products <- list_products(client, limit = 10)

# Fetch pricing information
prices <- list_prices(client, limit = 10)

# Fetch invoices
invoices <- list_invoices(client, limit = 10)

# Fetch invoice line items
invoice_items <- list_invoice_items(client, limit = 10)

# Fetch balance transactions
balance_transactions <- list_balance_transactions(client, limit = 10)

# Filter balance transactions by date range
recent_transactions <- list_balance_transactions(
  client,
  limit = 10,
  created_gte = as.Date("2025-01-01"),
  created_lte = as.Date("2025-12-31")
)

# For unlimited results, use limit = Inf
all_charges <- list_charges(client, limit = Inf)

All functions accept a rstripe client object (created with rstripe("test") or rstripe("live")), and return data as data frames (tibbles if the tibble package is installed).

About

Unofficial Stripe API Integration for R

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages