mollie-api-haskell-2.0.0.0: Mollie API client for Haskell http://www.mollie.com

Safe HaskellNone
LanguageHaskell2010

Mollie.API.Customers

Synopsis

Documentation

data CustomerAPI route Source #

Instances
Generic (CustomerAPI route) Source # 
Instance details

Defined in Mollie.API.Customers

Associated Types

type Rep (CustomerAPI route) :: Type -> Type #

Methods

from :: CustomerAPI route -> Rep (CustomerAPI route) x #

to :: Rep (CustomerAPI route) x -> CustomerAPI route #

type Rep (CustomerAPI route) Source # 
Instance details

Defined in Mollie.API.Customers

type Rep (CustomerAPI route) = D1 (MetaData "CustomerAPI" "Mollie.API.Customers" "mollie-api-haskell-2.0.0.0-79op8QUDPdyAagRpBQOely" False) (C1 (MetaCons "CustomerAPI" PrefixI True) ((S1 (MetaSel (Just "getCustomersPaginated") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (QueryParam "limit" Int :> (QueryParam "from" CustomerId :> Get (HalJSON ': ([] :: [Type])) (List Customer)))))) :*: (S1 (MetaSel (Just "getCustomers") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> Get (HalJSON ': ([] :: [Type])) (List Customer)))) :*: S1 (MetaSel (Just "createCustomer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (ReqBody (JSON ': ([] :: [Type])) NewCustomer :> Post (HalJSON ': ([] :: [Type])) Customer)))))) :*: ((S1 (MetaSel (Just "getCustomer") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (Capture "id" CustomerId :> Get (HalJSON ': ([] :: [Type])) Customer)))) :*: S1 (MetaSel (Just "getCustomerPaymentsPaginated") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> (QueryParam "limit" Int :> (QueryParam "from" PaymentId :> Get (HalJSON ': ([] :: [Type])) (List Payment))))))))) :*: (S1 (MetaSel (Just "getCustomerPayments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> Get (HalJSON ': ([] :: [Type])) (List Payment)))))) :*: S1 (MetaSel (Just "createCustomerPayment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> (ReqBody (JSON ': ([] :: [Type])) NewPayment :> Post (HalJSON ': ([] :: [Type])) Payment))))))))))

newCustomer Source #

Arguments

:: Text

_name

-> Text

_email

-> NewCustomer 

Helper to create a minimal new customer.

getCustomer :: CustomerAPI route -> route :- ("customers" :> (Capture "id" CustomerId :> Get '[HalJSON] Customer)) Source #

Handler to get a customer by its identifier. See https://docs.mollie.com/reference/v2/customers-api/get-customer

getCustomers :: CustomerAPI route -> route :- ("customers" :> Get '[HalJSON] (List Customer)) Source #

Handler to get a paginated list of customers. Applies default pagination for newest 250 customers. See https://docs.mollie.com/reference/v2/customers-api/list-customers

getCustomersPaginated :: CustomerAPI route -> route :- ("customers" :> (QueryParam "limit" Int :> (QueryParam "from" CustomerId :> Get '[HalJSON] (List Customer)))) Source #

Handler to get a paginated list of customers. Offset the results by passing the last customer ID in the from query param. The customer with this ID is included in the result set as well. See https://docs.mollie.com/reference/v2/customers-api/list-customers

Example for fetching the last customer:

import Mollie.API
import Mollie.API.Customers

env <- createEnv "test_mollieapikeyexample"
let customersResult = runMollie env (getCustomersPaginated customerClient (Just 1) Nothing)

createCustomerPayment :: CustomerAPI route -> route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> (ReqBody '[JSON] NewPayment :> Post '[HalJSON] Payment)))) Source #

Handler to create a new payment for a specific customer. See https://docs.mollie.com/reference/v2/customers-api/create-customer-payment

getCustomerPayments :: CustomerAPI route -> route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> Get '[HalJSON] (List Payment)))) Source #

Handler to get a paginated list of payments for a specific customer. Applies default pagination for newest 250 payments. See https://docs.mollie.com/reference/v2/customers-api/list-customer-payments

getCustomerPaymentsPaginated :: CustomerAPI route -> route :- ("customers" :> (Capture "id" CustomerId :> ("payments" :> (QueryParam "limit" Int :> (QueryParam "from" PaymentId :> Get '[HalJSON] (List Payment)))))) Source #

Handler to get a paginated list of payments for a specific customer. Offset the results by passing the last payment ID in the from query param. The payment with this ID is included in the result set as well. See https://docs.mollie.com/reference/v2/customers-api/list-customers-payments

Example for fetching the last payment for a customer:

import Mollie.API
import Mollie.API.Customers

env <- createEnv "test_mollieapikeyexample"
let customerPaymentsResult = runMollie env (getCustomerPaymentsPaginated customerClient "cst_exampleid" (Just 1) Nothing)