trem_get {tremendousr} | R Documentation |
Perform a GET request to Tremendous API
Description
This function provides lower-level access to perform GET requests via Tremendous API. Available endpoints can be found on the official Tremendous API documentation.
Usage
trem_get(
client,
path,
query = list(),
disk = NULL,
stream = NULL,
parse = TRUE
)
Arguments
client |
A Tremendous API Client object, created with
|
path |
The URL path, appended to the base URL, for GET requests such as listing available payment types, funding sources, account members, and more. See the Tremendous API Documentation for examples. |
query |
Query terms as a named list. See crul::HttpClient for more details. |
disk |
A path to write to. |
stream |
An R function to determine how to stream data. |
parse |
Logical: Should the API Response results be parsed into a data frame? |
Value
If parse = TRUE
(default), a list containing the
response from the API request. Otherwise, the R6 HttpResponse object
containing API request data.
Examples
## Not run:
# Create a new Tremendous API Client
test_client <- trem_client_new(api_key = "TEST_YOUR-API-KEY-HERE",
sandbox = TRUE) # Sandbox environment so no actual money is sent
# Perform a GET request to list funding sources available in your Tremendous
# Account. Documentation:
# https://developers.tremendous.com/reference/core-funding-source-index
trem_get(trem_client, "funding_sources")
# Perform a GET request to list all invoices on your Tremendous Account.
# Documentation:
# https://developers.tremendous.com/reference/core-invoices-index
trem_get(trem_client, "invoices")
# Perform a GET request to list all orders (payment history) on your Tremendous
# Account. Documentation:
# https://developers.tremendous.com/reference/core-orders-index
trem_get(trem_client, "orders")
# Perform a GET request to list a specific order's information (payment history)
# from your Tremendous Account. Documentation:
# https://developers.tremendous.com/reference/core-orders-show
trem_get(trem_client, "orders/YOUR-ORDER-ID")
## End(Not run)