Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to HitPay

Scalekit connector
Open markdown

The HitPay connector lets your AI agent act in each user's HitPay account. Each user signs in to HitPay once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 39 tools.

Tools
39
What they doRead · write · destructive
18 · 14 · 718 read14 write7 destructive
Users sign in with
OAuth app
Your own HitPay app

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the HitPay connection

    In AgentKit > Connections, create a HitPay connection and copy its redirect URI. The name you give it is the connection_name your code passes. See Configure connections.

  4. Register an OAuth app

    HitPay connections use your own OAuth app. Register one with HitPay and add the redirect URI you copied.

    Then enter the app's Client ID and Client Secret on the HitPay connection.

  5. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'hitpay'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize HitPay:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'hitpay_get_business_info',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • hitpay_get_business_infoFetch the profile of the HitPay business the connected account belongs to.Read-only

    Get Business Info

    Fetch the profile of the HitPay business the connected account belongs to. Returns the business name, country, currency, and whether payments are enabled. Use this first to confirm which merchant is connected. Use list_charges for transaction data.

    Inputs

    This tool takes no inputs.

  • hitpay_get_chargeFetch one charge (a received payment) by id.Read-only

    Get Charge

    Fetch one charge (a received payment) by id. Returns amount, fees, refunded amount, status, currency, payment method, and customer details. Use this before create_refund to confirm the payment id and refundable amount. Use list_charges to find the id.

    Inputs

    charge_idstringrequired
    ID of the charge (payment). Get it from list_charges.
  • hitpay_get_customerFetch one saved customer by id.Read-only

    Get Customer

    Fetch one saved customer by id. Returns name, email, phone number, address, gender, birth date, and remark. Use this to view a customer in full. Use list_customers to find the id.

    Inputs

    customer_idstringrequired
    ID of the customer. Get it from list_customers or create_customer.
  • hitpay_get_orderFetch one order by id.Read-only

    Get Order

    Fetch one order by id. Returns status, currency, customer, line items, charges, and discount and tax totals. Use this to view an order in full. Use list_orders to find the id.

    Inputs

    order_idstringrequired
    ID of the order. Get it from list_orders or create_order.
  • hitpay_get_payment_requestFetch one payment request and its current status by id.Read-only

    Get Payment Request

    Fetch one payment request and its current status by id. Returns id, status (pending, completed, failed, expired, canceled, or inactive), amount, currency, purpose, reference number, and checkout url. Use this to check whether a customer has paid. Use list_payment_requests to find the id.

    Inputs

    request_idstringrequired
    ID of the payment request. Get it from create_payment_request or list_payment_requests.
  • hitpay_get_productFetch one product by id.Read-only

    Get Product

    Fetch one product by id. Returns name, description, price, currency, status, categories, and variations. Use this to view a product in full. Use list_products to find the id.

    Inputs

    product_idstringrequired
    ID of the product. Get it from list_products.
  • hitpay_get_recurring_billingFetch one recurring billing subscription by id.Read-only

    Get Recurring Billing

    Fetch one recurring billing subscription by id. Returns customer, plan id, amount, cycle, times charged, status, and payment methods. Use this to view a subscription in full. Use list_recurring_billings to find the id.

    Inputs

    recurring_billing_idstringrequired
    ID of the recurring billing record. Get it from list_recurring_billings or create_recurring_billing.
  • hitpay_get_refundFetch one refund by id.Read-only

    Get Refund

    Fetch one refund by id. Returns refund id, payment id, amount refunded, total amount, currency, status, and timestamps. Use this to check refund progress. Use create_refund to issue a new refund.

    Inputs

    refund_idstringrequired
    ID of the refund. Get it from create_refund.