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.

Notifications You must be signed in to change notification settings

konfig-sdks/blue-snap-typescript-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Visit 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

Installation

Getting Started

import { BlueSnap } from "blue-snap-typescript-sdk";

const bluesnap = new BlueSnap({
  // Defining the base path is optional and defaults to https://sandbox.bluesnap.com/services/2
  // basePath: "https://sandbox.bluesnap.com/services/2",
  apiKey: "API_KEY",
});

const createDebitForAusCanResponse =
  await bluesnap.agreement.createDebitForAusCan({
    region: "ca",
    type: "onetime",
  });

console.log(createDebitForAusCanResponse);

Reference

bluesnap.agreement.createDebitForAusCan

for Australia and Canada

πŸ› οΈ Usage

const createDebitForAusCanResponse =
  await bluesnap.agreement.createDebitForAusCan({
    region: "ca",
    type: "onetime",
  });

βš™οΈ Parameters

region: string

Represents the country. Possible Values: au, ca

type: string

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

planid: string

SKU number

overriderecurringchargeamount: string

the amount which overrides recurring charge

🌐 Endpoint

/agreements/debit/{region}/{type} POST

πŸ”™ Back to Table of Contents


bluesnap.agreement.getDebit

for Australia and Canada

πŸ› οΈ Usage

const getDebitResponse = await bluesnap.agreement.getDebit({
  agreementId: "1065",
});

βš™οΈ Parameters

agreementId: string

Argument included in the response for the Create Debit Agreement request

🌐 Endpoint

/agreements/{agreementId} GET

πŸ”™ Back to Table of Contents


bluesnap.authorization.createTransaction

πŸ› οΈ Usage

const createTransactionResponse =
  await bluesnap.authorization.createTransaction({
    amount: 11,
    softDescriptor: "DescTest",
    currency: "USD",
    cardTransactionType: "AUTH_ONLY",
  });

βš™οΈ Parameters

amount: number
softDescriptor: string
currency: string
cardTransactionType: string

🌐 Endpoint

/transactions POST

πŸ”™ Back to Table of Contents


bluesnap.plan.createRecurringPlan

πŸ› οΈ Usage

const createRecurringPlanResponse = await bluesnap.plan.createRecurringPlan({
  chargeFrequency: "MONTHLY",
  gracePeriodDays: 10,
  trialPeriodDays: 14,
  initialChargeAmount: 100,
  name: "Gold Plan",
  currency: "USD",
  maxNumberOfCharges: 12,
  recurringChargeAmount: 29.99,
  chargeOnPlanSwitch: true,
});

βš™οΈ Parameters

chargeFrequency: string
gracePeriodDays: number
trialPeriodDays: number
initialChargeAmount: number
name: string
currency: string
maxNumberOfCharges: number
recurringChargeAmount: number
chargeOnPlanSwitch: boolean

🌐 Endpoint

/recurring/plans POST

πŸ”™ Back to Table of Contents


bluesnap.plan.getAll

πŸ› οΈ Usage

const getAllResponse = await bluesnap.plan.getAll({
  pagesize: "5",
  after: "2185254",
  gettotal: true,
  fulldescription: false,
});

βš™οΈ Parameters

pagesize: string
after: string
gettotal: boolean
fulldescription: boolean

🌐 Endpoint

/recurring/plans?{parameters} GET

πŸ”™ Back to Table of Contents


bluesnap.plan.getSpecific

πŸ› οΈ Usage

const getSpecificResponse = await bluesnap.plan.getSpecific({
  planId: 2283845,
});

βš™οΈ Parameters

planId: number

BlueSnap identifier for the plan.

🌐 Endpoint

/recurring/plans/{planId} GET

πŸ”™ Back to Table of Contents


bluesnap.plan.updateRecurringPlan

πŸ› οΈ Usage

const updateRecurringPlanResponse = await bluesnap.plan.updateRecurringPlan({
  planId: 2111111,
  chargeFrequency: "MONTHLY",
  trialPeriodDays: "7",
  initialChargeAmount: "30",
  name: "Gold Plan",
  currency: "USD",
  recurringChargeAmount: "19",
});

βš™οΈ Parameters

planId: number

BlueSnap identifier for the plan.

chargeFrequency: string
trialPeriodDays: string
initialChargeAmount: string
name: string
currency: string
recurringChargeAmount: string

🌐 Endpoint

/recurring/plans/{planId} PUT

πŸ”™ Back to Table of Contents


bluesnap.reversal.authTransaction

πŸ› οΈ Usage

const authTransactionResponse = await bluesnap.reversal.authTransaction({
  cardTransactionType: "AUTH_REVERSAL",
  transactionId: 1011671987,
});

βš™οΈ Parameters

cardTransactionType: string
transactionId: number

🌐 Endpoint

/transactions PUT

πŸ”™ Back to Table of Contents


bluesnap.shopper.createVaultedShopper

πŸ› οΈ Usage

const createVaultedShopperResponse =
  await bluesnap.shopper.createVaultedShopper({
    firstName: "FirstName",
    lastName: "LastName",
  });

βš™οΈ Parameters

firstName: string
lastName: string

🌐 Endpoint

/vaulted-shoppers POST

πŸ”™ Back to Table of Contents


bluesnap.shopper.deleteVaultedShopper

πŸ› οΈ Usage

const deleteVaultedShopperResponse =
  await bluesnap.shopper.deleteVaultedShopper({
    vaultedShopperId: "20769005",
  });

βš™οΈ Parameters

vaultedShopperId: string

vaultedShopperId received from BlueSnap

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} DELETE

πŸ”™ Back to Table of Contents


bluesnap.shopper.get

πŸ› οΈ Usage

const getResponse = await bluesnap.shopper.get({
  vaultedShopperId: "20769005",
});

βš™οΈ Parameters

vaultedShopperId: string

vaultedShopperId received from BlueSnap

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} GET

πŸ”™ Back to Table of Contents


bluesnap.shopper.updateVaultedShopper

πŸ› οΈ Usage

const updateVaultedShopperResponse =
  await bluesnap.shopper.updateVaultedShopper({
    vaultedShopperId: "40444721",
    firstName: "FirstName",
    lastName: "LastName",
  });

βš™οΈ Parameters

vaultedShopperId: string

vaultedShopperId received from BlueSnap

firstName: string
lastName: string

🌐 Endpoint

/vaulted-shoppers/{vaultedShopperId} PUT

πŸ”™ Back to Table of Contents


bluesnap.subscription.createMerchantManagedCharge

πŸ› οΈ Usage

const createMerchantManagedChargeResponse =
  await bluesnap.subscription.createMerchantManagedCharge({
    subscriptionId: 10543419,
    amount: 45,
    currency: "USD",
    merchantTransactionId: "MyUniqueOnDemandSubscription",
    taxReference: "048deff0-a285-47e1-bc39-42f79bf0095b",
  });

βš™οΈ Parameters

subscriptionId: number

BlueSnap identifier for the subscription.

amount: number
currency: string
merchantTransactionId: string
taxReference: string

🌐 Endpoint

/recurring/ondemand/{subscriptionId} POST

πŸ”™ Back to Table of Contents


bluesnap.subscription.createMerchantManagedSubscription

πŸ› οΈ Usage

const createMerchantManagedSubscriptionResponse =
  await bluesnap.subscription.createMerchantManagedSubscription({
    amount: 45,
    currency: "USD",
  });

βš™οΈ Parameters

amount: number
currency: string

🌐 Endpoint

/recurring/ondemand POST

πŸ”™ Back to Table of Contents


bluesnap.subscription.createNew

πŸ› οΈ Usage

const createNewResponse = await bluesnap.subscription.createNew({
  planId: 2283845,
});

βš™οΈ Parameters

planId: number

🌐 Endpoint

/recurring/subscriptions POST

πŸ”™ Back to Table of Contents


bluesnap.subscription.getSpecific

πŸ› οΈ Usage

const getSpecificResponse = await bluesnap.subscription.getSpecific({
  subscriptionId: 8491535,
});

βš™οΈ Parameters

subscriptionId: number

BlueSnap identifier for the subscription.

🌐 Endpoint

/recurring/subscriptions/{subscriptionId} GET

πŸ”™ Back to Table of Contents


bluesnap.subscription.getSwitchChargeAmount

πŸ› οΈ Usage

const getSwitchChargeAmountResponse =
  await bluesnap.subscription.getSwitchChargeAmount({
    newplanid: "111111",
    newquantity: "2",
  });

βš™οΈ Parameters

newplanid: string
newquantity: string

🌐 Endpoint

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

πŸ”™ Back to Table of Contents


bluesnap.subscription.listAllSubscriptions

πŸ› οΈ Usage

const listAllSubscriptionsResponse =
  await bluesnap.subscription.listAllSubscriptions({
    pagesize: "5",
    after: "34567",
    gettotal: true,
    fulldescription: false,
  });

βš™οΈ Parameters

pagesize: string
after: string
gettotal: boolean
fulldescription: boolean

🌐 Endpoint

/recurring/subscriptions?{parameters} GET

πŸ”™ Back to Table of Contents


bluesnap.subscription.listCharges

πŸ› οΈ Usage

const listChargesResponse = await bluesnap.subscription.listCharges({
  pagesize: "3",
  after: "163193",
  fulldescription: false,
});

βš™οΈ Parameters

pagesize: string
after: string
fulldescription: boolean

🌐 Endpoint

/:subscriptionId/charges?{parameters} GET

πŸ”™ Back to Table of Contents


bluesnap.subscription.updateSubscription

πŸ› οΈ Usage

const updateSubscriptionResponse =
  await bluesnap.subscription.updateSubscription({
    subscriptionId: 8491543,
    planId: "2283849",
  });

βš™οΈ Parameters

subscriptionId: number

BlueSnap identifier for the subscription.

planId: string

🌐 Endpoint

/recurring/subscriptions/{subscriptionId} PUT

πŸ”™ Back to Table of Contents


bluesnap.transaction.approveMerchantTransaction

πŸ› οΈ Usage

const approveMerchantTransactionResponse =
  await bluesnap.transaction.approveMerchantTransaction({
    transactionid: "38612140",
    approvetransaction: true,
  });

βš™οΈ Parameters

transactionid: string

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

approvetransaction: boolean

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.cancelPendingRefund

πŸ› οΈ Usage

const cancelPendingRefundResponse =
  await bluesnap.transaction.cancelPendingRefund({
    transactionId: "1109144995",
  });

βš™οΈ Parameters

transactionId: string

transactionId received from BlueSnap

🌐 Endpoint

/transactions/pending-refund/{transactionId} DELETE

πŸ”™ Back to Table of Contents


bluesnap.transaction.createBatchTransaction

πŸ› οΈ Usage

const createBatchTransactionResponse =
  await bluesnap.transaction.createBatchTransaction({});

βš™οΈ Parameters

🌐 Endpoint

/batch-transactions POST

πŸ”™ Back to Table of Contents


bluesnap.transaction.createSofortTransaction

πŸ› οΈ Usage

const createSofortTransactionResponse =
  await bluesnap.transaction.createSofortTransaction({
    amount: 42,
    softDescriptor: "ABC COMPANY",
    currency: "GBP",
    authorizedByShopper: true,
  });

βš™οΈ Parameters

amount: number
softDescriptor: string
currency: string
authorizedByShopper: boolean

🌐 Endpoint

/alt-transactions POST

πŸ”™ Back to Table of Contents


bluesnap.transaction.getBatchTransaction

πŸ› οΈ Usage

const getBatchTransactionResponse =
  await bluesnap.transaction.getBatchTransaction({
    batchId: "567890",
  });

βš™οΈ Parameters

batchId: string

batch ID sent in the Create Batch Transaction request

🌐 Endpoint

/batch-transactions/{batchId} GET

πŸ”™ Back to Table of Contents


bluesnap.transaction.getById

πŸ› οΈ Usage

const getByIdResponse = await bluesnap.transaction.getById({
  transactionId: "1011582369",
});

βš™οΈ Parameters

transactionId: string

transaction ID received in the response from BlueSnap

🌐 Endpoint

/transactions/{transactionId} GET

πŸ”™ Back to Table of Contents


bluesnap.transaction.getPaypalTransaction

πŸ› οΈ Usage

const getPaypalTransactionResponse =
  await bluesnap.transaction.getPaypalTransaction({
    orderId: "5666625",
  });

βš™οΈ Parameters

orderId: string

order ID received in the response

🌐 Endpoint

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

πŸ”™ Back to Table of Contents


bluesnap.transaction.getPreNotificationDebitAgreement

for Australia and Canada

πŸ› οΈ Usage

const getPreNotificationDebitAgreementResponse =
  await bluesnap.transaction.getPreNotificationDebitAgreement({
    transactionId: "38943468",
  });

βš™οΈ Parameters

transactionId: string

Argument included in the response for the Create Debit Agreement request

🌐 Endpoint

/agreements/prenotification/{transactionId} GET

πŸ”™ Back to Table of Contents


bluesnap.transaction.getSepaDd

πŸ› οΈ Usage

const getSepaDdResponse = await bluesnap.transaction.getSepaDd({
  transactionId: "1014672453",
});

βš™οΈ Parameters

transactionId: string

transaction ID received in the response from BlueSnap

🌐 Endpoint

/alt-transactions/{transactionId} GET

πŸ”™ Back to Table of Contents


bluesnap.transaction.getSofortTransaction

πŸ› οΈ Usage

const getSofortTransactionResponse =
  await bluesnap.transaction.getSofortTransaction({
    orderId: 20922493,
  });

βš™οΈ Parameters

orderId: number

Order ID received in the Create Sofort Transaction response from BlueSnap

🌐 Endpoint

/alt-transactions/resolve GET

πŸ”™ Back to Table of Contents


bluesnap.transaction.initiateRefund

πŸ› οΈ Usage

const initiateRefundResponse = await bluesnap.transaction.initiateRefund({
  transactionId: "1095710747",
  reason: "Refund for order #1992",
  cancelSubscriptions: false,
});

βš™οΈ Parameters

transactionId: string

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

reason: string
cancelSubscriptions: boolean

🌐 Endpoint

/transactions/refund/{transactionId} POST

πŸ”™ Back to Table of Contents


bluesnap.transaction.updatePaypalTransaction

πŸ› οΈ Usage

const updatePaypalTransactionResponse =
  await bluesnap.transaction.updatePaypalTransaction({
    amount: 105,
    currency: "USD",
  });

βš™οΈ Parameters

amount: number
currency: string

🌐 Endpoint

/alt-transactions PUT

πŸ”™ Back to Table of Contents


bluesnap.vendor.create

πŸ› οΈ Usage

const createResponse = await bluesnap.vendor.create({
  email: "vendor@example.com",
  firstName: "Joe",
  lastName: "Smith",
  phone: "1-123-456-7890",
  address: "123 Main Street",
  city: "Boston",
  country: "US",
  state: "MA",
  zip: "02453",
  defaultPayoutCurrency: "USD",
  ipnUrl: "https://ipnaddress.com",
});

βš™οΈ Parameters

email: string
firstName: string
lastName: string
phone: string
address: string
city: string
country: string
state: string
zip: string
defaultPayoutCurrency: string
ipnUrl: string
payoutInfo: object

🌐 Endpoint

/vendors POST

πŸ”™ Back to Table of Contents


bluesnap.vendor.getAllVendors

πŸ› οΈ Usage

const getAllVendorsResponse = await bluesnap.vendor.getAllVendors({
  gettotal: true,
});

βš™οΈ Parameters

gettotal: boolean

🌐 Endpoint

/vendors?{parameters} GET

πŸ”™ Back to Table of Contents


bluesnap.vendor.getVendor

πŸ› οΈ Usage

const getVendorResponse = await bluesnap.vendor.getVendor({
  vendorId: 837389,
});

βš™οΈ Parameters

vendorId: number

BlueSnap identifier for the vendor

🌐 Endpoint

/vendors/{vendorId} GET

πŸ”™ Back to Table of Contents


bluesnap.vendor.updateVendor

πŸ› οΈ Usage

const updateVendorResponse = await bluesnap.vendor.updateVendor({
  vendorId: 1,
  email: "vendor@bluesnap.com",
  name: "Important Vendor",
  firstName: "Joe",
  lastName: "Smith",
  address: "123 Main Street",
  city: "testing city",
  zip: "02453",
  country: "US",
  phone: "1-054-976-6778",
  state: "MA",
  taxId: 123456789,
  vendorUrl: "http://mycompany.com",
  ipnUrl: "https://ipnaddress.com",
  defaultPayoutCurrency: "USD",
});

βš™οΈ Parameters

vendorId: number

BlueSnap identifier for the vendor

email: string
name: string
firstName: string
lastName: string
address: string
city: string
zip: string
country: string
phone: string
state: string
taxId: number
vendorUrl: string
ipnUrl: string
defaultPayoutCurrency: string

🌐 Endpoint

/vendors/{vendorId} PUT

πŸ”™ Back to Table of Contents


Author

This TypeScript 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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published