Skip to main content

Stripe Integration

37 pre-built templates across 10 categories

Easy Connect: Click "Connect Platform" → Stripe → paste your API key. That's it. All 37 templates unlock instantly.

Quick Setup

Step 1: Get Your Secret Key

  1. 1Log in to your Stripe Dashboard
  2. 2Go to Developers API keys
  3. 3Copy your Secret key (starts with sk_live_)

Step 2: Connect in Staffify

  1. 1Go to Settings Integrations
  2. 2Click Connect Platform Stripe
  3. 3Paste your secret key and click Test & Connect

Note: Stripe API keys don't expire, so no token refresh is needed. Use sk_test_ keys for testing, sk_live_ for production.

All 37 Templates

Click "Add Action" on your Stripe connection, then browse templates by category.

Customers (5 templates)

TemplateMethodEndpointDescription
Search CustomersGET/customersSearch customers by email or other attributes
Get Customer by IDGET/customers/{{customer_id}}Retrieve a specific customer
Create CustomerPOST/customersCreate a new customer record
Update CustomerPOST/customers/{{customer_id}}Update customer details (name, email, metadata)
Delete CustomerDELETE/customers/{{customer_id}}Permanently delete a customer

Payments (4 templates)

TemplateMethodEndpointDescription
List Payment IntentsGET/payment_intentsList all payment intents
Get Payment IntentGET/payment_intents/{{payment_intent_id}}Retrieve a specific payment intent
Create Payment IntentPOST/payment_intentsCreate a new payment intent
Search Payment IntentsGET/payment_intents/search?query={{query}}Search payment intents with Stripe Search

Invoices (5 templates)

TemplateMethodEndpointDescription
List InvoicesGET/invoicesList all invoices
Get InvoiceGET/invoices/{{invoice_id}}Retrieve a specific invoice
Create Draft InvoicePOST/invoicesCreate a new draft invoice for a customer
Finalize InvoicePOST/invoices/{{invoice_id}}/finalizeFinalize a draft invoice so it can be paid
Search InvoicesGET/invoices/search?query={{query}}Search invoices with Stripe Search

Subscriptions (4 templates)

TemplateMethodEndpointDescription
List SubscriptionsGET/subscriptionsList all subscriptions
Get SubscriptionGET/subscriptions/{{subscription_id}}Retrieve a specific subscription
Create SubscriptionPOST/subscriptionsCreate a new subscription for a customer
Cancel SubscriptionDELETE/subscriptions/{{subscription_id}}Cancel a subscription

Products & Prices (4 templates)

TemplateMethodEndpointDescription
List ProductsGET/productsList all products
Get ProductGET/products/{{product_id}}Retrieve a specific product
List PricesGET/pricesList all prices, optionally filtered by product
Create PricePOST/pricesCreate a new price for a product

Refunds (3 templates)

TemplateMethodEndpointDescription
List RefundsGET/refundsList all refunds
Get RefundGET/refunds/{{refund_id}}Retrieve a specific refund
Create RefundPOST/refundsRefund a payment intent or charge

Payment Methods (3 templates)

TemplateMethodEndpointDescription
List Payment MethodsGET/customers/{{customer_id}}/payment_methodsList payment methods for a customer
Get Payment MethodGET/payment_methods/{{payment_method_id}}Retrieve a specific payment method
Detach Payment MethodPOST/payment_methods/{{payment_method_id}}/detachDetach a payment method from a customer

Charges (4 templates)

TemplateMethodEndpointDescription
List ChargesGET/chargesList all charges
Get ChargeGET/charges/{{charge_id}}Retrieve a specific charge
Search ChargesGET/charges/search?query={{query}}Search charges with Stripe Search
Capture ChargePOST/charges/{{charge_id}}/captureCapture an uncaptured charge

Balance (2 templates)

TemplateMethodEndpointDescription
Get BalanceGET/balanceRetrieve your account balance
List Balance TransactionsGET/balance_transactionsList all balance transactions

Events (3 templates)

TemplateMethodEndpointDescription
List EventsGET/eventsList all events
Get EventGET/events/{{event_id}}Retrieve a specific event
List Events by TypeGET/events?type={{type}}List events filtered by type

Common AI Use Cases

Customer Lookup & Account Status

When a customer calls, the AI looks them up by email and reports their subscription status, balance, and recent payments.

Use: Search Customers List Invoices List Subscriptions

Process Refund Requests

AI verifies the customer's identity, looks up their payment, and processes a refund when authorized.

Use: Search Customers List Charges Create Refund

Tip: Enable identity verification and mark Create Refund as destructive with confirmation required.

Subscription Management

AI checks a customer's current plan and can cancel or update their subscription during the call.

Use: Search Customers Get Subscription Cancel Subscription

Invoice & Payment History

AI retrieves recent invoices and payment details for billing inquiries.

Use: Search Invoices or List Balance Transactions

Stripe Search Syntax

The Search templates (Payment Intents, Invoices, Charges) use Stripe's query language:

Example QueryDescription
status:"succeeded"Payment intents with status succeeded
amount>5000Charges over $50.00 (amounts in cents)
customer:"cus_xxx"Invoices for a specific customer
created>1672531200Events after a Unix timestamp

Example: Search Customers Response

{
  "data": [{
    "id": "cus_ABC123",
    "email": "[email protected]",
    "name": "John Smith",
    "balance": 0,
    "subscriptions": {
      "data": [{
        "id": "sub_XYZ789",
        "status": "active",
        "plan": {
          "nickname": "Pro Plan",
          "amount": 4900,
          "interval": "month"
        }
      }]
    }
  }]
}

Endpoint Details

Create Customer

ParameterTypeRequiredDescription
emailstringRecommendedCustomer email address
namestringNoCustomer full name
phonestringNoCustomer phone number
descriptionstringNoInternal description or notes
metadataobjectNoKey-value pairs for custom data
{
  "email": "[email protected]",
  "name": "John Smith",
  "phone": "+15551234567",
  "metadata": {
    "source": "phone_call",
    "staffify_call_id": "call_abc123"
  }
}

Create Payment Intent

ParameterTypeRequiredDescription
amountintegerYesAmount in cents (e.g., 5000 = $50.00)
currencystringYesThree-letter ISO currency code (e.g., "usd")
customerstringRecommendedStripe customer ID (cus_xxx)
descriptionstringNoDescription of the payment
metadataobjectNoCustom key-value pairs
{
  "amount": 5000,
  "currency": "usd",
  "customer": "cus_ABC123",
  "description": "Invoice #1234 payment"
}

Create Invoice

ParameterTypeRequiredDescription
customerstringYesStripe customer ID
collection_methodstringNo"charge_automatically" or "send_invoice"
descriptionstringNoInvoice memo/description
days_until_dueintegerNoDays until due (for send_invoice method)
metadataobjectNoCustom key-value pairs
{
  "customer": "cus_ABC123",
  "collection_method": "send_invoice",
  "days_until_due": 30,
  "description": "March 2026 services"
}

Create Subscription

ParameterTypeRequiredDescription
customerstringYesStripe customer ID
itemsarrayYesArray of {price: "price_xxx"} objects
trial_period_daysintegerNoNumber of trial days
metadataobjectNoCustom key-value pairs
{
  "customer": "cus_ABC123",
  "items": [
    {"price": "price_XYZ789"}
  ]
}

Create Refund

ParameterTypeRequiredDescription
payment_intentstringYes*Payment intent ID to refund (*or charge)
chargestringYes*Charge ID to refund (*or payment_intent)
amountintegerNoPartial refund amount in cents (omit for full refund)
reasonstringNo"duplicate", "fraudulent", or "requested_by_customer"
metadataobjectNoCustom key-value pairs
{
  "payment_intent": "pi_DEF456",
  "amount": 2500,
  "reason": "requested_by_customer"
}

Response Examples

Get Customer Response

{
  "id": "cus_ABC123",
  "object": "customer",
  "email": "[email protected]",
  "name": "John Smith",
  "phone": "+15551234567",
  "balance": 0,
  "created": 1709312400,
  "currency": "usd",
  "default_source": null,
  "metadata": {
    "source": "phone_call"
  }
}

List Invoices Response

{
  "object": "list",
  "data": [{
    "id": "in_GHI789",
    "object": "invoice",
    "customer": "cus_ABC123",
    "amount_due": 4900,
    "amount_paid": 4900,
    "currency": "usd",
    "status": "paid",
    "created": 1709312400,
    "period_start": 1706720400,
    "period_end": 1709312400
  }],
  "has_more": false
}

Create Refund Response

{
  "id": "re_JKL012",
  "object": "refund",
  "amount": 2500,
  "currency": "usd",
  "payment_intent": "pi_DEF456",
  "reason": "requested_by_customer",
  "status": "succeeded",
  "created": 1709398800
}

Example Conversation

Here's how your AI agent uses Stripe during a real phone call:

Caller: “Hi, I'd like to request a refund for my last payment. My email is [email protected].”

→ Executes: search_customers with email=“[email protected]

→ Found: John Smith (cus_ABC123), Pro Plan subscription active

AI Agent: “I found your account, John. Let me verify your identity first. Can you confirm the last 4 digits of the card on file?”

Caller: “4242.”

→ Identity verified via last-4-digits match

AI Agent: “Verified. Let me pull up your recent charges.”

→ Executes: list_charges with customer=“cus_ABC123”

→ Found: $49.00 charge on Feb 28 (pi_DEF456), $49.00 on Jan 28

AI Agent: “I see your most recent charge of $49.00 on February 28th. Would you like a full or partial refund?”

Caller: “Full refund please.”

→ Executes: create_refund with payment_intent=“pi_DEF456”, reason=“requested_by_customer”

→ Refund re_JKL012 created, status: succeeded

AI Agent: “Done! Your $49.00 refund has been processed. It should appear on your statement within 5-10 business days. Is there anything else I can help with?”

Stripe-Specific Notes

Amounts in cents: All monetary amounts in Stripe are in the smallest currency unit. $50.00 = 5000, $1.50 = 150. The AI handles this conversion automatically when talking to customers.

Form-encoded bodies: Stripe uses application/x-www-form-urlencoded for request bodies, not JSON. Staffify handles the encoding automatically when using templates.

Idempotency keys: For create operations, Staffify automatically generates an Idempotency-Key header to prevent duplicate charges if a request is retried.

Test vs Live: Use sk_test_ keys during setup to test safely. Switch to sk_live_ for production. Test keys never process real charges.

Error Reference

Status CodeMeaningCommon Cause
400 Bad RequestInvalid request parametersMissing required field or invalid value (e.g., negative amount)
401 UnauthorizedInvalid API keyCheck that your secret key is correct and active
402 Card DeclinedPayment cannot be processedCustomer's card was declined. AI will inform the caller.
404 Not FoundResource not foundThe customer, charge, or invoice ID does not exist
429 Rate LimitedToo many requestsStripe rate limits: 100 reads/sec, 100 writes/sec per key

Last updated: March 2026

Stripe Integration | Staffify Docs