Skip to content

$io.stripe ​

Server API reference.

Functions ​

$io.stripe.directApiCall ​

Make a raw HTTP call to the Stripe API, bypassing the SDK method wrappers.

Usage ​

js
$io.stripe.directApiCall(connectionName, method, path, queryParams, body, options)

Description ​

Executes a raw HTTP request to the Stripe API using the configured connection.

  • method is the HTTP method (e.g., 'GET', 'POST', 'DELETE').
  • path is the Stripe API endpoint path (e.g., '/v1/payment_intents').
  • queryParams is an object of key/value pairs to serialize into the query string. Arrays are sent as repeated keys (e.g., key[]=a&key[]=b).
  • body is an object sent as the POST body; only allowed when method is 'POST'.
  • options is an optional object for advanced request settings, such as idempotency keys or custom headers.

If the connection is not found or not initialized, the function returns an error.

Usage Scenarios ​

  • Access Stripe API endpoints not yet available in the SDK
  • Send custom parameters or headers in a direct Stripe API request
  • Perform low-level testing or debugging of Stripe API calls

Parameters ​

connectionName ​

Type: String

Required: Yes

The name of the Stripe connection configured in the ioLoop app.

method ​

Type: String

Required: Yes

The HTTP method to use (e.g., 'GET', 'POST', 'DELETE').

path ​

Type: String

Required: Yes

The API endpoint path, starting with '/v1/'.

queryParams ​

Type: Object

Required: No

Query string parameters as key/value pairs. Arrays are serialized as repeated keys.

body ​

Type: Object

Required: No

Request body object for POST requests. Ignored for other methods.

options ​

Type: Object

Required: No

Optional request settings, such as headers or idempotency keys.

Output ​

Type: Promise

Resolves to an object { status: boolean, statusCode?: number, headers?: Object, data?: any, err?: any, code?: string, raw?: any }.

$io.stripe.execSdk ​

Call a specific Stripe SDK method on a given resource type with the provided arguments.

Usage ​

js
$io.stripe.execSdk(connectionName, resourceType, operation, args)

Description ​

Executes a Stripe SDK method on a given resource type (e.g., paymentIntents, customers, charges) with the provided arguments array.

  • resourceType is the property name on the Stripe SDK client (e.g., 'paymentIntents').
  • operation is the method name to call on that resource (e.g., 'create', 'retrieve', 'list').
  • args is an array of parameters to pass to the method in order.

If the connection is not found or the resource/operation is invalid, the function returns an error.

Usage Scenarios ​

  • Access Stripe SDK methods not directly exposed by higher-level ioLoop Stripe functions
  • Perform advanced operations on Stripe resources without creating a new wrapper function
  • Quickly prototype Stripe API calls within a ioLoop app

Parameters ​

connectionName ​

Type: String

Required: Yes

The name of the Stripe connection configured in the ioLoop app.

resourceType ​

Type: String

Required: Yes

Name of the Stripe SDK resource type to operate on (e.g., 'paymentIntents', 'customers').

operation ​

Type: String

Required: Yes

The method to call on the given resource type (e.g., 'create', 'list').

args ​

Type: Array

Required: No

Arguments to pass to the Stripe SDK method, in order. Defaults to an empty array.

Output ​

Type: Promise

Resolves to the raw result of the Stripe SDK call in the format { status: boolean, data?: any, err?: any }.

$io.stripe.listPayments ​

List Stripe PaymentIntents within a date range, returning them in a normalized Square-like format.

Usage ​

js
$io.stripe.listPayments(connectionName, fromDateTime, toDateTime, limit, startingAfter, customerId, other)

Description ​

Retrieves Stripe PaymentIntents, optionally filtered by a created-time range and/or customer, and maps them to a Square-like structure. Dates are applied to the created field and converted to UNIX seconds. By default, expands data.latest_charge (overridable via other.expand). Use startingAfter to paginate.

Usage Scenarios ​

  • Build a report of recent payments for reconciliation
  • Paginate through historical payment records by date and customer
  • Display payment history in an app UI with card and receipt details

Parameters ​

connectionName ​

Type: String

Required: Yes

The name of the Stripe connection configured in the ioLoop app.

fromDateTime ​

Type: String | Date | moment

Required: No

Start of the created-time range (inclusive), converted to UNIX seconds.

toDateTime ​

Type: String | Date | moment

Required: No

End of the created-time range (inclusive), converted to UNIX seconds.

limit ​

Type: Number

Required: No

Maximum number of items per page (1–100). Default is 10.

startingAfter ​

Type: String

Required: No

Pagination cursor. Use the last PaymentIntent id from the previous page.

customerId ​

Type: String

Required: No

Filter results by Stripe customer id.

other ​

Type: Object

Required: No

Advanced options: { expand?: Array<String> (defaults to ['data.latest_charge']), includeRaw?: Boolean }.

Output ​

Type: Promise

Resolves to an object with the following shape:

{ status: boolean, data?: { payments: Array<Payment>, // normalized entries (see Payment below) hasMore: boolean, // mirrors Stripe's has_more cursor: String | null, // the last PaymentIntent id in this page (pass as startingAfter) raw?: Array<Object> // original Stripe PaymentIntents if other.includeRaw === true }, err?: any }

Payment (normalized): { id: String, // PaymentIntent id (e.g., 'pi_...') createdAt: String | null, // ISO timestamp from PI.created (seconds → ISO) status: String | null, // PaymentIntent status sourceType: String | null, // Uppercased payment method type (e.g., 'CARD', 'CARD_PRESENT') amount: Number | null, // Minor units (e.g., cents). From PI.amount currency: String | null, // Uppercased currency (e.g., 'USD') tipAmount: Number | null, // Sum of numeric fields in latest_charge.amount_details.tip (if any) totalAmount: Number | null, // Equals amount (treated as total) appFeeAmount: Number | null, // From latest_charge.application_fee_amount or PI.application_fee_amount refundedAmount: Number | null, // From latest_charge.amount_refunded (if present) cardBrand: String | null, // From latest_charge.payment_method_details.card.brand last4: String | null, // From latest_charge.payment_method_details.card.last4 entryMethod: String | null, // 'CARD_PRESENT' when detected orderId: String | null, // From PI.metadata.order_id (if set) referenceId: String | null, // From PI.metadata.reference_id (if set) note: String | null, // From PI.description (if set) customerId: String | null, // Stripe customer id (if present) receiptUrl: String | null, // From latest_charge.receipt_url locationId: null, // Not applicable in Stripe mapping (reserved for parity) teamMemberId: null // Not applicable in Stripe mapping (reserved for parity) }

Notes:

  • Amount-like fields (amount, tipAmount, totalAmount, appFeeAmount, refundedAmount) are in minor units.
  • createdAt is derived from PaymentIntent created (seconds) converted to ISO.
  • The default expand ['data.latest_charge'] enables card details and receipt URL; customize via other.expand.

$io.stripe.searchPayments ​

Search Stripe PaymentIntents using Stripe Search syntax and return normalized results.

Usage ​

js
$io.stripe.searchPayments(connectionName, fromDateTime, toDateTime, status, limit, page, customerId, other)

Description ​

Executes a Stripe PaymentIntent search using Stripe's Search API. Builds a query from the provided filters (created-time range, status, customer), with options to append extra fragments via other.queryParts, restrict to ioLoop-created intents via other.ioLoopOnly, or fully override the query via other.query. Limits are clamped to 1–100. By default, expands data.latest_charge (customizable via other.expand). Use the returned next cursor (Stripe next_page) to continue pagination.

Usage Scenarios ​

  • Find payments by status and time window (e.g., 'succeeded' last week)
  • Filter by customer and custom metadata (e.g., ioLoop-created intents)
  • Build paged reports using Stripe's search pagination

Parameters ​

connectionName ​

Type: String

Required: Yes

The name of the Stripe connection configured in the ioLoop app.

fromDateTime ​

Type: String | Date | moment

Required: No

Start of the created-time range (inclusive). Converted to UNIX seconds and added as created>=.

toDateTime ​

Type: String | Date | moment

Required: No

End of the created-time range (inclusive). Converted to UNIX seconds and added as created<=.

status ​

Type: String

Required: No

PaymentIntent status filter (e.g., 'succeeded', 'requires_payment_method').

limit ​

Type: Number

Required: No

Max items per page (1–100). Default is 10.

page ​

Type: String

Required: No

Stripe Search pagination cursor (next_page) from a previous call.

customerId ​

Type: String

Required: No

Filter by Stripe customer id.

other ​

Type: Object

Required: No

Advanced options: { ioLoopOnly?: Boolean, queryParts?: Array<String>, query?: String, expand?: Array<String> (defaults to ['data.latest_charge']), includeRaw?: Boolean }.

Output ​

Type: Promise

Resolves to an object with the following shape:

{ status: boolean, data?: { payments: Array<Payment>, // normalized entries (see Payment below) next: String | null, // Stripe 'next_page' cursor for subsequent searches hasMore: boolean, // mirrors Stripe's has_more raw?: Array<Object> // original Stripe PaymentIntents if other.includeRaw === true }, err?: any }

Payment (normalized): { id: String, // PaymentIntent id (e.g., 'pi_...') createdAt: String | null, // ISO timestamp from PI.created (seconds → ISO) status: String | null, // PaymentIntent status sourceType: String | null, // Uppercased payment method type (e.g., 'CARD', 'CARD_PRESENT') amount: Number | null, // Minor units (e.g., cents). From PI.amount currency: String | null, // Uppercased currency (e.g., 'USD') tipAmount: Number | null, // Sum of numeric fields in latest_charge.amount_details.tip (if any) totalAmount: Number | null, // Equals amount (treated as total) appFeeAmount: Number | null, // From latest_charge.application_fee_amount or PI.application_fee_amount refundedAmount: Number | null, // From latest_charge.amount_refunded (if present) cardBrand: String | null, // From latest_charge.payment_method_details.card.brand last4: String | null, // From latest_charge.payment_method_details.card.last4 entryMethod: String | null, // 'CARD_PRESENT' when detected orderId: String | null, // From PI.metadata.order_id (if set) referenceId: String | null, // From PI.metadata.reference_id (if set) note: String | null, // From PI.description (if set) customerId: String | null, // Stripe customer id (if present) receiptUrl: String | null, // From latest_charge.receipt_url locationId: null, // Not applicable in Stripe mapping (reserved for parity) teamMemberId: null // Not applicable in Stripe mapping (reserved for parity) }

Notes:

  • If other.query is provided, it overrides all auto-built filters.
  • other.queryParts are concatenated with ' AND ' to the auto-built query.
  • other.ioLoopOnly = true appends metadata['tvwa_creator']:"ioLoop.app".
  • The default expand ['data.latest_charge'] enables card details and receipt URL; customize via other.expand.