Flow.cl API Client

website·Indexed 30 days ago

https://nicotordev-flowcl-pagos.netlify.app

An open-source Node.js API client for integrating Flow.cl payments. It provides specialized classes for managing payments (FlowPayments), customers (FlowCustomers), subscriptions (FlowSubscriptions), invoices (FlowInvoices), refunds (FlowRefunds), settlements (FlowSettlements), merchants (FlowMerchants), plans (FlowPlans), and coupons (FlowCoupons).

Tokens
9K
Snippets
76
Records
81
Agent score
75%

What's inside Flow.cl

  1. Overview of the Flow.cl API Client

    The Flow.cl API Client is an open-source project designed to facilitate the fast and secure implementation of payment processing using Flow.cl. It provides a simplified interface, comprehensive documentation, and practical examples to reduce the complexity of the integration process.
  2. Overview of @nicotordev/flowcl-pagos API Client

    The @nicotordev/flowcl-pagos package is a Node.js and TypeScript client designed to simplify the integration of the Flow.cl API. It provides programmatic access to manage payments, customers, subscription plans, subscriptions, refunds, coupons, invoices, settlements, and merchant information.
  3. Retrieve extended payment status

    Use the statusExtended methods to get more detailed information about a payment, including paymentCurrency, paymentAmount, and lastError details.
    // By Token
    payments.statusExtended.byToken(token: string): Promise<FlowPaymentsStatusExtendedResponse>
    
    // By Flow Order Number
    payments.statusExtended.byFlowOrder(flowOrder: number): Promise<FlowPaymentsStatusExtendedResponse>
  4. Retrieve invoice data

    Use the get method to fetch detailed information about a specific invoice using its ID. The response includes the invoice ID, customer ID, amount, currency, status (0: unpaid, 1: paid, 2: canceled), due date, and payment link.
    // Request: invoiceId (string)
    // Response: FlowGetInvoiceDataResponse
    invoices.get(invoiceId: string): Promise<FlowGetInvoiceDataResponse>
  5. Initialize the FlowSettlements client

    The FlowSettlements class is used to retrieve information about payment settlements made by Flow. To access it, instantiate the Flow class with your API key, secret key, and the environment ('sandbox' or 'production').
    import Flow from "@nicotordev/flowcl-pagos";
    
    const flow = new Flow("tu_api_key", "tu_secret_key", "sandbox"); // Use 'production' for live environment
    const settlements = flow.settlements;
  6. Retrieve a specific settlement by ID

    Use the getLiquidationById method to retrieve detailed information about a single settlement using its unique ID string.
    // Request: id (string)
    const response = await settlements.getLiquidationById('12345');
    
    // Response: FlowGetLiquidationByIdResponse
    // { id: number, date: string, currency: string, initial_balance: number, 
    //   final_balance: number, transferred: number, billed: number, 
    //   summary: object, detail: object }
  7. Initialize the FlowInvoices client

    To manage billing in Flow.cl, instantiate the Flow class with your API key, secret key, and the environment ('sandbox' or 'production'). The invoices property provides access to the FlowInvoices management methods.
    import Flow from "@nicotordev/flowcl-pagos";
    
    const flow = new Flow("tu_api_key", "tu_secret_key", "sandbox"); // or 'production'
    const invoices = flow.invoices;
  8. Initialize the FlowRefunds client

    To interact with the Flow.cl Refunds API, instantiate the Flow class with your API key, secret key, and environment ('sandbox' or 'production'). The refunds property on the Flow instance provides access to the refund management methods.
    import Flow from '@nicotordev/flowcl-pagos';
    
    const flow = new Flow('tu_api_key', 'tu_secret_key', 'sandbox'); // or 'production'
    const refunds = flow.refunds;
  9. Initialize FlowSubscriptionsItems client

    To manage additional subscription items in Flow.cl, initialize the Flow client with your API key, secret key, and environment ('sandbox' or 'production'), then access the subscriptionsItems property.
    import Flow from '@nicotordev/flowcl-pagos';
    
    const flow = new Flow('tu_api_key', 'tu_secret_key', 'sandbox'); // or 'production'
    const subscriptionItems = flow.subscriptionsItems;
  10. Initialize the FlowSubscriptions client

    To interact with the Flow.cl subscriptions API, initialize the Flow class with your API key, secret key, and the environment ('sandbox' or 'production'). The subscriptions property of the Flow instance provides access to subscription management methods.
    import Flow from "@nicotordev/flowcl-pagos";
    
    const flow = new Flow("tu_api_key", "tu_secret_key", "sandbox"); // or 'production'
    const subscriptions = flow.subscriptions;
  11. Initialize the FlowCL Pagos SDK

    To start using the FlowCL Pagos SDK, instantiate the Flow class with your API key, secret key, and the environment ('sandbox' or 'production'). The plans property on the Flow instance provides access to the FlowPlans class for managing subscription plans.
    import Flow from '@nicotordev/flowcl-pagos';
    
    const flow = new Flow('tu_api_key', 'tu_secret_key', 'sandbox'); // or 'production'
    const plans = flow.plans;
  12. Initialize FlowCoupons for discount management

    To manage discount coupons in Flow.cl, instantiate the Flow class with your API key, secret key, and environment ('sandbox' or 'production'). The coupons property provides access to the coupon management methods.
    import Flow from "@nicotordev/flowcl-pagos";
    
    const flow = new Flow("tu_api_key", "tu_secret_key", "sandbox"); // or 'production'
    const coupons = flow.coupons;