Skip to content

BlueSnap offers a Payment Orchestration Platform for global payments, increasing revenue and reducing costs. With comprehensive back-end solutions, businesses can accept payments through multiple sales channels in 200+ geographies. Headquartered in Waltham, MA and Dublin, Ireland.

License

Notifications You must be signed in to change notification settings

konfig-sdks/blue-snap-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Visit Bluesnap

Bluesnap

At BlueSnap, we look at payments a little differently. Our Payment Orchestration Platform helps businesses accept payments globally and is designed to increase revenue and reduces costs. We provide a comprehensive back-end solutions that simplifies the complexity of payments, managing the full process from start to finish.

BlueSnap supports payments through multiple sales channels such as online and mobile sales, marketplaces, subscriptions, invoice payments and manual orders through a virtual terminal. And for businesses looking for embedded payments, we offer white-labeled payments for platforms with automated underwriting and onboarding that supports marketplaces and split payments.

And with one integration and contract, businesses can sell in over 200 geographies with access to local acquiring in 47 countries, 110+ currencies and 100+ global payment types, including popular eWallets, automated accounts receivable, world-class fraud protection and chargeback management, built-in solutions for regulation and tax compliance, and unified global reporting to help businesses grow.

With a US headquarters in Waltham, MA, and EU headquarters in Dublin, Ireland, BlueSnap is backed by world-class private equity investors including Great Hill Partners and Parthenon Capital Partners.

Learn more at BlueSnap.com

Table of Contents

Requirements

Python >=3.7

Installation

Getting Started

from pprint import pprint
from blue_snap_python_sdk import BlueSnap, ApiException

bluesnap = BlueSnap(
    username="YOUR_USERNAME",
    password="YOUR_PASSWORD",
    sec1="YOUR_API_KEY",
)

try:
    # Create Debit Agreement
    bluesnap.agreement.create_debit_for_aus_can(
        region="ca",
        type="onetime",
        planid="string_example",
        overriderecurringchargeamount="string_example",
    )
except ApiException as e:
    print("Exception when calling AgreementApi.create_debit_for_aus_can: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from blue_snap_python_sdk import BlueSnap, ApiException

bluesnap = BlueSnap(
    username="YOUR_USERNAME",
    password="YOUR_PASSWORD",
    sec1="YOUR_API_KEY",
)


async def main():
    try:
        # Create Debit Agreement
        await bluesnap.agreement.acreate_debit_for_aus_can(
            region="ca",
            type="onetime",
            planid="string_example",
            overriderecurringchargeamount="string_example",
        )
    except ApiException as e:
        print("Exception when calling AgreementApi.create_debit_for_aus_can: %s\n" % e)
        pprint(e.body)
        pprint(e.headers)
        pprint(e.status)
        pprint(e.reason)
        pprint(e.round_trip_time)


asyncio.run(main())

Raw HTTP Response

To access raw HTTP response values, use the .raw namespace.

from pprint import pprint
from blue_snap_python_sdk import BlueSnap, ApiException

bluesnap = BlueSnap(
    username="YOUR_USERNAME",
    password="YOUR_PASSWORD",
    sec1="YOUR_API_KEY",
)

try:
    # Create Debit Agreement
    create_debit_for_aus_can_response = bluesnap.agreement.raw.create_debit_for_aus_can(
        region="ca",
        type="onetime",
        planid="string_example",
        overriderecurringchargeamount="string_example",
    )
    pprint(create_debit_for_aus_can_response.headers)
    pprint(create_debit_for_aus_can_response.status)
    pprint(create_debit_for_aus_can_response.round_trip_time)
except ApiException as e:
    print("Exception when calling AgreementApi.create_debit_for_aus_can: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Reference

bluesnap.agreement.create_debit_for_aus_can

for Australia and Canada

🛠️ Usage

bluesnap.agreement.create_debit_for_aus_can(
    region="ca",
    type="onetime",
    planid="string_example",
    overriderecurringchargeamount="string_example",
)

⚙️ Parameters

region: str

Represents the country. Possible Values: au, ca

type: str

Represents the mandate type. Possible Values: onetime,recurring, ondemand

planid: str

SKU number

overriderecurringchargeamount: str

the amount which overrides recurring charge

🌐 Endpoint

/agreements/debit/{region}/{type} post

🔙 Back to Table of Contents


bluesnap.agreement.get_debit

for Australia and Canada

🛠️ Usage

bluesnap.agreement.get_debit(
    agreement_id="1065",
)

⚙️ Parameters

agreement_id: str

Argument included in the response for the Create Debit Agreement request

🌐 Endpoint

/agreements/{agreementId} get

🔙 Back to Table of Contents


bluesnap.authorization.create_transaction

Auth Only

🛠️ Usage

bluesnap.authorization.create_transaction(
    amount=11,
    soft_descriptor="DescTest",
    card_holder_info={
        "first_name": "test first name",
        "last_name": "test last name",
        "zip": "02453",
    },
    currency="USD",
    credit_card={
        "expiration_year": 2026,
        "security_code": 837,
        "expiration_month": "02",
        "card_number": "4263982640269299",
    },
    card_transaction_type="AUTH_ONLY",
)

⚙️ Parameters

amount: Union[int, float]
soft_descriptor: str
currency: str
card_transaction_type: str

⚙️ Request Body

AuthorizationCreateTransactionRequest

🌐 Endpoint

/transactions post

🔙 Back to Table of Contents


bluesnap.plan.create_recurring_plan

Create Plan

🛠️ Usage

bluesnap.plan.create_recurring_plan(
    charge_frequency="MONTHLY",
    grace_period_days=10,
    trial_period_days=14,
    initial_charge_amount=100,
    name="Gold Plan",
    currency="USD",
    max_number_of_charges=12,
    recurring_charge_amount=29.99,
    charge_on_plan_switch=True,
)

⚙️ Parameters

charge_frequency: str
grace_period_days: int
trial_period_days: int
initial_charge_amount: int
name: str
currency: str
max_number_of_charges: int
recurring_charge_amount: Union[int, float]
charge_on_plan_switch: bool

⚙️ Request Body

PlanCreateRecurringPlanRequest

🌐 Endpoint

/recurring/plans post

🔙 Back to Table of Contents


bluesnap.plan.get_all

Retrieve All Plans

🛠️ Usage

bluesnap.plan.get_all(
    pagesize="5",
    after="2185254",
    gettotal=True,
    fulldescription=False,
)

⚙️ Parameters

pagesize: str
after: str
gettotal: bool
fulldescription: bool

🌐 Endpoint

/recurring/plans?{parameters} get

🔙 Back to Table of Contents


bluesnap.plan.get_specific

Retrieve Specific Plan

🛠️ Usage

bluesnap.plan.get_specific(
    plan_id=2283845,
)

⚙️ Parameters

plan_id: int

BlueSnap identifier for the plan.

🌐 Endpoint

/recurring/plans/{planId} get

🔙 Back to Table of Contents


bluesnap.plan.update_recurring_plan

Update Plan

🛠️ Usage

bluesnap.plan.update_recurring_plan(
    plan_id=2111111,
    charge_frequency="MONTHLY",
    trial_period_days="7",
    initial_charge_amount="30",
    name="Gold Plan",
    currency="USD",
    recurring_charge_amount="19",
)

⚙️ Parameters

plan_id: int

BlueSnap identifier for the plan.

charge_frequency: str
trial_period_days: str
initial_charge_amount: str
name: str
currency: str
recurring_charge_amount: str

⚙️ Request Body

PlanUpdateRecurringPlanRequest

🌐 Endpoint

/recurring/plans/{planId} put

🔙 Back to Table of Contents


bluesnap.reversal.auth_transaction

Auth Reversal

🛠️ Usage

bluesnap.reversal.auth_transaction(
    card_transaction_type="AUTH_REVERSAL",
    transaction_id=1011671987,
)

⚙️ Parameters

card_transaction_type: str
transaction_id: int

⚙️ Request Body

ReversalAuthTransactionRequest

🌐 Endpoint

/transactions put

🔙 Back to Table of Contents


bluesnap.shopper.create_vaulted_shopper

Create Vaulted Shopper

🛠️ Usage

bluesnap.shopper.create_vaulted_shopper(
    payment_sources={},
    first_name="FirstName",
    last_name="LastName",
)

⚙️ Parameters

first_name: str
last_name: str

⚙️ Request Body

ShopperCreateVaultedShopperRequest

🌐 Endpoint

/vaulted-shoppers post

🔙 Back to Table of Contents


bluesnap.shopper.delete_vaulted_shopper

Delete Vaulted Shopper

🛠️ Usage

bluesnap.shopper.delete_vaulted_shopper(
    vaulted_shopper_id="20769005",
)

⚙️ Parameters

vaulted_shopper_id: str

vaultedShopperId received from BlueSnap

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} delete

🔙 Back to Table of Contents


bluesnap.shopper.get

Retrieve Vaulted Shopper

🛠️ Usage

bluesnap.shopper.get(
    vaulted_shopper_id="20769005",
)

⚙️ Parameters

vaulted_shopper_id: str

vaultedShopperId received from BlueSnap

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} get

🔙 Back to Table of Contents


bluesnap.shopper.update_vaulted_shopper

Update Vaulted Shopper

🛠️ Usage

bluesnap.shopper.update_vaulted_shopper(
    vaulted_shopper_id="40444721",
    payment_sources={},
    first_name="FirstName",
    last_name="LastName",
)

⚙️ Parameters

vaulted_shopper_id: str

vaultedShopperId received from BlueSnap

first_name: str
last_name: str

⚙️ Request Body

ShopperUpdateVaultedShopperRequest

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} put

🔙 Back to Table of Contents


bluesnap.subscription.create_merchant_managed_charge

Create Merchant-Managed Subscription Charge

🛠️ Usage

bluesnap.subscription.create_merchant_managed_charge(
    subscription_id=10543419,
    amount=45,
    currency="USD",
    merchant_transaction_id="MyUniqueOnDemandSubscription",
    tax_reference="048deff0-a285-47e1-bc39-42f79bf0095b",
)

⚙️ Parameters

subscription_id: int

BlueSnap identifier for the subscription.

amount: Union[int, float]
currency: str
merchant_transaction_id: str
tax_reference: str

⚙️ Request Body

SubscriptionCreateMerchantManagedChargeRequest

🌐 Endpoint

/recurring/ondemand/{subscriptionId} post

🔙 Back to Table of Contents


bluesnap.subscription.create_merchant_managed_subscription

Create Merchant-Managed Subscription

🛠️ Usage

bluesnap.subscription.create_merchant_managed_subscription(
    amount=45,
    currency="USD",
    payer_info={
        "first_name": "John",
        "last_name": "Doe",
        "zip": "02453",
        "country": "us",
    },
    payment_source={},
)

⚙️ Parameters

amount: Union[int, float]
currency: str

⚙️ Request Body

SubscriptionCreateMerchantManagedSubscriptionRequest

🌐 Endpoint

/recurring/ondemand post

🔙 Back to Table of Contents


bluesnap.subscription.create_new

Create Subscription

🛠️ Usage

bluesnap.subscription.create_new(
    payer_info={
        "zip": "02453",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "1234567890",
    },
    payment_source={},
    plan_id=2283845,
)

⚙️ Parameters

plan_id: int

⚙️ Request Body

SubscriptionCreateNewRequest

🌐 Endpoint

/recurring/subscriptions post

🔙 Back to Table of Contents


bluesnap.subscription.get_specific

Retrieve Specific Subscription

🛠️ Usage

bluesnap.subscription.get_specific(
    subscription_id=8491535,
)

⚙️ Parameters

subscription_id: int

BlueSnap identifier for the subscription.

🌐 Endpoint

/recurring/subscriptions/{subscriptionId} get

🔙 Back to Table of Contents


bluesnap.subscription.get_switch_charge_amount

Retrieve Subscription Switch Charge Amount

🛠️ Usage

bluesnap.subscription.get_switch_charge_amount(
    newplanid="111111",
    newquantity="2",
)

⚙️ Parameters

newplanid: str
newquantity: str

🌐 Endpoint

/recurring/subscriptions/:subscriptionId/switch-charge-amount get

🔙 Back to Table of Contents


bluesnap.subscription.list_all_subscriptions

Retrieve All Subscriptions

🛠️ Usage

bluesnap.subscription.list_all_subscriptions(
    pagesize="5",
    after="34567",
    gettotal=True,
    fulldescription=False,
)

⚙️ Parameters

pagesize: str
after: str
gettotal: bool
fulldescription: bool

🌐 Endpoint

/recurring/subscriptions?{parameters} get

🔙 Back to Table of Contents


bluesnap.subscription.list_charges

Retrieve All Charges for a Subscription

🛠️ Usage

bluesnap.subscription.list_charges(
    pagesize="3",
    after="163193",
    fulldescription=False,
)

⚙️ Parameters

pagesize: str
after: str
fulldescription: bool

🌐 Endpoint

/:subscriptionId/charges?{parameters} get

🔙 Back to Table of Contents


bluesnap.subscription.update_subscription

Update Subscription

🛠️ Usage

bluesnap.subscription.update_subscription(
    subscription_id=8491543,
    plan_id="2283849",
)

⚙️ Parameters

subscription_id: int

BlueSnap identifier for the subscription.

plan_id: str

⚙️ Request Body

SubscriptionUpdateSubscriptionRequest

🌐 Endpoint

/recurring/subscriptions/{subscriptionId} put

🔙 Back to Table of Contents


bluesnap.transaction.approve_merchant_transaction

Merchant Approve Transaction

🛠️ Usage

bluesnap.transaction.approve_merchant_transaction(
    transactionid="38612140",
    approvetransaction=True,
)

⚙️ Parameters

transactionid: str

either transactionid or merchanttransactionid is required
ID of the transaction to be approved/declined

approvetransaction: bool

Set to true to approve the transaction or to false to decline the transaction. Default value is true.

🌐 Endpoint

/transactions/approval put

🔙 Back to Table of Contents


bluesnap.transaction.cancel_pending_refund

Cancel Pending Refund

🛠️ Usage

bluesnap.transaction.cancel_pending_refund(
    transaction_id="1109144995",
)

⚙️ Parameters

transaction_id: str

transactionId received from BlueSnap

🌐 Endpoint

/transactions/pending-refund/{transactionId} delete

🔙 Back to Table of Contents


bluesnap.transaction.create_batch_transaction

Create Batch Transaction

🛠️ Usage

bluesnap.transaction.create_batch_transaction(
    batch_transaction={
        "batch_id": "567890",
        "callback_url": "http://example.com/batch_callback",
    },
)

⚙️ Parameters

⚙️ Request Body

TransactionCreateBatchTransactionRequest

🌐 Endpoint

/batch-transactions post

🔙 Back to Table of Contents


bluesnap.transaction.create_sofort_transaction

Create Sofort Transaction

🛠️ Usage

bluesnap.transaction.create_sofort_transaction(
    ecp_transaction={
        "routing_number": "011075150",
        "account_type": "CONSUMER_CHECKING",
        "account_number": 4099999992,
    },
    amount=42,
    payer_info={
        "zip": "12345",
        "first_name": "John",
        "last_name": "Doe",
        "phone": "1234567890",
        "country": "uk",
    },
    soft_descriptor="ABC COMPANY",
    currency="GBP",
    authorized_by_shopper=True,
    becs_direct_debit_transaction={
        "bsb_number": "980201",
        "account_number": "9990000001",
        "account_name": "Boris Britva",
        "financial_institution": "financialInstitution",
        "branch_name": "branchName",
        "agreement_id": 81,
    },
    ideal_transaction={
        "return_url": "http://www.returnURL.com",
    },
    local_bank_transfer_transaction={},
    paypal_transaction={
        "cancel_url": "http://www.cancelURL.com",
        "return_url": "http://www.returnURL.com",
        "transaction_type": "SET_ORDER",
    },
    acss_direct_debit_transaction={
        "routing_number": "001004820",
        "account_number": "9990000001",
        "account_type": "PERSONAL",
        "agreement_id": 87,
    },
    sepa_direct_debit_transaction={
        "iban": "DE09100100101234567893",
    },
    sofort_transaction={
        "return_url": "http://www.returnURL.com",
    },
)

⚙️ Parameters

amount: Union[int, float]
soft_descriptor: str
currency: str
authorized_by_shopper: bool

⚙️ Request Body

TransactionCreateSofortTransactionRequest

🌐 Endpoint

/alt-transactions post

🔙 Back to Table of Contents


bluesnap.transaction.get_batch_transaction

Retrieve Batch Transaction

🛠️ Usage

bluesnap.transaction.get_batch_transaction(
    batch_id="567890",
)

⚙️ Parameters

batch_id: str

batch ID sent in the Create Batch Transaction request

🌐 Endpoint

/batch-transactions/{batchId} get

🔙 Back to Table of Contents


bluesnap.transaction.get_by_id

Retrieve

🛠️ Usage

bluesnap.transaction.get_by_id(
    transaction_id="1011582369",
)

⚙️ Parameters

transaction_id: str

transaction ID received in the response from BlueSnap

🌐 Endpoint

/transactions/{transactionId} get

🔙 Back to Table of Contents


bluesnap.transaction.get_paypal_transaction

Retrieve PayPal Transaction

🛠️ Usage

bluesnap.transaction.get_paypal_transaction(
    order_id="5666625",
)

⚙️ Parameters

order_id: str

order ID received in the response

🌐 Endpoint

/alt-transactions/resolve?orderId={orderId} get

🔙 Back to Table of Contents


bluesnap.transaction.get_pre_notification_debit_agreement

for Australia and Canada

🛠️ Usage

bluesnap.transaction.get_pre_notification_debit_agreement(
    transaction_id="38943468",
)

⚙️ Parameters

transaction_id: str

Argument included in the response for the Create Debit Agreement request

🌐 Endpoint

/agreements/prenotification/{transactionId} get

🔙 Back to Table of Contents


bluesnap.transaction.get_sepa_dd

Retrieve SEPA DD Transaction

🛠️ Usage

bluesnap.transaction.get_sepa_dd(
    transaction_id="1014672453",
)

⚙️ Parameters

transaction_id: str

transaction ID received in the response from BlueSnap

🌐 Endpoint

/alt-transactions/{transactionId} get

🔙 Back to Table of Contents


bluesnap.transaction.get_sofort_transaction

Retrieve Sofort Transaction

🛠️ Usage

bluesnap.transaction.get_sofort_transaction(
    order_id=20922493,
)

⚙️ Parameters

order_id: int

Order ID received in the Create Sofort Transaction response from BlueSnap

🌐 Endpoint

/alt-transactions/resolve get

🔙 Back to Table of Contents


bluesnap.transaction.initiate_refund

Refund

🛠️ Usage

bluesnap.transaction.initiate_refund(
    transaction_id="1095710747",
    reason="Refund for order #1992",
    cancel_subscriptions=False,
    transaction_meta_data={},
)

⚙️ Parameters

transaction_id: str

ID of the transaction to be refunded
Required if not using merchantTransactionId

reason: str
cancel_subscriptions: bool

⚙️ Request Body

TransactionInitiateRefundRequest

🌐 Endpoint

/transactions/refund/{transactionId} post

🔙 Back to Table of Contents


bluesnap.transaction.update_paypal_transaction

Update PayPal Transaction

🛠️ Usage

bluesnap.transaction.update_paypal_transaction(
    amount=105,
    currency="USD",
    paypal_transaction={
        "order_id": "7078033",
        "transaction_type": "DO_ORDER",
    },
)

⚙️ Parameters

amount: Union[int, float]
currency: str

⚙️ Request Body

TransactionUpdatePaypalTransactionRequest

🌐 Endpoint

/alt-transactions put

🔙 Back to Table of Contents


bluesnap.vendor.create

Create Vendor

🛠️ Usage

bluesnap.vendor.create(
    email="vendor@example.com",
    first_name="Joe",
    last_name="Smith",
    phone="1-123-456-7890",
    address="123 Main Street",
    city="Boston",
    country="US",
    state="MA",
    zip="02453",
    default_payout_currency="USD",
    ipn_url="https://ipnaddress.com",
    vendor_principal={
        "first_name": "Joe",
        "last_name": "Smith",
        "address": "123 Main Street",
        "city": "Boston",
        "country": "US",
        "zip": "02453",
        "dob": "28-09-9999",
        "personal_identification_number": "1234",
        "driver_license_number": "561196411",
        "email": "individual.vendor@bluesnap.com",
    },
    vendor_agreement={
        "commission_percent": 30,
    },
    payout_info={},
)

⚙️ Parameters

email: str
first_name: str
last_name: str
phone: str
address: str
city: str
country: str
state: str
zip: str
default_payout_currency: str
ipn_url: str
payout_info: Dict[str, Union[bool, date, datetime, dict, float, int, list, str, None]]

⚙️ Request Body

VendorCreateRequest

🌐 Endpoint

/vendors post

🔙 Back to Table of Contents


bluesnap.vendor.get_all_vendors

Retrieve All Vendors

🛠️ Usage

bluesnap.vendor.get_all_vendors(
    gettotal=True,
)

⚙️ Parameters

gettotal: bool

🌐 Endpoint

/vendors?{parameters} get

🔙 Back to Table of Contents


bluesnap.vendor.get_vendor

Retrieve Vendor

🛠️ Usage

bluesnap.vendor.get_vendor(
    vendor_id=837389,
)

⚙️ Parameters

vendor_id: int

BlueSnap identifier for the vendor

🌐 Endpoint

/vendors/{vendorId} get

🔙 Back to Table of Contents


bluesnap.vendor.update_vendor

Update Vendor

🛠️ Usage

bluesnap.vendor.update_vendor(
    vendor_id=1,
    email="vendor@bluesnap.com",
    name="Important Vendor",
    first_name="Joe",
    last_name="Smith",
    address="123 Main Street",
    city="testing city",
    zip="02453",
    country="US",
    phone="1-054-976-6778",
    state="MA",
    tax_id=123456789,
    vendor_url="http://mycompany.com",
    ipn_url="https://ipnaddress.com",
    default_payout_currency="USD",
    vendor_principal={
        "first_name": "Joe",
        "last_name": "Smith",
        "address": "123 Main Street",
        "city": "Juneau",
        "zip": "02453",
        "country": "US",
        "dob": "28-09-9999",
        "personal_identification_number": 1234,
        "driver_license_number": "561196411",
        "email": "principal.name@vendor.com",
    },
    payout_info=[
        {
            "payout_type": "ACH",
            "base_currency": "USD",
            "name_on_account": "vendor",
            "bank_account_class": "PERSONAL",
            "bank_account_type": "CHECKING",
            "bank_name": "Leumi",
            "bank_id": "123456789",
            "country": "US",
            "city": "Portland",
            "address": "1 bank address",
            "state": "MA",
            "zip": "02453",
            "bank_account_id": "123456789",
            "minimal_payout_amount": 50,
            "payment_reference": "Payment for vendor 1234",
            "refund_reserve": 200,
        }
    ],
    vendor_agreement={
        "commission_percent": 20,
        "account_status": "ACTIVE",
    },
)

⚙️ Parameters

vendor_id: int

BlueSnap identifier for the vendor

email: str
name: str
first_name: str
last_name: str
address: str
city: str
zip: str
country: str
phone: str
state: str
tax_id: int
vendor_url: str
ipn_url: str
default_payout_currency: str

⚙️ Request Body

VendorUpdateVendorRequest

🌐 Endpoint

/vendors/{vendorId} put

🔙 Back to Table of Contents


Author

This Python package is automatically generated by Konfig

About

BlueSnap offers a Payment Orchestration Platform for global payments, increasing revenue and reducing costs. With comprehensive back-end solutions, businesses can accept payments through multiple sales channels in 200+ geographies. Headquartered in Waltham, MA and Dublin, Ireland.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages