The stripe-haskell package

[ Tags: library, mit, web ] [ Propose Tags ]

For usage information please consult

[Skip to Readme]


Versions,,,,,,,,,,,,,,,, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.1.0, 2.2.0, 2.2.1, 2.2.2, 2.2.3
Dependencies base (==4.*), stripe-core (>=2.0 && <2.3), stripe-http-streams (>=2.0 && <2.3) [details]
License MIT
Copyright Copyright (c) 2016 David M. Johnson, Jeremy Shaw
Author David Johnson, Jeremy Shaw
Category Web
Home page
Bug tracker
Source repository head: git clone git://
Uploaded Sun Oct 8 08:26:20 UTC 2017 by DavidJohnson
Distributions NixOS:2.2.3, Stackage:2.2.3, Tumbleweed:2.2.1
Downloads 3027 total (217 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-10-08 [all 1 reports]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees

Readme for stripe-haskell-2.2.3

[back to package description]


Hackage Hackage Dependencies Haskell Programming Language MIT License Build Status Join the chat at <a href=""></a>


Stripe API coverage for Haskell (Stripe API)

All Stripe commands are supported, including but not limited to Charges, Refunds, Customers, Cards, Subscriptions, Plans, Coupons, Discounts, Invoices, Invoice Items, Disputes, Transfers, Recipients, Bitcoin, Application Fees, Application Fee Refunds, Account, Balance, Events and Tokens.

Haddock Coverage

All code written for this library is documented to completion with the haddock documentation tool

100+ Hspec Tests

Thoroughly unit-tested with hspec. All API commands are unit-tested before inclusion into the API (see the tests directory). To run the tests, perform the following:

cabal clean
cabal configure --enable-tests
cabal build tests
dist/build/tests/tests # You will be prompted to enter your *TEST* key


Pagination is possible on all API calls that return a JSON array. Any API call that returns a StripeList is eligible for pagination. To use in practice do the following:

import Web.Stripe
import Web.Stripe.Customer

main :: IO ()
main = do
  let config = StripeConfig (StripeKey "secret key")
  result <- stripe config $ getCustomers
                (Just 30 :: Maybe Limit) -- Defaults to 10 if Nothing, 100 is Max
                (StartingAfter $ CustomerId "customer_id0")
                (EndingBefore $ CustomerId "customer_id30")
  case result of
    Right stripelist -> print (list stripelist :: [Customer])
    Left stripeError -> print stripeError


All versioning is hard-coded (for safety). Stripe API versions specified in the HTTP headers of Stripe requests take precedence over the API version specified in your Stripe Dashboard. In an attempt to ensure API consistency and correct parsing of returned JSON, all Stripe versions are hard-coded, and are inaccessible to the end-users of this library. When a new Stripe API version is released this library will increment the hard-coded API version.


Object expansion is supported on Stripe objects eligible for expansion though the ExpandParams type. Object expansion allows normal Stripe API calls to return expanded objects inside of other objects. For example, a Customer object contains a Card ID hash on the default_card field. This default_card hash can be expanded into a full Card object inside a Customer object. As an example:

import Web.Stripe
import Web.Stripe.Customer

main :: IO ()
main = do
  let config = StripeConfig "secret key"
  result <- stripe config $ getCustomerExpandable
                   (CustomerId "customerid")
                   (["default_card"] :: ExpandParams)
  case result of
    Right customer -> print (defaultCard customer) -- Will be an `ExpandedCard`
    Left stripeError -> print stripeError


Stripe objects allow the embedding of arbitrary metadata. Any Stripe object that supports the embedding of metadata is available via this API. As an example:

import Web.Stripe
import Web.Stripe.Coupon

main :: IO ()
main = do
  let config = StripeConfig "secret key"
  result <- stripe config $ updateCoupon (CouponId "couponid") [("key1", "value2"), ("key2", "value2")]
  case result of
    Right coupon -> print $ couponMetaData coupon
    Left stripeError -> print stripeError


Any API recommendations or bugs can be reported on the GitHub issue tracker. Pull requests welcome!