Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prezzee/ts-v2-sdks

Package Overview
Dependencies
Maintainers
61
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prezzee/ts-v2-sdks

This SDK supports Prezzee's V2 Business APIs enabling quicker development. It allows the developers to:

  • 1.8.0
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-90.91%
Maintainers
61
Weekly downloads
 
Created
Source

Welcome to Prezzee SDKs

This SDK supports Prezzee's V2 Business APIs enabling quicker development. It allows the developers to:

  • List Products
  • Retrieve Product Details
  • List Styles
  • List Orders
  • Create Order
  • Retrieve Order
  • List Order Items
  • Retrieve Float Balance
  • Retrieve Invoice
  • Retrieve Sender Profiles
  • Retrieve Consolidated Invoices
  • Retrieve Discounts available

Install

npm install @prezzee/ts-v2-sdks

Install dependencies as well: npm install axios

Usage

To use the functions, you need a Business API token as part of your config. Add an environment variable TOKEN={business API token you must have received}. Example token: sJ0uOIDRYexgfL2M7BgLiPjb6xkPAi

Initialise Client

const prezzeeClient = createPrezzeeClient({ token: process.env.TOKEN, env: "sandbox" });

Once initialised, you can use it as per following examples:

List Products

const products = await prezzeeClient.listProducts(); Returns a list of products currently available for purchase.

List Styles

const styles = await prezzeeClient.listStyles(); Returns a list of gift styles for use with the product creation endpoint.

Create Order

const  product = products.results[0];

const  style = styles.results[0];

const order = await prezzeeClient.createOrder({
    reference: generateUUID(),
    payment_method: "POSTPAID_CREDIT",
	wait_for_stock: false,
    items: [
      {
        reference: generateUUID(),
        product_code: product.code,
        product_theme_code: product.themes[0].code,
        amount: product.denominations[0].amount,
        currency: product.denominations[0].currency,
        delivery_method: "LINK",
        delivery_details: {
          style_code: style.code,
          message: "Hello Prezzee SDK",
          recipient_name: "Prezzee SDK Recipient",
          recipient_email: "dhanushka.krishnaith@prezzee.com",
          sender_name: "Prezzee SDK Sender",
        },
      },
    ],
});

This will return order_uuid in response which can be used in the following example to retrieve the order details.

Retrieve Order

await prezzeeClient.retrieveOrder({ orderUuid: order.uuid, });

FAQs

Package last updated on 08 Feb 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc