Copyright | (c) David Johnson, 2014 |
---|---|
Maintainer | djohnson.m@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
https://stripe.com/docs/api#invoiceitems
import Web.Stripe import Web.Stripe.Customer import Web.Stripe.InvoiceItem main :: IO () main = do let config = SecretKey "secret_key" result <- stripe config $ do Customer { customerId = cid } <- createEmptyCustomer createInvoiceItem cid 100 USD Nothing Nothing (Just "description") [] case result of Right invoiceitem -> print invoiceitem Left stripeError -> print stripeError
- createInvoiceItem :: CustomerId -> Amount -> Currency -> Maybe InvoiceId -> Maybe SubscriptionId -> Maybe Description -> MetaData -> Stripe InvoiceItem
- getInvoiceItem :: InvoiceItemId -> Stripe InvoiceItem
- getInvoiceItemExpandable :: InvoiceItemId -> ExpandParams -> Stripe InvoiceItem
- getInvoiceItems :: Maybe CustomerId -> Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> Stripe (StripeList InvoiceItem)
- getInvoiceItemsExpandable :: Maybe CustomerId -> Limit -> StartingAfter InvoiceItemId -> EndingBefore InvoiceItemId -> ExpandParams -> Stripe (StripeList InvoiceItem)
- updateInvoiceItem :: InvoiceItemId -> Maybe Amount -> Maybe Description -> MetaData -> Stripe InvoiceItem
- deleteInvoiceItem :: InvoiceItemId -> Stripe StripeDeleteResult
- data InvoiceItemId
- data InvoiceItem = InvoiceItem {
- invoiceItemObject :: Text
- invoiceItemId :: InvoiceItemId
- invoiceItemDate :: UTCTime
- invoiceItemAmount :: Int
- invoiceItemLiveMode :: Bool
- invoiceItemProration :: Bool
- invoiceItemCurrency :: Currency
- invoiceItemCustomer :: CustomerId
- invoiceItemDescription :: Maybe Description
- invoiceItemInvoice :: Maybe InvoiceId
- invoiceItemQuantity :: Maybe Quantity
- invoiceItemSubscription :: Maybe Subscription
- invoiceItemMetaData :: MetaData
- data CustomerId
- data Currency
- = AED
- | AFN
- | ALL
- | AMD
- | ANG
- | AOA
- | ARS
- | AUD
- | AWG
- | AZN
- | BAM
- | BBD
- | BDT
- | BGN
- | BIF
- | BMD
- | BND
- | BOB
- | BRL
- | BSD
- | BWP
- | BZD
- | CAD
- | CDF
- | CHF
- | CLP
- | CNY
- | COP
- | CRC
- | CVE
- | CZK
- | DJF
- | DKK
- | DOP
- | DZD
- | EEK
- | EGP
- | ETB
- | EUR
- | FJD
- | FKP
- | GBP
- | GEL
- | GIP
- | GMD
- | GNF
- | GTQ
- | GYD
- | HKD
- | HNL
- | HRK
- | HTG
- | HUF
- | IDR
- | ILS
- | INR
- | ISK
- | JMD
- | JPY
- | KES
- | KGS
- | KHR
- | KMF
- | KRW
- | KYD
- | KZT
- | LAK
- | LBP
- | LKR
- | LRD
- | LSL
- | LTL
- | LVL
- | MAD
- | MDL
- | MGA
- | MKD
- | MNT
- | MOP
- | MRO
- | MUR
- | MVR
- | MWK
- | MXN
- | MYR
- | MZN
- | NAD
- | NGN
- | NIO
- | NOK
- | NPR
- | NZD
- | PAB
- | PEN
- | PGK
- | PHP
- | PKR
- | PLN
- | PYG
- | QAR
- | RON
- | RSD
- | RUB
- | RWF
- | SAR
- | SBD
- | SCR
- | SEK
- | SGD
- | SHP
- | SLL
- | SOS
- | SRD
- | STD
- | SVC
- | SZL
- | THB
- | TJS
- | TOP
- | TRY
- | TTD
- | TWD
- | TZS
- | UAH
- | UGX
- | USD
- | UYU
- | UZS
- | VND
- | VUV
- | WST
- | XAF
- | XCD
- | XOF
- | XPF
- | YER
- | ZAR
- | ZMW
- | UnknownCurrency
- data InvoiceId
- data Invoice = Invoice {
- invoiceDate :: UTCTime
- invoiceId :: Maybe InvoiceId
- invoicePeriodStart :: UTCTime
- invoicePeriodEnd :: UTCTime
- invoiceLineItems :: StripeList InvoiceLineItem
- invoiceSubTotal :: Int
- invoiceTotal :: Int
- invoiceCustomer :: CustomerId
- invoiceObject :: Text
- invoiceAttempted :: Bool
- invoiceClosed :: Bool
- invoiceForgiven :: Bool
- invoicePaid :: Bool
- invoiceLiveMode :: Bool
- invoiceAttemptCount :: Int
- invoiceAmountDue :: Int
- invoiceCurrency :: Currency
- invoiceStartingBalance :: Int
- invoiceEndingBalance :: Maybe Int
- invoiceNextPaymentAttempt :: Maybe UTCTime
- invoiceWebHooksDeliveredAt :: Maybe UTCTime
- invoiceCharge :: Maybe ChargeId
- invoiceDiscount :: Maybe Discount
- invoiceApplicateFee :: Maybe FeeId
- invoiceSubscription :: Maybe SubscriptionId
- invoiceStatementDescription :: Maybe Description
- invoiceDescription :: Maybe Description
- invoiceMetaData :: MetaData
- newtype SubscriptionId = SubscriptionId Text
- data StripeDeleteResult = StripeDeleteResult {}
- data StripeList a = StripeList {}
- type Description = Text
- type Amount = Int
API
:: CustomerId |
|
-> Amount |
|
-> Currency |
|
-> Maybe InvoiceId |
|
-> Maybe SubscriptionId |
|
-> Maybe Description |
|
-> MetaData |
|
-> Stripe InvoiceItem |
Create an invoice for a Customer
:: InvoiceItemId |
|
-> Stripe InvoiceItem |
Retrieve an InvoiceItem
by InvoiceItemId
getInvoiceItemExpandable Source
:: InvoiceItemId |
|
-> ExpandParams |
|
-> Stripe InvoiceItem |
Retrieve an InvoiceItem
by InvoiceItemId
:: Maybe CustomerId | When specified, only |
-> Limit | Defaults to 10 if |
-> StartingAfter InvoiceItemId | Paginate starting after the following |
-> EndingBefore InvoiceItemId | Paginate ending before the following |
-> Stripe (StripeList InvoiceItem) |
Retrieve an InvoiceItem
by InvoiceItemId
getInvoiceItemsExpandable Source
:: Maybe CustomerId | When specified, only |
-> Limit | Defaults to 10 if |
-> StartingAfter InvoiceItemId | Paginate starting after the following |
-> EndingBefore InvoiceItemId | Paginate ending before the following |
-> ExpandParams |
|
-> Stripe (StripeList InvoiceItem) |
Retrieve an InvoiceItem
by InvoiceItemId
with ExpandParams
:: InvoiceItemId |
|
-> Maybe Amount |
|
-> Maybe Description |
|
-> MetaData |
|
-> Stripe InvoiceItem |
Update an InvoiceItem
by InvoiceItemId
:: InvoiceItemId |
|
-> Stripe StripeDeleteResult |
Delete an InvoiceItem
by InvoiceItemId
Types
data InvoiceItemId Source
data InvoiceItem Source
InvoiceItem
object
Eq InvoiceItem | |
Show InvoiceItem | |
FromJSON InvoiceItem | JSON Instance for |
data CustomerId Source
CustomerId
for a Customer
Eq CustomerId | |
Show CustomerId | |
FromJSON CustomerId | JSON Instance for |
Stripe supports 138 currencies
AED | United Arab Emirates Dirham |
AFN | Afghan Afghani |
ALL | Albanian Lek |
AMD | Armenian Dram |
ANG | Netherlands Antillean Gulden |
AOA | Angolan Kwanza |
ARS | Argentine Peso |
AUD | Australian Dollar |
AWG | Aruban Florin |
AZN | Azerbaijani Manat |
BAM | Bosnia & Herzegovina Convertible Mark |
BBD | Barbadian Dollar |
BDT | Bangladeshi Taka |
BGN | Bulgarian Lev |
BIF | Burundian Franc |
BMD | Bermudian Dollar |
BND | Brunei Dollar |
BOB | Bolivian Boliviano |
BRL | Brazilian Real |
BSD | Bahamian Dollar |
BWP | Botswana Pula |
BZD | Belize Dollar |
CAD | Canadian Dollar |
CDF | Congolese Franc |
CHF | Swiss Franc |
CLP | Chilean Peso |
CNY | Chinese Renminbi Yuan |
COP | Colombian Peso |
CRC | Costa Rican Colón |
CVE | Cape Verdean Escudo |
CZK | Czech Koruna |
DJF | Djiboutian Franc |
DKK | Danish Krone |
DOP | Dominican Peso |
DZD | Algerian Dinar |
EEK | Estonian Kroon |
EGP | Egyptian Pound |
ETB | Ethiopian Birr |
EUR | Euro |
FJD | Fijian Dollar |
FKP | Falkland Islands Pound |
GBP | British Pound |
GEL | Georgian Lari |
GIP | Gibraltar Pound |
GMD | Gambian Dalasi |
GNF | Guinean Franc |
GTQ | Guatemalan Quetzal |
GYD | Guyanese Dollar |
HKD | Hong Kong Dollar |
HNL | Honduran Lempira |
HRK | Croatian Kuna |
HTG | Haitian Gourde |
HUF | Hungarian Forint |
IDR | Indonesian Rupiah |
ILS | Israeli New Sheqel |
INR | Indian Rupee |
ISK | Icelandic Króna |
JMD | Jamaican Dollar |
JPY | Japanese Yen |
KES | Kenyan Shilling |
KGS | Kyrgyzstani Som |
KHR | Cambodian Riel |
KMF | Comorian Franc |
KRW | South Korean Won |
KYD | Cayman Islands Dollar |
KZT | Kazakhstani Tenge |
LAK | Lao Kip |
LBP | Lebanese Pound |
LKR | Sri Lankan Rupee |
LRD | Liberian Dollar |
LSL | Lesotho Loti |
LTL | Lithuanian Litas |
LVL | Latvian Lats |
MAD | Moroccan Dirham |
MDL | Moldovan Leu |
MGA | Malagasy Ariary |
MKD | Macedonian Denar |
MNT | Mongolian Tögrög |
MOP | Macanese Pataca |
MRO | Mauritanian Ouguiya |
MUR | Mauritian Rupee |
MVR | Maldivian Rufiyaa |
MWK | Malawian Kwacha |
MXN | Mexican Peso |
MYR | Malaysian Ringgit |
MZN | Mozambican Metical |
NAD | Namibian Dollar |
NGN | Nigerian Naira |
NIO | Nicaraguan Córdoba |
NOK | Norwegian Krone |
NPR | Nepalese Rupee |
NZD | New Zealand Dollar |
PAB | Panamanian Balboa |
PEN | Peruvian Nuevo Sol |
PGK | Papua New Guinean Kina |
PHP | Philippine Peso |
PKR | Pakistani Rupee |
PLN | Polish Złoty |
PYG | Paraguayan Guaraní |
QAR | Qatari Riyal |
RON | Romanian Leu |
RSD | Serbian Dinar |
RUB | Russian Ruble |
RWF | Rwandan Franc |
SAR | Saudi Riyal |
SBD | Solomon Islands Dollar |
SCR | Seychellois Rupee |
SEK | Swedish Krona |
SGD | Singapore Dollar |
SHP | Saint Helenian Pound |
SLL | Sierra Leonean Leone |
SOS | Somali Shilling |
SRD | Surinamese Dollar |
STD | São Tomé and Príncipe Dobra |
SVC | Salvadoran Colón |
SZL | Swazi Lilangeni |
THB | Thai Baht |
TJS | Tajikistani Somoni |
TOP | Tongan Paʻanga |
TRY | Turkish Lira |
TTD | Trinidad and Tobago Dollar |
TWD | New Taiwan Dollar |
TZS | Tanzanian Shilling |
UAH | Ukrainian Hryvnia |
UGX | Ugandan Shilling |
USD | United States Dollar |
UYU | Uruguayan Peso |
UZS | Uzbekistani Som |
VND | Vietnamese Đồng |
VUV | Vanuatu Vatu |
WST | Samoan Tala |
XAF | Central African Cfa Franc |
XCD | East Caribbean Dollar |
XOF | West African Cfa Franc |
XPF | Cfp Franc |
YER | Yemeni Rial |
ZAR | South African Rand |
ZMW | Zambian Kwacha |
UnknownCurrency | Unknown Currency |
Invoice
Object
newtype SubscriptionId Source
SubscriptionId
for a Subscription
data StripeDeleteResult Source
JSON returned from a Stripe
deletion request
Eq StripeDeleteResult | |
Show StripeDeleteResult | |
FromJSON StripeDeleteResult | JSON Instance for |
data StripeList a Source
Generic handling of Stripe JSON arrays
Eq a => Eq (StripeList a) | |
Show a => Show (StripeList a) | |
FromJSON a => FromJSON (StripeList a) | JSON Instance for |
type Description = Text Source
Generic Description for use in constructing API Calls