项目作者: marqeta

项目描述 :
Marqeta Python SDK
高级语言: Python
项目地址: git://github.com/marqeta/marqeta-python.git
创建时间: 2019-03-27T20:47:07Z
项目社区:https://github.com/marqeta/marqeta-python

开源协议:MIT License

下载


marqeta-python

The Marqeta Python library provides access to the Marqeta platform Core API.

This library is released as a Beta. If you find anything that needs fixing or can be improved, please create an issue on GitHub.

Documentation

For complete reference documentation, see the Marqeta Core API Reference.

Installation

Install from PyPi using pip, a package manager for Python.

  1. pip install marqeta

Requirements

  • Python 3.7+

Dependencies

Usage

Configuring the client

Create an account on marqeta.com to retrieve your application token and access token for the shared sandbox. For production, you will need to change base_url too.

Configure your client object.

  1. from marqeta import Client
  2. base_url = "https://shared-sandbox-api.marqeta.com/v3/"
  3. application_token = "MY_APPLICATION_TOKEN"
  4. access_token = "MY_ACCESS_TOKEN"
  5. timeout = 60 # seconds
  6. client = Client(base_url, application_token, access_token, timeout)

When specifying your base url, include the /v3/ version prefix with the trailing slash.

Accessing resources

Access resource collections of the Core API as properties of the client object.

For example, to access the /users endpoint:

  1. client.users

Nested resource collection are properties of the parent collection.

For example, to access the /chargebacks/{token}/transitions endpoint:

  1. client.chargebacks(token).transitions

Listing objects

There are multiple ways to retrieve collections of objects, depending on your use case. The library will intelligently handle pagination for you, unless you request a specific page of data.

To simply retrieve every object in a collection, call list(limit=None) on the resource.

  1. users = client.users.list(limit=None)

If an integer is specified for ‘limit’, the library will return up to maximum of limit objects. The default value of limit is typically None, however for client.users.list() and client.card_products.list() the default limits are 1000 and 25 respectively.

The stream() method returns a generator that efficiently downloads subsequent pages as needed, as opposed to downloading all objects into memory at once.

  1. for user in client.users.stream():
  2. pass

To retrieve a single page, call the page() method specifying start_index and count.

  1. page = client.users.page(start_index=0, count=5)
  2. users = page.data

You can specify by which field the results should be sorted by passing a params dictionary:

  1. client.users.list(params={'sort_by': '-lastModifiedTime'})

See Sorting & Pagination for further details.

Specifying additional query parameters

Most methods support specifying additional query parameters as a params dictionary. The keys and values are the same as the HTTP API.

  1. client.cards.find_show_pan(card_token, params={'show_cvv_number': True})

Finding a specific objects

Call the find() method on a resource collection, passing in the object’s token.

  1. user = client.users.find(token)

Creating objects

Call the create() method of a resource collection, passing in data as a Python dict.

  1. data = {
  2. 'first_name': 'Sarah'
  3. }
  4. created_user = client.users.create(data)

Updating objects

Call the save() method of a resource collection, passing in the object’s token and a Python dictionary containing the fields you wish to update.

  1. fields_to_update = {
  2. 'first_name': 'Updated Value'
  3. }
  4. updated_user = client.users.save(user_token, fields_to_update)

Handling errors

The SDK will raise a MarqetaError exception for unsuccessful requests.

  1. from marqeta import Client
  2. from marqeta.errors import MarqetaError
  3. from requests.exceptions import RequestException
  4. try:
  5. user = client.users.find(token)
  6. except MarqetaError as error:
  7. print(error.code)
  8. except RequestException as error:
  9. print(error)

The exception’s code card_products contains the value returned by the API in the JSON response. See Error codes and messages.

Resources

The library supports the following endpoints:

Endpoint Python code
/acceptedcountries client.accepted_countries
/accountholdergroups client.account_holder_groups
/authcontrols client.auth_controls
/authcontrols/exemptmids client.auth_controls.exempt_mids
/autoreloads client.auto_reloads
/balances client.balances
/bulkissuances client.bulk_issuances
/businesses client.businesses
/businesstransitions client.businesses(business_token).transitions
/businesses/{token}/notes client.businesses(token).notes
/cardproducts client.card_products
/cards client.cards
/cardtransitions client.cards(token).transitions
/chargebacks client.chargebacks
/chargebacks/transitions client.chargebacks(token).transitions
/commandomodes client.commando_modes
/commandomodes/transitions client.commando_modes(token).transitions
/digitalwallettokens client.digital_wallet_tokens
/digitalwallettokentransitions client.digital_wallet_tokens(token).transitions
/directdeposits client.direct_deposits
/directdeposits/transitions client.direct_deposits(token).transitions
/directdeposits/accounts client.direct_deposits.accounts
/fees client.fees
/feetransfers client.fee_transfers
/fundingsources client.funding_sources
/fundingsources/addresses client.funding_sources.addresses
/fundingsources/ach client.funding_sources.ach
/fundingsources/paymentcard client.funding_sources.payment_card
/fundingsources/programgateway client.funding_sources.program_gateway
/fundingsources/program client.funding_sources.program
/gpaorders client.gpa_orders
/gpaorders/unloads client.gpa_orders.unloads
/kyc client.kyc
/mccgroups client.mcc_groups
/merchants client.merchants
/merchants/{token}/stores client.merchants(token).stores
/msaorders client.msa_orders
/msaorders/unloads client.msa_orders.unloads
/offerorders client.offer_orders
/pins client.pins
/programtransfers client.program_transfers
/programtransfers/types client.program_transfers.types
/pushtocards client.push_to_cards
/pushtocards/disburse client.push_to_cards.disburse
/pushtocards/paymentcard client.push_to_cards.payment_card
/realtimefeegroups client.real_time_fee_groups
/transactions client.transactions
/transactions/{token}/related client.transactions(token).related
/users client.users
/usertransitions client.users(token).transitions
/users/{token}/notes client.users(token).notes
/velocitycontrols client.velocity_controls
/webhooks client.webhooks

Examples

Accepted Countries (/acceptedcountries)

  1. # List all accepted countries
  2. accepted_countries = client.accepted_countries.list()
  3. for accepted_country in client.accepted_countries.stream():
  4. pass
  5. accepted_countries_page = client.accepted_countries.page(start_index=0)
  6. # Retrieve a specific accepted country
  7. accepted_country = client.accepted_countries.find(token)
  8. # Create an accepted country
  9. accepted_country = client.accepted_countries.create({...})
  10. # Update an accepted country
  11. accepted_country = client.accepted_countries.save(token, {...})

Account Holder Groups (/accountholdergroups)

  1. # List all account holder groups
  2. account_holder_groups = client.account_holder_groups.list()
  3. for account_holder_group in client.account_holder_groups.stream():
  4. pass
  5. account_holder_groups_page = client.account_holder_groups.page(start_index=0)
  6. # Retrieve a specific account holder group
  7. account_holder_group = client.account_holder_groups.find(token)
  8. # Create an account holder group
  9. account_holder_group = client.account_holder_groups.create({...})
  10. # Update an account holder group
  11. account_holder_group = client.account_holder_groups.save(token, {...})

Auth Controls (/authcontrols)

  1. # List all auth controls
  2. auth_controls = client.auth_controls.list()
  3. for auth_control in client.auth_controls.stream():
  4. pass
  5. auth_controls_page = client.auth_controls.page(start_index=0)
  6. # Retrieve a specific auth control
  7. auth_control = client.auth_controls.find(token)
  8. # Create an auth control
  9. auth_control = client.auth_controls.create({...})
  10. # Update an auth control
  11. auth_control = client.auth_controls.save(token, {...})

Exempt MIDs (/authcontrols/exemptmids)

  1. # List all exempt mids
  2. exempt_mi_ds = client.auth_controls.exempt_mids.list()
  3. for exempt_mid in client.auth_controls.exempt_mids.stream():
  4. pass
  5. exempt_mi_ds_page = client.auth_controls.exempt_mids.page(start_index=0)
  6. # Retrieve a specific exempt mid
  7. exempt_mid = client.auth_controls.exempt_mids.find(token)
  8. # Create an exempt mid
  9. exempt_mid = client.auth_controls.exempt_mids.create({...})
  10. # Update an exempt mid
  11. exempt_mid = client.auth_controls.exempt_mids.save(token, {...})

Autoreloads (/autoreloads)

  1. # List all autoreloads
  2. autoreloads = client.auto_reloads.list()
  3. for autoreload in client.auto_reloads.stream():
  4. pass
  5. autoreloads_page = client.auto_reloads.page(start_index=0)
  6. # Retrieve a specific autoreload
  7. autoreload = client.auto_reloads.find(token)
  8. # Create an autoreload
  9. autoreload = client.auto_reloads.create({...})
  10. # Update an autoreload
  11. autoreload = client.auto_reloads.save(token, {...})

Balances (/balances)

  1. # List all MSA balances
  2. balances = client.balances.list_msas_for_user_or_business(token)
  3. for balance in client.balances.stream_msas_for_user_or_business(token):
  4. pass
  5. # Retrieve a specific balance
  6. balance = client.balances.find_for_user_or_business(token)

Bulk Issuances (/bulkissuances)

  1. # List all bulk issuances
  2. bulk_issuances = client.bulk_issuances.list()
  3. for bulk_issuance in client.bulk_issuances.stream():
  4. pass
  5. bulk_issuances_page = client.bulk_issuances.page(start_index=0)
  6. # Retrieve a specific bulk issuance
  7. bulk_issuance = client.bulk_issuances.find(token)
  8. # Create a bulk issuance
  9. bulk_issuance = client.bulk_issuances.create({...})

Businesses (/businesses)

  1. # List all businesses
  2. businesses = client.businesses.list()
  3. for business in client.businesses.stream():
  4. pass
  5. businesses_page = client.businesses.page(start_index=0)
  6. # Retrieve a specific business
  7. business = client.businesses.find(token)
  8. # Create a business
  9. business = client.businesses.create({...})
  10. # Update a business
  11. business = client.businesses.save(token, {...})
  12. # Retrieve a specific business SSN
  13. ssn = client.businesses(token).ssn()
  14. # Retrieve a specific business Full SSN
  15. ssn = client.businesses(token).ssn(full_ssn = True)
  16. # List all children of parent business
  17. child_cardholders = client.businesses(token).children.list()
  18. for child_cardholder in client.businesses(token).children.stream():
  19. pass
  20. child_cardholders_page = client.businesses(token).children.page(start_index=0)
  21. # Search for businesses
  22. businesss = client.businesses.look_up({...})

Business Transitions (/businesstransitions)

  1. # Create a business transition
  2. transition = client.businesses(business_token).transitions.create(...)
  3. # Retrieve a specific business transition
  4. transition = client.businesses(business_token).transitions.find(token)
  5. # List transitions for a specific business
  6. transitions = client.businesses(business_token).transitions.list()
  7. for transition in client.businesses(business_token).transitions.stream():
  8. pass
  9. transitions_page = client.businesses(business_token).transitions.page(start_index=0)

Business Notes (/businesses/{token}/notes)

  1. # List all business notes
  2. business_notes = client.businesses(token).notes.list()
  3. for business_note in client.businesses(token).notes.stream():
  4. pass
  5. business_notes_page = client.businesses(token).notes.page(start_index=0)
  6. # Create a business note
  7. business_note = client.businesses(token).notes.create({...})
  8. # Update a business note
  9. business_note = client.businesses(token).notes.save(token, {...})

Card Products (/cardproducts)

  1. # List all card products. Default limit is 25.
  2. card_products = client.card_products.list()
  3. for card_product in client.card_products.stream():
  4. pass
  5. card_products_page = client.card_products.page(start_index=0)
  6. # Retrieve a specific card product
  7. card_product = client.card_products.find(token)
  8. # Create a card product
  9. card_product = client.card_products.create({...})
  10. # Update a card product
  11. card_product = client.card_products.save(token, {...})

Cards (/cards)

  1. # List cards by last 4
  2. cards = client.cards.list(last_four='6789')
  3. for card in client.cards.stream():
  4. pass
  5. cards_page = client.cards.page()
  6. # Lists all cards for one user
  7. cards = client.cards.list_for_user(token)
  8. for card in client.cards.stream_for_user(token):
  9. pass
  10. # Returns a specific card
  11. card = client.cards.find(token)
  12. # Returns a specific card - PAN visible
  13. card = client.cards.find_show_pan(token)
  14. # Retrieve a card by its barcode
  15. card = client.cards.find_by_barcode(barcode)
  16. # Creates a card
  17. data = {...}
  18. card = client.cards.create(data)
  19. # Returns the user and card tokens for specified PAN
  20. tokens = client.cards.tokens_for_pan(pan)
  21. # Updates a card
  22. data = {...}
  23. card = client.cards.save(data)
  24. # Returns a merchant onboarding card
  25. card = client.cards.find_for_merchant(token)
  26. # Returns a specific card - PAN visible
  27. card = client.cards.find_for_merchant_show_pan(token)
  28. # Creates a merchant onboarding card
  29. data = {...}
  30. card = client.cards.create_for_merchant(token, data)

Card Transitions (/cardtransitions)

  1. # Create a card transition
  2. transition = client.cards(token).transitions.create(...)
  3. # Retrieve a specific card transition
  4. transition = client.cards(token).transitions.find(token)
  5. # List transitions for a specific card
  6. transitions = client.cards(token).transitions.list()
  7. for transition in client.cards(token).transitions.stream():
  8. pass
  9. transitions_page = client.cards(token).transitions.page(start_index=0)

Chargebacks (/chargebacks)

  1. # List all chargebacks
  2. chargebacks = client.chargebacks.list()
  3. for chargeback in client.chargebacks.stream():
  4. pass
  5. chargebacks_page = client.chargebacks.page(start_index=0)
  6. # Retrieve a specific chargeback
  7. chargeback = client.chargebacks.find(token)
  8. # Create a chargeback
  9. chargeback = client.chargebacks.create({...})
  10. # Grant provisional credit
  11. client.chargebacks(token).grant_provisional_credit()
  12. # Reverse provisional credit
  13. client.chargebacks(token).reverse_provisional_credit()

Chargeback Transitions (/chargebacks/transitions)

  1. # Create a chargeback transition
  2. transition = client.chargebacks(token).transitions.create(...)
  3. # Retrieve a specific chargeback transition
  4. transition = client.chargebacks(token).transitions.find(token)
  5. # List transitions for a specific chargeback
  6. transitions = client.chargebacks(token).transitions.list()
  7. for transition in client.chargebacks(token).transitions.stream():
  8. pass
  9. transitions_page = client.chargebacks(token).transitions.page(start_index=0)

Commando Modes (/commandomodes)

  1. # List all commando modes
  2. commando_modes = client.commando_modes.list()
  3. for commando_mode in client.commando_modes.stream():
  4. pass
  5. commando_modes_page = client.commando_modes.page(start_index=0)
  6. # Retrieve a specific commando mode
  7. commando_mode = client.commando_modes.find(token)

Commando Mode Transitions (/commandomodes/transitions)

  1. # Retrieve a specific commando mode transition
  2. transition = client.commando_modes(token).transitions.find(token)
  3. # List transitions for a specific commando mode
  4. transitions = client.commando_modes(token).transitions.list()
  5. for transition in client.commando_modes(token).transitions.stream():
  6. pass
  7. transitions_page = client.commando_modes(token).transitions.page(start_index=0)

Digital Wallet Tokens (/digitalwallettokens)

  1. # List all digital wallet tokens
  2. digital_wallet_tokens = client.digital_wallet_tokens.list()
  3. for digital_wallet_token in client.digital_wallet_tokens.stream():
  4. pass
  5. digital_wallet_tokens_page = client.digital_wallet_tokens.page(start_index=0)
  6. # Retrieve a specific digital wallet token
  7. digital_wallet_token = client.digital_wallet_tokens.find(token)
  8. # Retrieve a specific digital wallet token with PAN
  9. digital_wallet_token = client.digital_wallet_tokens.find_show_pan(token)

Digital Wallet Token Transitions (/digitalwallettokentransitions)

  1. # Create a digital wallet token transition
  2. transition = client.digital_wallet_tokens(token).transitions.create(...)
  3. # Retrieve a specific digital wallet token transition
  4. transition = client.digital_wallet_tokens(token).transitions.find(token)
  5. # List transitions for a specific digital wallet token
  6. transitions = client.digital_wallet_tokens(token).transitions.list()
  7. for transition in client.digital_wallet_tokens(token).transitions.stream():
  8. pass
  9. transitions_page = client.digital_wallet_tokens(token).transitions.page(start_index=0)

Direct Deposits (/directdeposits)

  1. # List all direct deposits
  2. direct_deposits = client.direct_deposits.list()
  3. for direct_deposit in client.direct_deposits.stream():
  4. pass
  5. direct_deposits_page = client.direct_deposits.page(start_index=0)
  6. # Retrieve a specific direct deposit
  7. direct_deposit = client.direct_deposits.find(token)

Direct Deposit Transitions (/directdeposits/transitions)

  1. # Create a direct deposit transition
  2. transition = client.direct_deposits(token).transitions.create(...)
  3. # Retrieve a specific direct deposit transition
  4. transition = client.direct_deposits(token).transitions.find(token)
  5. # List transitions for a specific direct deposit
  6. transitions = client.direct_deposits(token).transitions.list()
  7. for transition in client.direct_deposits(token).transitions.stream():
  8. pass
  9. transitions_page = client.direct_deposits(token).transitions.page(start_index=0)

Direct Deposit Accounts (/directdeposits/accounts)

  1. # Retrieve a specific direct deposit account
  2. direct_deposit_account = client.direct_deposits.accounts.find(token)
  3. # Update a direct deposit account
  4. direct_deposit_account = client.direct_deposits.accounts.save(token, {...})

Fees (/fees)

  1. # List all fees
  2. fees = client.fees.list()
  3. for fee in client.fees.stream():
  4. pass
  5. fees_page = client.fees.page(start_index=0)
  6. # Retrieve a specific fee
  7. fee = client.fees.find(token)
  8. # Create a fee
  9. fee = client.fees.create({...})
  10. # Update a fee
  11. fee = client.fees.save(token, {...})

Fee Transfers (/feetransfers)

  1. # Retrieve a specific fee transfer
  2. fee_transfer = client.fee_transfers.find(token)
  3. # Create a fee transfer
  4. fee_transfer = client.fee_transfers.create({...})

Funding Sources (/fundingsources)

  1. # List all funding sources for a specific user
  2. funding_sources = client.list_for_user(user_token)
  3. for funding_source in client.stream_for_user(user_token):
  4. pass
  5. # List all funding sources for a specific business
  6. funding_sources = client.list_for_business(business_token)
  7. for funding_source in client.stream_for_business(business_token):
  8. pass

Funding Source Addresses (/fundingsources/addresses)

  1. # Retrieve a specific funding source address
  2. funding_source_address = client.funding_sources.addresses.find(token)
  3. # Create a funding source address
  4. funding_source_address = client.funding_sources.addresses.create({...})
  5. # Update a funding source address
  6. funding_source_address = client.funding_sources.addresses.save(token, {...})
  7. # list funding source addresses for a specific user
  8. addresses = client.funding_sources.addresses.list_for_user(user_token)
  9. for address in client.funding_sources.addresses.stream_for_user(user_token)
  10. pass
  11. # list funding source addresses for a specific business
  12. addresses = client.funding_sources.addresses.list_for_business(business_token)
  13. for address in client.funding_sources.addresses.stream_for_business(business_token)
  14. pass

ACH Funding Sources (/fundingsources/ach)

  1. # Retrieve a specific ach funding source
  2. ach_funding_source = client.funding_sources.ach.find(token)
  3. # Create an ach funding source
  4. ach_funding_source = client.funding_sources.ach.create({...})
  5. # Update an ach funding source
  6. ach_funding_source = client.funding_sources.ach.save(token, {...})
  7. # Retrieve the dollar amounts used to verify an ACH funding source
  8. client.funding_sources.addresses(token).verification_amounts()

Payment Card Funding Sources (/fundingsources/paymentcard)

  1. # Retrieve a specific payment card funding source
  2. payment_card_funding_source = client.funding_sources.payment_card.find(token)
  3. # Create a payment card funding source
  4. payment_card_funding_source = client.funding_sources.payment_card.create({...})
  5. # Update a payment card funding source
  6. payment_card_funding_source = client.funding_sources.payment_card.save(token, {...})

Program Gateway Funding Sources (/fundingsources/programgateway)

  1. # Retrieve a specific program gateway funding source
  2. program_gateway_funding_source = client.funding_sources.program_gateway.find(token)
  3. # Create a program gateway funding source
  4. program_gateway_funding_source = client.funding_sources.program_gateway.create({...})
  5. # Update a program gateway funding source
  6. program_gateway_funding_source = client.funding_sources.program_gateway.save(token, {...})

Program Funding Sources (/fundingsources/program)

  1. # Retrieve a specific program funding source
  2. program_funding_source = client.funding_sources.program.find(token)
  3. # Create a program funding source
  4. program_funding_source = client.funding_sources.program.create({...})
  5. # Update a program funding source
  6. program_funding_source = client.funding_sources.program.save(token, {...})

GPA Orders (/gpaorders)

  1. # Retrieve a specific gpa order
  2. gpa_order = client.gpa_orders.find(token)
  3. # Create a gpa order
  4. gpa_order = client.gpa_orders.create({...})

GPA Returns (/gpaorders/unloads)

  1. # List all gpa returns
  2. gpa_returns = client.gpa_orders.unloads.list()
  3. for gpa_return in client.gpa_orders.unloads.stream():
  4. pass
  5. gpa_returns_page = client.gpa_orders.unloads.page(start_index=0)
  6. # Retrieve a specific gpa return
  7. gpa_return = client.gpa_orders.unloads.find(token)
  8. # Create a gpa return
  9. gpa_return = client.gpa_orders.unloads.create({...})

KYC (/kyc)

  1. # List KYC results for a specific user
  2. kyc_results = client.kyc.list_for_user(user_token)
  3. for kyc_result in client.kyc.stream_for_user(user_token):
  4. pass
  5. # List KYC results for a specific business
  6. kyc_results = client.kyc.list_for_business(business_token)
  7. for kyc_result in client.kyc.stream_for_business(business_token):
  8. pass
  9. # Retrieve a specific KYC result
  10. kyc = client.kyc.find(token)
  11. # Update KYC answers
  12. client.kyc.save(token, {...})
  13. # Perform a KYC operation
  14. client.kyc.create({...})

MCC Groups (/mccgroups)

  1. # List all mcc groups
  2. mcc_groups = client.mcc_groups.list()
  3. for mcc_group in client.mcc_groups.stream():
  4. pass
  5. mcc_groups_page = client.mcc_groups.page(start_index=0)
  6. # Retrieve a specific mcc group
  7. mcc_group = client.mcc_groups.find(token)
  8. # Create a mcc group
  9. mcc_group = client.mcc_groups.create({...})
  10. # Update a mcc group
  11. mcc_group = client.mcc_groups.save(token, {...})

Merchants (/merchants)

  1. # List all merchants
  2. merchants = client.merchants.list()
  3. for merchant in client.merchants.stream():
  4. pass
  5. merchants_page = client.merchants.page(start_index=0)
  6. # Retrieve a specific merchant
  7. merchant = client.merchants.find(token)
  8. # Create a merchant
  9. merchant = client.merchants.create({...})
  10. # Update a merchant
  11. merchant = client.merchants.save(token, {...})

Merchant Stores (/merchants/{token}/stores)

  1. # List all merchant stores
  2. merchant_stores = client.merchants(token).stores.list()
  3. for merchant_store in client.merchants(token).stores.stream():
  4. pass
  5. merchant_stores_page = client.merchants(token).stores.page(start_index=0)

MSA Orders (/msaorders)

  1. # Retrieve a specific msa order
  2. msa_order = client.msa_orders.find(token)
  3. # Create a msa order
  4. msa_order = client.msa_orders.create({...})
  5. # Update a msa order
  6. msa_order = client.msa_orders.save(token, {...})

MSA Order Unloads (/msaorders/unloads)

  1. # List all msa order unloads
  2. msa_order_unloads = client.msa_orders.unloads.list()
  3. for msa_order_unload in client.msa_orders.unloads.stream():
  4. pass
  5. msa_order_unloads_page = client.msa_orders.unloads.page(start_index=0)
  6. # Retrieve a specific msa order unload
  7. msa_order_unload = client.msa_orders.unloads.find(token)
  8. # Create a msa order unload
  9. msa_order_unload = client.msa_orders.unloads.create({...})

Offer Orders (/offerorders)

  1. # Retrieve a specific offer order
  2. offer_order = client.offer_orders.find(token)
  3. # Create an offer order
  4. offer_order = client.offer_orders.create({...})

Pin Control Tokens (/pins)

  1. # Create a pin control token
  2. pin_control_token = client.pins.create({...})
  3. # Update a pin control token
  4. pin_control_token = client.pins.save(token, {...})

Program Transfers (/programtransfers)

  1. # List all program transfers
  2. program_transfers = client.program_transfers.list()
  3. for program_transfer in client.program_transfers.stream():
  4. pass
  5. program_transfers_page = client.program_transfers.page(start_index=0)
  6. # Retrieve a specific program transfer
  7. program_transfer = client.program_transfers.find(token)
  8. # Create a program transfer
  9. program_transfer = client.program_transfers.create({...})

Program Transfer Types (/programtransfers/types)

  1. # List all program transfer types
  2. program_transfer_types = client.program_transfers.types.list()
  3. for program_transfer_type in client.program_transfers.types.stream():
  4. pass
  5. program_transfer_types_page = client.program_transfers.types.page(start_index=0)
  6. # Retrieve a specific program transfer type
  7. program_transfer_type = client.program_transfers.types.find(token)
  8. # Create a program transfer type
  9. program_transfer_type = client.program_transfers.types.create({...})
  10. # Update a program transfer type
  11. program_transfer_type = client.program_transfers.types.save(token, {...})

Push-to-Cards (/pushtocards)

  1. # List all push-to-cards
  2. push_to_cards = client.push_to_cards.list()
  3. for push_to_card in client.push_to_cards.stream():
  4. pass
  5. push_to_cards_page = client.push_to_cards.page(start_index=0)
  6. # Retrieve a specific push-to-card
  7. push_to_card = client.push_to_cards.find(token)
  8. # Create a push-to-card
  9. push_to_card = client.push_to_cards.create({...})
  10. # Update a push-to-card
  11. push_to_card = client.push_to_cards.save(token, {...})

Push-to-Card Disbursements (/pushtocards/disburse)

  1. # List all push-to-card disbursements
  2. push_to_card_disbursements = client.push_to_cards.disburse.list()
  3. for push_to_card_disbursement in client.push_to_cards.disburse.stream():
  4. pass
  5. push_to_card_disbursements_page = client.push_to_cards.disburse.page(start_index=0)
  6. # Retrieve a specific push-to-card disbursement
  7. push_to_card_disbursement = client.push_to_cards.disburse.find(token)
  8. # Create a push-to-card disbursement
  9. push_to_card_disbursement = client.push_to_cards.disburse.create({...})

Push-to-Card Payment Cards (/pushtocards/paymentcard)

  1. # List all push-to-card payment cards
  2. push_to_card_payment_cards = client.push_to_cards.payment_card.list()
  3. for push_to_card_payment_card in client.push_to_cards.payment_card.stream():
  4. pass
  5. push_to_card_payment_cards_page = client.push_to_cards.payment_card.page(start_index=0)
  6. # Retrieve a specific push-to-card payment card
  7. push_to_card_payment_card = client.push_to_cards.payment_card.find(token)
  8. # Create a push-to-card payment card
  9. push_to_card_payment_card = client.push_to_cards.payment_card.create({...})

Realtime Fee Groups (/realtimefeegroups)

  1. # List all realtime fee groups
  2. realtime_fee_groups = client.real_time_fee_groups.list()
  3. for realtime_fee_group in client.real_time_fee_groups.stream():
  4. pass
  5. realtime_fee_groups_page = client.real_time_fee_groups.page(start_index=0)
  6. # Retrieve a specific realtime fee group
  7. realtime_fee_group = client.real_time_fee_groups.find(token)
  8. # Create a realtime fee group
  9. realtime_fee_group = client.real_time_fee_groups.create({...})
  10. # Update a realtime fee group
  11. realtime_fee_group = client.real_time_fee_groups.save(token, {...})

Transactions (/transactions)

  1. # List all transactions
  2. transactions = client.transactions.list()
  3. for transaction in client.transactions.stream():
  4. pass
  5. transactions_page = client.transactions.page(start_index=0)
  6. # List all transactions for a specific funding source
  7. transactions = client.transactions.list_for_funding_source(funding_source_token)
  8. for transaction in client.transactions.stream_for_funding_source(funding_source_token):
  9. pass
  10. # Retrieve a specific transaction
  11. transaction = client.transactions.find(token)
  1. # List all related transations
  2. related_transations = client.transactions(token).related.list()
  3. for related_transation in client.transactions(token).related.stream():
  4. pass
  5. related_transations_page = client.transactions(token).related.page(start_index=0)

Users (/users)

  1. # List all users. Default limit is 1000.
  2. users = client.users.list()
  3. for user in client.users.stream():
  4. pass
  5. users_page = client.users.page(start_index=0)
  6. # Retrieve a specific user
  7. user = client.users.find(token)
  8. # Create a user
  9. user = client.users.create({...})
  10. # Update a user
  11. user = client.users.save(token, {...})
  12. # Retrieve a specific user SSN
  13. ssn = client.users(token).ssn()
  14. # Retrieve a specific user Full SSN
  15. ssn = client.users(token).ssn(full_ssn = True)
  16. # List all children of parent user
  17. child_cardholders = client.users(token).children.list()
  18. for child_cardholder in client.users(token).children.stream():
  19. pass
  20. child_cardholders_page = client.users(token).children.page(start_index=0)
  21. # Search for users, if look_up data is not specified by default lists 1000 users
  22. users = client.users.look_up({...})

User Transitions (/usertransitions)

  1. # Create a user transition
  2. transition = client.users(token).transitions.create(...)
  3. # Retrieve a specific user transition
  4. transition = client.users(token).transitions.find(token)
  5. # List transitions for a specific user
  6. transitions = client.users(token).transitions.list()
  7. for transition in client.users(token).transitions.stream():
  8. pass
  9. transitions_page = client.users(token).transitions.page(start_index=0)

User Notes (/users/{token}/notes)

  1. # List all user notes
  2. user_notes = client.users(token).notes.list()
  3. for user_note in client.users(token).notes.stream():
  4. pass
  5. user_notes_page = client.users(token).notes.page(start_index=0)
  6. # Create a user note
  7. user_note = client.users(token).notes.create({...})
  8. # Update a user note
  9. user_note = client.users(token).notes.save(token, {...})

Velocity Controls (/velocitycontrols)

  1. # List all velocity controls
  2. velocity_controls = client.velocity_controls.list()
  3. for velocity_control in client.velocity_controls.stream():
  4. pass
  5. velocity_controls_page = client.velocity_controls.page(start_index=0)
  6. # Retrieve a specific velocity control
  7. velocity_control = client.velocity_controls.find(token)
  8. # Create a velocity control
  9. velocity_control = client.velocity_controls.create({...})
  10. # Update a velocity control
  11. velocity_control = client.velocity_controls.save(token, {...})
  12. # List velocity controls available for a specific user
  13. velocity_controls = list_available_for_user(user_token)
  14. for velocity_control in stream_available_for_user(user_token):
  15. pass

Webhooks (/webhooks)

  1. # List all webhooks
  2. webhooks = client.webhooks.list()
  3. for webhook in client.webhooks.stream():
  4. pass
  5. webhooks_page = client.webhooks.page(start_index=0)
  6. # Retrieve a specific webhook
  7. webhook = client.webhooks.find(token)
  8. # Create a webhook
  9. webhook = client.webhooks.create({...})
  10. # Update a webhook
  11. webhook = client.webhooks.save(token, {...})
  12. # Ping a webhook
  13. client.webhooks(token).ping()
  14. # Resend a webhook
  15. client.webhooks(token).resent(event_type, event_token)