# NOT RUN {
# }
# NOT RUN {
# Create a new Tremendous API Client
test_client <- trem_client_new(api_key = "TEST_YOUR-API-KEY-HERE",
sandbox = TRUE)
# Perform a POST request to invite new members to your Tremendous Account.
# Documentation: https://developers.tremendous.com/reference/post_members
trem_post(trem_client,
path = "members",
body = list(email = "example@website.com",
name = "Example Person",
role = "MEMBER"))
# Perform a POST send payments --
I find it ~tremendously~ easier to use the `trem_send_reward()` function.
# Documentation: https://developers.tremendous.com/reference/core-orders-create
trem_post(trem_client,
path = "orders",
body = list(
external_id = "manual-payment-post", # This is a payment description id
payment = list(
funding_source_id = "your-funding-id-from-tremendous"
),
rewards = list(
value = list(
denomination = 10,
currency_code = "USD"
),
delivery = list(
method = "EMAIL" # "EMAIL", "LINK", or "PHONE",
),
recipient = list(
name = "first last",
email = "email@website.com"
),
# IDs for Applebee's Gift Card and Amazon Gift Card
products = c("2JFKPXBWDC1K", "VW9JLMPRL9N7")
)
))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab