Skip to main content

stripe@1.0.0

get(resource, id)
list(resource, options)

This adaptor exports the following namespaced functions:

http.get(path, options)
http.post(path, body, options)
http.request(method, path, body, options)

This adaptor exports the following from common:

as()
assert()
combine()
cursor()
dataPath()
dataValue()
dateFns
each()
field()
fields()
fn()
fnIf()
group()
lastReferenceValue()
map()
merge()
scrubEmojis()
sourceValue()
util

Functions

get

get(resource, id) ⇒ Operation

Get a single resource using its ID

ParamTypeDescription
resourcestringThe API path to retrieve.
idstringThe ID of the resource to retrieve.

This operation writes the following keys to state:

State KeyDescription
dataThe requested resource object

Example: Get a payment intent

get('payment_intents','pi_3RxS5EEAUr6ipfDB0aKo3moC');

Example: Get a customer

get('customers','cus_SthTl85l20LRJj');

list

list(resource, options) ⇒ Operation

List items from Stripe

ParamTypeDescription
resourcestringThe API resource to list items from.
optionsobjectOptional options object. See Stripe API documentation for more details.

This operation writes the following keys to state:

State KeyDescription
dataan array of items

Example: List all payment intents

list('payment_intents');

Example: List customers with options

list('customers', {limit:3});

http

These functions belong to the http namespace.

http.get

get(path, options) ⇒ Operation

Make a GET request to Stripe

ParamTypeDescription
pathstringPath to resource
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

Example: Get all invoices

http.get('/invoices')

http.post

post(path, body, options) ⇒ Operation

Make a POST request to Stripe

ParamTypeDescription
pathstringPath to resource
bodyobjectObject which will be attached to the POST body
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

Example: Post a new payment intent

http.post(
'/payment_intents',
{},
{
query: {
amount: 10000,
currency: 'usd',
},
}
);

http.request

request(method, path, body, options) ⇒ Operation

Make a general HTTP request to Stripe

ParamTypeDescription
methodstringHTTP method to use
pathstringPath to resource
bodyobjectObject which will be attached to the POST body
optionsRequestOptionsOptional request options

This operation writes the following keys to state:

State KeyDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

Example: Get all customers

http.request('GET', 'customers');

Interfaces

HttpState

State object

Properties

NameDescription
datathe parsed response body
responsethe response from the HTTP server, including headers, statusCode, body, etc
referencesan array of all previous data objects used in the Job

RequestOptions

Options provided to the HTTP request

Properties

NameTypeDescription
bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
queryobjectAn object of query parameters to be encoded into the URL.
headersobjectAn object of headers to append to the request.
parseAsstringParse the response body as json, text or stream. By default will use the response headers.
timeoutnumberRequest timeout in ms. Default: 300 seconds.
tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions