create_order_body: Create order body

Description Usage Arguments Value

View source: R/utils_post-order.R

Description

Utility Function to Create an Order on Tremendous. For full API documentation, see https://developers.tremendous.com/reference/core-orders-create.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
create_order_body(
  recipient_name,
  recipient_email = NULL,
  recipient_phone = NULL,
  reward_amount,
  currency_code = "USD",
  delivery_method = "EMAIL",
  payment_description_id,
  funding_source_id,
  reward_types
)

Arguments

recipient_name

Name of the recipient.

recipient_email

Email address of the recipient.

recipient_phone

Phone number of the recipient (US phone numbers only).

reward_amount

Amount of the reward (numeric).

currency_code

Currency of the reward (default to "USD").

delivery_method

Default to "EMAIL", for sending the reward to the recipient via email. Alternatively, reward can be delivered via a link ("LINK") or text message ("PHONE").

payment_description_id

Unique ID for specific order. This will appear as external_id on Tremendous Dashboard.

funding_source_id

ID of the funding source linked to your account, to draw funds from for this order. One of the IDs from trem_get("funding_sources").

reward_types

A character vector of product ids – reward options – for the recipient to choose from. Available options can be found here.

Value

A nested list that, when converted to JSON, is accepted by 'Tremendous' API's create order endpoint.


tremendousr documentation built on Sept. 30, 2021, 5:09 p.m.