### Example Product IDs Source: https://developers.tremendous.com/docs/creating-single-product-rewards These are example product IDs for Amazon.com Gift Card, Virtual Visa Card, and PayPal Transfer. Use these or find your own from the catalog. ```text # Amazon.com Gift Card: "OKMHM2X2OHYV" # Virtual Visa Card: "Q24BD9EZ332JT" # PayPal Transfer: "KV934TZ93NQM" ``` -------------------------------- ### Example Forex Response Source: https://developers.tremendous.com/docs/handling-currencies The response from the `/forex` endpoint provides a JSON object mapping currency codes to their exchange rates. ```json { "forex" : { "AED" : 3.672979, "AFN" : 70.516576, "ALL" : 92.41957, "AMD" : 387.969561, "ANG" : 1.80347, "AOA" : 849.00017 // .... } } ``` -------------------------------- ### Campaign Data Response Example Source: https://developers.tremendous.com/docs/data-formats A sample JSON response body for retrieving campaign details, showing common fields like ID, name, description, and associated products. ```json { "campaign": { "id": "SOMEIDSOMEID", "name": "My Default Campaign", "description": "A campaign I use as the default in Tremendous", "products": [ "P3MR06THYM8R", "EFMULTF26PMR" ] } } ``` -------------------------------- ### Create an Order with a Campaign Source: https://developers.tremendous.com/docs/personalize-and-style-your-rewards This example demonstrates how to create an order and apply a specific campaign to it. Using a `campaign_id` in the reward payload ensures the reward uses the campaign's branding, copy, and product selection. ```APIDOC ## Create an Order with a Campaign ### Description Creates a new order, applying a specified campaign to the reward for customized branding, copy, and product selection. ### Method POST ### Endpoint /api/v2/orders ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **payment** (object) - Payment details for the order. - **funding_source_id** (string) - The ID of the funding source to use. - **reward** (object) - Details of the reward to be sent. - **value** (object) - The monetary value of the reward. - **denomination** (number) - The amount of the reward. - **delivery** (object) - Delivery method for the reward. - **method** (string) - The delivery method (e.g., EMAIL). - **recipient** (object) - Information about the reward recipient. - **name** (string) - The name of the recipient. - **email** (string) - The email address of the recipient. - **campaign_id** (string) - The ID of the campaign to apply to this reward. This will override default branding, copy, and product selection. ### Request Example ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data '{ "payment": { "funding_source_id": "YOUR-FUNDING-SOURCE-ID" }, "reward": { "value": { "denomination": 50 }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "jane.doe@example.com" }, "campaign_id": "YOUR-CAMPAIGN-ID" } }' ``` ### Response #### Success Response (200) (Response structure for order creation not detailed in source, but typically includes order confirmation details.) #### Response Example (Response example not provided in source.) ``` -------------------------------- ### Funding Sources Response Source: https://developers.tremendous.com/docs/paying-for-orders-1 Example JSON response when querying funding sources. It shows details like method, ID, status, and available balance for each source. ```json { "funding_sources": [ { "method": "balance", "id": "GCTHLCMFVYMD", "usage_permissions": [ "api_orders", "dashboard_orders" ], "status": "active", "meta": { "available_cents": 600000, "pending_cents": 0 } }, { "method": "invoice", "usage_permissions": [ "api_orders" ], "status": "active", "type": "COMMERCIAL", "id": "4G1IPSQINMMV" } ] } ``` -------------------------------- ### JSON Response Structure Example Source: https://developers.tremendous.com/docs/data-formats Illustrates the typical JSON structure for API responses, featuring a top-level key named after the returned object. ```json { "order": { … } } ``` -------------------------------- ### Example Authenticated Request with cURL Source: https://developers.tremendous.com/docs/authentication Demonstrates how to make an authenticated API request using cURL. Replace YOUR-API-KEY with your actual API key or OAuth access token. ```curl curl --header 'Authorization: Bearer YOUR-API-KEY' --url 'https://testflight.tremendous.com/api/v2/organizations' ``` -------------------------------- ### Create Order with Campaign ID Source: https://developers.tremendous.com/docs/personalize-and-style-your-rewards This cURL example demonstrates how to create an order using a campaign. Pass the 'campaign_id' within the 'reward' object. The 'products' field can be omitted as it's defined in the campaign. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' --header 'Authorization: Bearer YOUR-API-KEY' --header 'Content-Type: application/json' --data ' { "payment": { "funding_source_id": "YOUR-FUNDING-SOURCE-ID" }, "reward": { "value": { "denomination": 50 }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "jane.doe@example.com" }, "campaign_id": "YOUR-CAMPAIGN-ID" } } ' ``` -------------------------------- ### Authenticating via API Key Source: https://developers.tremendous.com/docs/api-key To authenticate your requests, include your API key in the Authorization header as a Bearer token. This example shows how to ping the API to verify authentication. ```APIDOC ## Authenticating via API key To authenticate via API key, make a request using the following format: ```curl curl --header 'Authorization: Bearer YOUR-API-KEY' \ --url 'https://testflight.tremendous.com/api/v2/ping' ``` ### Method GET ### Endpoint /api/v2/ping ### Request Headers - **Authorization**: Bearer YOUR-API-KEY (Required) ``` -------------------------------- ### Campaign Response Example Source: https://developers.tremendous.com/docs/personalize-and-style-your-rewards This JSON structure shows the typical response when querying for campaigns. Extract the 'id' field from the campaign you wish to use. ```json { "campaigns": [ { "id": "YMS6V0BPDVJT", "products": [ "SRDHFATO9KHN", "OKMHM2X2OHYV", "Q24BD9EZ332JT", "KV934TZ93NQM" ], "description": "Campaign for demoing the API", "name": "My Custom Campaign" } ] } ``` -------------------------------- ### Webhook Request Body Example Source: https://developers.tremendous.com/docs/webhooks-1 This is an example of the JSON payload structure for a webhook request. It includes the event type, a unique ID, timestamp, and payload details. ```json { "event": "CAMPAIGNS.CREATED", "uuid": "5ccc7bb1-7659-4e23-a407-77d8cd9c62f5", "created_utc": "2021-04-06T20:05:01.037-04:00", "payload": { "resource": { "id": "2V3PCCL7QXDA", "type": "campaigns" }, "meta": { } } } ``` -------------------------------- ### API Call to Set Custom Reward Email Copy Source: https://developers.tremendous.com/docs/personalizing-rewards-without-campaigns Use this example to send a POST request to the /api/v2/orders endpoint to create an order with custom email reward copy. Ensure your API key and recipient email are correctly set. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL", "meta": { "subject_line": "A custom subject line", "message": "My very special reward message", "from_name": "Acme Co." } }, "recipient": { "name": "Jane Doe", "email": "YOUR-EMAIL-ADDRESS@example.com" }, "products": [ "OKMHM2X2OHYV", "KV934TZ93NQM", "ET0ZVETV5ILN", "Q24BD9EZ332JT", "TBAJH7YLFVS5" ] } } ' ``` -------------------------------- ### Create a Topup via API Source: https://developers.tremendous.com/docs/managing-your-balance Use this cURL command to create a topup and add funds to your Tremendous balance. Ensure you have a funding source with `balance_funding` permission and an active status. A unique idempotency key is required for each request. ```curl curl --request POST \ --url https://testflight.tremendous.com/api/v2/topups \ --header 'accept: application/json' \ --header 'authorization: Bearer YOUR_API_KEY_HERE' \ --header 'content-type: application/json' \ --data \ '{ "funding_source_id": "YOUR-SELECTED-SOURCE-ID", "idempotency_key": "idempotency-key", "amount": 200.35 }' ``` -------------------------------- ### Create a Topup Source: https://developers.tremendous.com/docs/managing-your-balance Initiates a topup to add funds to your Tremendous balance using a stored funding source. Requires a funding source ID, a unique idempotency key, and the amount. ```APIDOC ## Create a Topup ### Description Initiates a topup to add funds to your Tremendous balance using a stored funding source. Requires a funding source ID, a unique idempotency key, and the amount. ### Method POST ### Endpoint /api/v2/topups ### Parameters #### Request Body - **funding_source_id** (string) - Required - The ID of the funding source to use for the topup. - **idempotency_key** (string) - Required - A unique key to ensure the topup is processed only once. - **amount** (number) - Required - The amount of funds to add to the balance. ### Request Example ```json { "funding_source_id": "YOUR-SELECTED-SOURCE-ID", "idempotency_key": "idempotency-key", "amount": 200.35 } ``` ### Response #### Success Response (201 Created) - **topup** (object) - Contains details of the created topup. - **id** (string) - The unique identifier for the topup. - **amount** (number) - The amount of the topup. - **processing_fee** (number) - The fee associated with the topup. - **funding_source_id** (string) - The ID of the funding source used. - **status** (string) - The current status of the topup (e.g., "created", "fully_credited"). - **created_at** (string) - The timestamp when the topup was created. - **fully_credited_at** (string) - The timestamp when the topup was fully credited (null if not yet credited). - **rejected_at** (string) - The timestamp when the topup was rejected (null if not rejected). - **reversed_at** (string) - The timestamp when the topup was reversed (null if not reversed). - **reversed_reason** (string) - The reason for reversal (null if not reversed). - **idempotency_key** (string) - The idempotency key used for the request. #### Response Example ```json { "topup": { "id": "XC82V7YJI4CC", "amount": 200.35, "processing_fee": 6.01, "funding_source_id": "FUNDING-SOURCE-ID", "status": "created", "created_at": "2025-08-14T22:22:30.783Z", "fully_credited_at": null, "rejected_at": null, "reversed_at": null, "reversed_reason": null, "idempotency_key": "abc1234" } } ``` ### Idempotency An idempotency key must be included to ensure that a topup is processed only once. Retrying a request with the same key will either result in the same successful topup or an HTTP 409 Conflict if a prior request with that key was accepted. Failed requests with a specific key can be retried with the same key. ``` -------------------------------- ### Get Exchange Rates Source: https://developers.tremendous.com/docs/handling-currencies Retrieve the latest exchange rates maintained by Tremendous. This is useful for understanding currency conversions. ```APIDOC ## GET /api/v2/forex ### Description Fetches the current exchange rates for various currencies. ### Method GET ### Endpoint /api/v2/forex ### Parameters No parameters are required for this endpoint. ### Request Example ```shell curl --url 'https://testflight.tremendous.com/api/v2/forex' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' ``` ### Response #### Success Response (200) - **forex** (object) - An object containing currency codes as keys and their corresponding exchange rates as values. ### Response Example ```json { "forex" : { "AED" : 3.672979, "AFN" : 70.516576, "ALL" : 92.41957, "AMD" : 387.969561, "ANG" : 1.80347, "AOA" : 849.00017 } } ``` ``` -------------------------------- ### Setting up Webhooks Source: https://developers.tremendous.com/docs/tremendous-connect This endpoint allows you to set up a webhook to receive notifications about account-related events. ```APIDOC ## POST /api/v2/webhooks ### Description Registers a webhook URL to receive event notifications. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/webhooks ### Request Body - **url** (string) - Required - The URL to send webhook notifications to. ### Request Example ```json { "url": "YOUR_ENDPOINT_TO_PROCESS_WEBHOOKS_HERE" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the created webhook. - **url** (string) - The registered webhook URL. - **created_at** (string) - The timestamp when the webhook was created. ``` -------------------------------- ### Rate Limited Response Example Source: https://developers.tremendous.com/docs/rate-limiting This JSON structure is returned when the API rate limit is exceeded. It indicates a 'Too many requests' error. ```json { "error": { "message": "Too many requests", "payload": {} } } ``` -------------------------------- ### Set up a Webhook Source: https://developers.tremendous.com/docs/tremendous-connect Use this cURL command to set up a webhook to receive account-related event notifications from Tremendous. Ensure you replace YOUR_ENDPOINT_TO_PROCESS_WEBHOOKS_HERE with your actual endpoint URL. ```curl curl --request POST \ --url https://testflight.tremendous.com/api/v2/webhooks \ --header 'accept: application/json' \ --header 'authorization: Bearer YOUR-API-KEY' \ --header 'content-type: application/json' \ --data '{"url": "YOUR_ENDPOINT_TO_PROCESS_WEBHOOKS_HERE"}' ``` -------------------------------- ### Ping the API with your Sandbox Key Source: https://developers.tremendous.com/docs/2-get-your-sandbox-api-key Use this cURL command to verify your API key by pinging the Tremendous API. Replace 'YOUR-API-KEY' with your actual generated key. ```APIDOC ## GET /ping ### Description Pings the Tremendous API to verify authentication and connectivity. ### Method GET ### Endpoint https://testflight.tremendous.com/api/v2/ping ### Headers - Authorization: Bearer YOUR-API-KEY ### Request Example ```bash curl --url 'https://testflight.tremendous.com/api/v2/ping' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` ### Response #### Success Response (200) - **message** (string) - A confirmation message indicating successful authentication and the organization name. ``` -------------------------------- ### Create Session URL for Onboarding Source: https://developers.tremendous.com/docs/tremendous-connect Generate a session URL for a connected organization member to complete the onboarding process. Replace CONNECTED-ORGANIZATION-MEMBER-SESSION-ID-FROM-PREVIOUS-STEP with the ID obtained previously and WHERE-TREMENDOUS-SHOULD-REDIRECT-USER-TO-ON-COMPLETION with your desired return URL. ```curl curl --url 'https://testflight.tremendous.com/api/v2/connected_organization_members/CONNECTED-ORGANIZATION-MEMBER-SESSION-ID-FROM-PREVIOUS-STEP/sessions' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data \ { "return_url": "WHERE-TREMENDOUS-SHOULD-REDIRECT-USER-TO-ON-COMPLETION" } ``` -------------------------------- ### Get Custom Field IDs Source: https://developers.tremendous.com/docs/using-custom-fields-to-add-custom-data-to-rewards Retrieve the IDs of your custom fields by querying the /fields endpoint. This is necessary before you can set custom field values in orders. ```curl curl --request GET \ --url https://testflight.tremendous.com/api/v2/fields \ --header 'Accept: application/json' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` -------------------------------- ### Get Custom Fields Source: https://developers.tremendous.com/docs/using-custom-fields-to-add-custom-data-to-rewards Retrieve a list of available custom fields by querying the /fields endpoint. This is necessary to obtain the ID for a specific custom field before you can set its value. ```APIDOC ## Get Custom Fields ### Description Retrieves a list of all available custom fields configured in the Tremendous platform. This is a prerequisite step to identify the `id` of a custom field you wish to use. ### Method GET ### Endpoint /api/v2/fields ### Request Example ```curl curl --request GET \ --url https://testflight.tremendous.com/api/v2/fields \ --header 'Accept: application/json' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` ### Response #### Success Response (200) - **fields** (array) - An array of custom field objects. - **id** (string) - The unique identifier for the custom field. - **label** (string) - The human-readable label for the custom field. - **data_type** (string) - The type of data the field accepts (e.g., 'Dropdown', 'Text'). - **data** (object) - Additional data specific to the field type (e.g., 'options' for dropdowns). - **required** (boolean) - Indicates if the field is mandatory. - **scope** (string) - The scope of the field (e.g., 'REWARD'). #### Response Example ```json { "fields": [ { "id": "JLTZSBH3577S", "label": "harry_potter_house", "data_type": "Dropdown", "data": { "options": [ "Gryffindor", "Slytherin", "Ravenclaw", "Hufflepuff" ] }, "required": false, "scope": "REWARD" } ] } ``` ``` -------------------------------- ### Test API Key with cURL Source: https://developers.tremendous.com/docs/2-get-your-sandbox-api-key Use this cURL command to verify your API key by pinging the sandbox environment. Replace YOUR-API-KEY with your actual key. ```curl curl --url 'https://testflight.tremendous.com/api/v2/ping' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` -------------------------------- ### Make a request to the Sandbox environment using curl Source: https://developers.tremendous.com/docs/sandbox-environment Use this command to make a request to the Sandbox environment. Ensure your API key is prefixed with TEST_. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders'\ --header 'Authorization: Bearer TEST_some-api-key-string' ``` -------------------------------- ### Create Order with Specific Funding Source Source: https://developers.tremendous.com/docs/paying-for-orders-1 This cURL command demonstrates how to create an order using a specific funding source ID. Ensure the 'funding_source_id' is valid and has the necessary permissions. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "YOUR-SELECTED-SOURCE-ID" }, "reward": { "value": { "denomination": 50 }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "jane.doe@example.com" }, "products": [ "OKMHM2X2OHYV" ] } }' ``` -------------------------------- ### Create a multi-product reward by specifying products manually Source: https://developers.tremendous.com/docs/creating-multi-product-rewards-wip This method allows you to create a reward by directly specifying a list of product IDs, without using a campaign. This is useful for dynamic reward offerings. ```APIDOC ## POST /api/v2/orders ### Description Creates a new order, specifying multiple products directly for a multi-product reward. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/orders ### Request Body - **payment** (object) - Required - Payment details. - **funding_source_id** (string) - Required - The ID of the funding source (e.g., "BALANCE"). - **reward** (object) - Required - Reward details. - **value** (object) - Required - The value of the reward. - **denomination** (number) - Required - The monetary value of the reward. - **currency_code** (string) - Required - The currency code (e.g., "USD"). - **delivery** (object) - Required - Delivery details. - **method** (string) - Required - The delivery method (e.g., "EMAIL"). - **recipient** (object) - Required - Recipient details. - **name** (string) - Required - The name of the recipient. - **email** (string) - Required - The email address of the recipient. - **products** (array) - Required - A list of product IDs to be offered as payout options. - (string) - A product ID. ### Request Example ```json { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "KV934TZ93NQM", "Q24BD9EZ332JT", "KV934TZ93NQM" ] } } ``` ### Response #### Success Response (200) (Response structure not explicitly defined in source, but typically includes order confirmation details.) #### Response Example (No example provided in source.) ``` -------------------------------- ### Query Funding Sources Source: https://developers.tremendous.com/docs/paying-for-orders Use this cURL command to programmatically query the available funding sources for your account. This helps in understanding your balance and other funding methods. ```curl curl --url 'https://testflight.tremendous.com/api/v2/funding_sources' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` ```json { "funding_sources": [ { "method": "balance", "id": "GCTHLCMFVYMD", "usage_permissions": [ "api_orders", "dashboard_orders" ], "status": "active", "meta": { "available_cents": 600000, "pending_cents": 0 } } ] } ``` -------------------------------- ### Topup Creation Response Source: https://developers.tremendous.com/docs/managing-your-balance This JSON response indicates a successfully created topup. The status will update to `fully_credited` once funds are applied. Listen for `TOPUPS.FULLY_CREDITED` webhooks for notifications. ```json { "topup": { "id": "XC82V7YJI4CC", "amount": 200.35, "processing_fee": 6.01, "funding_source_id": "FUNDING-SOURCE-ID", "status": "created", "created_at": "2025-08-14T22:22:30.783Z", "fully_credited_at": null, "rejected_at": null, "reversed_at": null, "reversed_reason": null, "idempotency_key": "abc1234" } } ``` -------------------------------- ### Create Order with Single Product - cURL Source: https://developers.tremendous.com/docs/creating-single-product-rewards Use this cURL command to create an order for a single product. Replace 'SELECTED-PRODUCT-ID' with the actual product ID and 'YOUR-API-KEY' with your Tremendous API key. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 10 }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "SELECTED-PRODUCT-ID" ] } } ' ``` -------------------------------- ### Query Funding Sources Source: https://developers.tremendous.com/docs/paying-for-orders-1 Use this cURL command to retrieve a list of available funding sources. Check the 'status' and 'usage_permissions' before selecting a funding source. ```curl curl --url 'https://testflight.tremendous.com/api/v2/funding_sources' \ --header 'Authorization: Bearer YOUR-API-KEY' ``` -------------------------------- ### Create Multi-Product Reward with Manual Product Specification Source: https://developers.tremendous.com/docs/creating-multi-product-rewards-wip Specify payout products directly in the API request by omitting the campaign ID and providing a list of product IDs. This is useful for dynamic reward configurations. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "KV934TZ93NQM", "Q24BD9EZ332JT", "KV934TZ93NQM" ] } } ' ``` -------------------------------- ### Send a Test Reward Source: https://developers.tremendous.com/docs/3-sending-your-first-reward This cURL command sends a $50.00 USD reward via email to a specified recipient. Replace YOUR-API-KEY and YOUR-EMAIL-ADDRESS with your actual credentials and desired email. ```APIDOC ## POST /api/v2/orders ### Description Sends a reward to a recipient. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/orders ### Headers - Authorization: Bearer YOUR-API-KEY - Content-Type: application/json ### Request Body - **payment** (object) - Required - Payment details. - **funding_source_id** (string) - Required - The ID of the funding source (e.g., "BALANCE"). - **reward** (object) - Required - Reward details. - **value** (object) - Required - The value of the reward. - **denomination** (number) - Required - The amount of the reward. - **currency_code** (string) - Required - The currency code (e.g., "USD"). - **delivery** (object) - Required - Delivery details. - **method** (string) - Required - The delivery method (e.g., "EMAIL"). - **recipient** (object) - Required - Recipient details. - **name** (string) - Required - The name of the recipient. - **email** (string) - Required - The email address of the recipient. - **products** (array) - Required - A list of product IDs for the reward. ### Request Example ```json { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "YOUR-EMAIL-ADDRESS@example.com" }, "products": [ "OKMHM2X2OHYV", "KV934TZ93NQM", "ET0ZVETV5ILN", "Q24BD9EZ332JT", "TBAJH7YLFVS5" ] } } ``` ``` -------------------------------- ### Top-up Created Event Source: https://developers.tremendous.com/docs/webhooks-1 Signals that a top-up is currently being processed and may be subject to review. ```APIDOC ## Event: TOPUPS.CREATED ### Description The topup is processing (and may be under review). ``` -------------------------------- ### Product Information with Currency Codes Source: https://developers.tremendous.com/docs/handling-currencies Product objects include a `currency_codes` attribute indicating the currency the product is denominated in. ```json { "id": "KQXGBF4HO1CN", "name": "Amazon.fr", "currency_codes": [ "EUR" ], "skus": [ { "min": 0.01, "max": 5000 } ], "countries": [ { "abbr": "FR" } ], "category": "merchant_cards", "description": "", "images": [ { "src": "https://giftrocket-s3.imgix.net/Brands/FR/AmazonFR.png", "type": "card" } ] } ``` -------------------------------- ### Create Session for Connected Organization Member Source: https://developers.tremendous.com/docs/tremendous-connect This endpoint generates a session URL that you will redirect the user to for completing onboarding actions. ```APIDOC ## POST /api/v2/connected_organization_members/{id}/sessions ### Description Generates a session URL for a connected organization member to complete onboarding. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/connected_organization_members/{id}/sessions ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the connected organization member. #### Request Body - **return_url** (string) - Required - The URL where Tremendous should redirect the user upon completion. ### Request Example ```json { "return_url": "WHERE-TREMENDOUS-SHOULD-REDIRECT-USER-TO-ON-COMPLETION" } ``` ### Response #### Success Response (200) - **session_url** (string) - The URL for the user to complete onboarding. - **expires_at** (string) - The timestamp when the session URL expires. ``` -------------------------------- ### Placing an order for a LINK reward Source: https://developers.tremendous.com/docs/link-delivery To issue a link reward, specify "LINK" as the delivery method for the reward when placing an order. ```APIDOC ## POST /api/v2/orders ### Description Issues a reward with a delivery method of "LINK", providing a direct link for the user to deliver. ### Method POST ### Endpoint /api/v2/orders ### Request Body - **payment** (object) - Required - Payment details for the order. - **funding_source_id** (string) - Required - The ID of the funding source (e.g., "BALANCE"). - **reward** (object) - Required - Details of the reward to be issued. - **value** (object) - Required - The monetary value of the reward. - **denomination** (number) - Required - The amount of the reward. - **currency_code** (string) - Required - The currency code (e.g., "USD"). - **delivery** (object) - Required - Delivery method details. - **method** (string) - Required - Must be set to "LINK" for link delivery. - **recipient** (object) - Required - Information about the recipient. - **name** (string) - Required - The name of the recipient. - **email** (string) - Required - The email of the recipient. - **products** (array) - Required - A list of product IDs for the reward. - (string) - The product ID. ### Request Example ```json { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "LINK" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "OKMHM2X2OHYV" ] } } ``` ### Response #### Success Response (200) - **order** (object) - Details of the placed order. - **id** (string) - The unique identifier for the order. - **rewards** (array) - A list of rewards included in the order. - **delivery** (object) - Reward delivery details. - **link** (string) - The direct link to the reward. #### Response Example ```json { "order": { "id": "SFZCMH4NMC5X", "external_id": null, "created_at": "2023-01-10T21:44:06.441Z", "status": "EXECUTED", "channel": "API", "payment": { "subtotal": 50.0, "total": 50.0, "fees": 0.0 }, "rewards": [ { "id": "4SBVBQGUZOGR", "order_id": "SFZCMH4NMC5X", "created_at": "2023-01-10T21:44:06.567Z", "value": { "denomination": 50.0, "currency_code": "USD" }, "delivery": { "method": "LINK", "status": "SUCCEEDED", "link": "https://testflight.tremendous.com/rewards/payout/d0jgy1s8n--zkeqp-za8dbvrazboibjixi0cwxapb9r" }, "recipient": { "email": "recipient@example.com", "name": "Jane Doe" } } ] } } ``` ``` -------------------------------- ### Send Test Reward via cURL Source: https://developers.tremendous.com/docs/3-sending-your-first-reward Use this cURL command to send a $50.00 USD reward via email. Replace YOUR-API-KEY and YOUR-EMAIL-ADDRESS with your actual credentials. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "YOUR-EMAIL-ADDRESS@example.com" }, "products": [ "OKMHM2X2OHYV", "KV934TZ93NQM", "ET0ZVETV5ILN", "Q24BD9EZ332JT", "TBAJH7YLFVS5" ] } } ' ``` -------------------------------- ### Create a multi-product reward using a campaign Source: https://developers.tremendous.com/docs/creating-multi-product-rewards-wip This method involves creating a campaign in the Tremendous Dashboard and then referencing its ID when creating a reward via the API. This is useful for sending similar rewards over time. ```APIDOC ## POST /api/v2/orders ### Description Creates a new order, which can include a multi-product reward using a campaign ID. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/orders ### Request Body - **payment** (object) - Required - Payment details. - **funding_source_id** (string) - Required - The ID of the funding source (e.g., "BALANCE"). - **reward** (object) - Required - Reward details. - **campaign_id** (string) - Required - The ID of the campaign to use for the reward. - **value** (object) - Required - The value of the reward. - **denomination** (number) - Required - The monetary value of the reward. - **currency_code** (string) - Required - The currency code (e.g., "USD"). - **delivery** (object) - Required - Delivery details. - **method** (string) - Required - The delivery method (e.g., "EMAIL"). - **recipient** (object) - Required - Recipient details. - **name** (string) - Required - The name of the recipient. - **email** (string) - Required - The email address of the recipient. ### Request Example ```json { "payment": { "funding_source_id": "BALANCE" }, "reward": { "campaign_id": "YOUR-CAMPAIGN-ID-HERE", "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" } } } ``` ### Response #### Success Response (200) (Response structure not explicitly defined in source, but typically includes order confirmation details.) #### Response Example (No example provided in source.) ``` -------------------------------- ### Order Response with LINK Source: https://developers.tremendous.com/docs/link-delivery This JSON response shows the structure when a LINK reward is successfully created. The reward object will contain a 'link' field with the deliverable URL. ```json { "order": { "id": "SFZCMH4NMC5X", "external_id": null, "created_at": "2023-01-10T21:44:06.441Z", "status": "EXECUTED", "channel": "API", "payment": { "subtotal": 50.0, "total": 50.0, "fees": 0.0 }, "rewards": [ { "id": "4SBVBQGUZOGR", "order_id": "SFZCMH4NMC5X", "created_at": "2023-01-10T21:44:06.567Z", "value": { "denomination": 50.0, "currency_code": "USD" }, "delivery": { "method": "LINK", "status": "SUCCEEDED", "link": "https://testflight.tremendous.com/rewards/payout/d0jgy1s8n--zkeqp-za8dbvrazboibjixi0cwxapb9r" }, "recipient": { "email": "recipient@example.com", "name": "Jane Doe" } } ] } } ``` -------------------------------- ### Create Order with Email Delivery Source: https://developers.tremendous.com/docs/emailing-rewards This API call creates a new order and sends the reward to the recipient via email. Ensure you have a valid API key and the recipient's email address. ```APIDOC ## POST /api/v2/orders ### Description Creates a new order with rewards to be delivered via email to the specified recipient. ### Method POST ### Endpoint /api/v2/orders ### Request Body - **payment** (object) - Required - Payment details for the order. - **funding_source_id** (string) - Required - The ID of the funding source to use (e.g., "BALANCE"). - **reward** (object) - Required - Details of the reward to be sent. - **value** (object) - Required - The monetary value of the reward. - **denomination** (number) - Required - The amount of the reward. - **currency_code** (string) - Required - The currency code for the reward (e.g., "USD"). - **delivery** (object) - Required - Delivery method details. - **method** (string) - Required - The delivery method, set to "EMAIL" for email delivery. - **recipient** (object) - Required - Information about the reward recipient. - **name** (string) - Required - The name of the recipient. - **email** (string) - Required - The email address of the recipient. - **products** (array of strings) - Required - A list of product IDs for the rewards. ### Request Example ```json { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "OKMHM2X2OHYV" ] } } ``` ### Response #### Success Response (200) - **order** (object) - Details of the created order. - **rewards** (array) - List of rewards included in the order. #### Response Example (Response structure not explicitly detailed in source, but would typically include order confirmation details.) ``` -------------------------------- ### Create and Email a Reward via API Source: https://developers.tremendous.com/docs/emailing-rewards Use this API call to create a reward and have Tremendous email it directly to your recipient. Ensure you have a valid API key and the recipient's email address. ```curl curl --url 'https://testflight.tremendous.com/api/v2/orders' \ --header 'Authorization: Bearer YOUR-API-KEY' \ --header 'Content-Type: application/json' \ --data ' { "payment": { "funding_source_id": "BALANCE" }, "reward": { "value": { "denomination": 50, "currency_code": "USD" }, "delivery": { "method": "EMAIL" }, "recipient": { "name": "Jane Doe", "email": "recipient@example.com" }, "products": [ "OKMHM2X2OHYV" ] } } ' ``` -------------------------------- ### Test Production API Endpoint Source: https://developers.tremendous.com/docs/production-api-access Use this command to test your production API key and ensure your requests are directed to the production domain. Replace PRODUCTION-API-KEY with your actual key. ```curl curl --url 'https://api.tremendous.com/api/v2/ping' \ --header 'Authorization: Bearer PRODUCTION-API-KEY' ``` -------------------------------- ### Create Connected Organization Member Source: https://developers.tremendous.com/docs/tremendous-connect This endpoint creates a 'connected organization member' representing an individual user who will perform onboarding actions. ```APIDOC ## POST /api/v2/connected_organization_members ### Description Creates a member associated with a connected organization. ### Method POST ### Endpoint https://testflight.tremendous.com/api/v2/connected_organization_members ### Parameters #### Request Body - **connected_organization_id** (string) - Required - The ID of the connected organization. - **external_email** (string) - Required - The email address of the user. - **external_name** (string) - Required - The name of the user. ### Request Example ```json { "connected_organization_id": "CONNECTED-ORGANIZATION-ID-RETURNED-IN-PREVIOUS-STEP", "external_email": "USER-EMAIL", "external_name": "USER-NAME" } ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the connected organization member. - **connected_organization_id** (string) - The ID of the associated connected organization. - **external_email** (string) - The email address of the member. - **external_name** (string) - The name of the member. ```