tremendous_ruby 5.15.0 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tremendous/api/tremendous_api.rb +2 -2
- data/lib/tremendous/models/create_order200_response_order_rewards_inner.rb +12 -1
- data/lib/tremendous/models/currency_codes.rb +1 -2
- data/lib/tremendous/models/list_products_response_products_inner.rb +1 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner.rb +12 -1
- data/lib/tremendous/models/list_rewards200_response_rewards_inner_value.rb +2 -2
- data/lib/tremendous/models/order_with_link_rewards_inner.rb +12 -1
- data/lib/tremendous/models/order_without_link_rewards_inner.rb +12 -1
- data/lib/tremendous/models/product.rb +1 -1
- data/lib/tremendous/models/reward.rb +12 -1
- data/lib/tremendous/models/reward_base.rb +12 -1
- data/lib/tremendous/models/reward_for_order_create.rb +12 -1
- data/lib/tremendous/models/reward_value.rb +2 -2
- data/lib/tremendous/models/reward_with_link.rb +12 -1
- data/lib/tremendous/models/reward_without_link.rb +12 -1
- data/lib/tremendous/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e7206793c4732502082c66c84a0b389256377d04a907c08f41ef3fe394dd305f
|
|
4
|
+
data.tar.gz: 4dac1e9ff3ac43f3424a65ac9d478030ce2f6488b4639eb98d375f37f2b4de6c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d1f48b822017e2ec610a20c9fec86b4346e04d1b28c9e5a4805aa00118c33dded7281fe581fc4e3c0427da3e2d8becf21ebcaf5875d25db6c8fba3fdc98f30cd
|
|
7
|
+
data.tar.gz: '09990b38d8b3651e2ed21f4a281d7c8aac84f3b60008adfbda79ad38efd411324ba745644432f0c2d2387d35fc53432f3deb47bb30a19ec5edf811514c27f53e'
|
|
@@ -756,7 +756,7 @@ module Tremendous
|
|
|
756
756
|
end
|
|
757
757
|
|
|
758
758
|
# Create order
|
|
759
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
759
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous's balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The "sender name" used in the delivery. If it's an email reward, "via Tremendous" will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
760
760
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
761
761
|
# @param [Hash] opts the optional parameters
|
|
762
762
|
# @return [CreateOrder200Response]
|
|
@@ -766,7 +766,7 @@ module Tremendous
|
|
|
766
766
|
end
|
|
767
767
|
|
|
768
768
|
# Create order
|
|
769
|
-
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
769
|
+
# Every time you want to send out a reward through Tremendous you need to create an order for it. > 📘 Getting started with your first order > > Our step-by-step guide walks you through everything you need > to send your first gift card through the Tremendous API: > > <strong><a style=\"display: block; margin-top: 20px;\" href=\"/docs/sending-rewards-intro\">Check it out!</a></strong> ## Request body <div class=\"object-schema-request-schema\"> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">external_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Reference for this order, supplied by the customer.</p> <p>When set, <code>external_id</code> makes order idempotent. All requests that use the same <code>external_id</code> after the initial order creation, will result in a response that returns the data of the initially created order. The response will have a <code>201</code> response code. These responses <strong>fail</strong> to create any further orders.</p> <p>It also allows for retrieving by <code>external_id</code> instead of <code>id</code> only.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">payment</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">funding_source_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the funding source that will be used to pay for the order. Use <code>balance</code> to use your Tremendous&#39;s balance.</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">reward</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>A single reward, sent to a recipient. A reward is always part of an order.</p> <p>Either <code>products</code> or <code>campaign_id</code> must be specified.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the reward</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">order_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the order this reward is part of.</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">created_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Date the reward was created</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">expires_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date-time</span></td><td><p>Expiration date of the reward. If null, the reward does not expire.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">campaign_id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.</p> </td></tr> <tr class=\"property-conditional-hint-request-only\"><td><div class=\"property-name\"> <code class=\"property-name\">products</code> </div> </td><td><span class=\"property-type\">array</span> <span class=\"property-format\">string</span></td><td><p>List of IDs of product (different gift cards, charity, etc.) that will be available to the recipient to choose from.</p> <p>Providing a <code>products</code> array will override the products made available by the campaign specified using the <code>campaign_id</code> property unless the <code>products</code> array is empty. It will <em>not</em> override other campaign attributes, like the message and customization of the look and feel.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">object</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">denomination</code> </div> </td><td><span class=\"property-type\">number</span> <span class=\"property-format\">double</span></td><td><p>Amount of the reward</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">currency_code</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Currency of the reward</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">recipient</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details of the recipient of the reward</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Name of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">email</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Email address of the recipient</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">phone</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Phone number of the recipient. For non-US phone numbers, specify the country code (prefixed with +).</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">deliver_at</code> </div> </td><td><span class=\"property-type\">string</span> <span class=\"property-format\">date</span></td><td><p>Timestamp of reward delivery within the next year. Note that if date-time is provided, the time values will be ignored.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">custom_fields</code> </div> </td><td><span class=\"property-type\">array</span></td><td></td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show array item type</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">id</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Tremendous ID of the custom field</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">value</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Value of the custom field</p> </td></tr> <tr class=\"property-conditional-hint-response-only\"><td><div class=\"property-name\"> <code class=\"property-name\">label</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Label of the custom field</p> </td></tr> </tbody> </table> </tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">language</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>Set this to translate the redemption experience for this reward. Pass a 2-letter <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes\">ISO-639-1 code</a> for the desired language. Defaults to <code>en</code>.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">delivery</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Details on how the reward is delivered to the recipient.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">method</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>How to deliver the reward to the recipient.</p> <table> <thead> <tr> <th>Delivery Method</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>EMAIL</code></td> <td>Deliver the reward to the recipient by email</td> </tr> <tr> <td><code>LINK</code></td> <td> <p>Deliver the reward to the recipient via a link.</p> <p>The link can be retrieved on a successfully ordered reward via the <code>/rewards</code> or <code>/rewards/{id}</code> endpoint. That link must then be delivered to the recipient out-of-band.</p> </td> </tr> <tr> <td><code>PHONE</code></td> <td>Deliver the reward to the recipient by SMS</td> </tr> </tbody> </table> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">meta</code> </div> </td><td><span class=\"property-type\">object</span></td><td><p>Customizable reward delivery metadata, taking precedence over the related campaign settings.</p> </td></tr> <tr> <td colspan=\"3\"> <details> <summary>Show object properties</summary> <table> <thead> <tr> <th>Property</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody class=\"object-schema-table-body\"> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">sender_name</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The &quot;sender name&quot; used in the delivery. If it&#39;s an email reward, &quot;via Tremendous&quot; will be appended to the value. Please note that you cannot customize the sender email.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">subject_line</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The subject line used in the delivery.</p> </td></tr> <tr class=\"\"><td><div class=\"property-name\"> <code class=\"property-name\">message</code> </div> </td><td><span class=\"property-type\">string</span></td><td><p>The content of the message of the reward, shown in the email / SMS and on the landing page.</p> </td></tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </tr> </tbody> </table> </div> ### Funding sources There are different ways to pay for gift cards and rewards on Tremendous. Every payment mechanism is called a \"funding source\". You can retrieve a list of all available funding sources by using the [Funding sources API endpoint](https://developers.tremendous.com/reference/list-funding-sources). The Tremendous API sandbox environment comes with a single funding source that allows you to spend up to $5,000 in *fake money* to test the API. [Learn more about the sandbox environment](https://developers.tremendous.com/docs/sandbox-environment). The HTTP status code `200` on the response will be used to indicate success. After processing successfully the reward gets queued to be delivered to it's recipient (for delivery method `EMAIL` and `PHONE`). Delivery will happen asynchronously, after the response has been sent. ### Idempotence Requests issued with the same `external_id` are idempotent. Submitting an order with an already existing `external_id` will not create a new order. If the payload is the same as a previously issued order, our API will return a `201` response code, along with a representation of the already-existing order in the response body. If the `external_id` used is for an order with different parameters (e.g. amount, recipient), our API will return a `409` response code, indicating a conflicting resource.
|
|
770
770
|
# @param create_order_request [CreateOrderRequest] Order to create
|
|
771
771
|
# @param [Hash] opts the optional parameters
|
|
772
772
|
# @return [Array<(CreateOrder200Response, Integer, Hash)>] CreateOrder200Response data, response status code and response headers
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
attr_accessor :value
|
|
29
32
|
|
|
30
33
|
attr_accessor :recipient
|
|
@@ -42,6 +45,7 @@ module Tremendous
|
|
|
42
45
|
:'id' => :'id',
|
|
43
46
|
:'order_id' => :'order_id',
|
|
44
47
|
:'created_at' => :'created_at',
|
|
48
|
+
:'expires_at' => :'expires_at',
|
|
45
49
|
:'value' => :'value',
|
|
46
50
|
:'recipient' => :'recipient',
|
|
47
51
|
:'deliver_at' => :'deliver_at',
|
|
@@ -66,6 +70,7 @@ module Tremendous
|
|
|
66
70
|
:'id' => :'String',
|
|
67
71
|
:'order_id' => :'String',
|
|
68
72
|
:'created_at' => :'Time',
|
|
73
|
+
:'expires_at' => :'Time',
|
|
69
74
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
70
75
|
:'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
|
|
71
76
|
:'deliver_at' => :'Date',
|
|
@@ -77,6 +82,7 @@ module Tremendous
|
|
|
77
82
|
# List of attributes with nullable: true
|
|
78
83
|
def self.openapi_nullable
|
|
79
84
|
Set.new([
|
|
85
|
+
:'expires_at',
|
|
80
86
|
])
|
|
81
87
|
end
|
|
82
88
|
|
|
@@ -108,6 +114,10 @@ module Tremendous
|
|
|
108
114
|
self.created_at = attributes[:'created_at']
|
|
109
115
|
end
|
|
110
116
|
|
|
117
|
+
if attributes.key?(:'expires_at')
|
|
118
|
+
self.expires_at = attributes[:'expires_at']
|
|
119
|
+
end
|
|
120
|
+
|
|
111
121
|
if attributes.key?(:'value')
|
|
112
122
|
self.value = attributes[:'value']
|
|
113
123
|
end
|
|
@@ -196,6 +206,7 @@ module Tremendous
|
|
|
196
206
|
id == o.id &&
|
|
197
207
|
order_id == o.order_id &&
|
|
198
208
|
created_at == o.created_at &&
|
|
209
|
+
expires_at == o.expires_at &&
|
|
199
210
|
value == o.value &&
|
|
200
211
|
recipient == o.recipient &&
|
|
201
212
|
deliver_at == o.deliver_at &&
|
|
@@ -212,7 +223,7 @@ module Tremendous
|
|
|
212
223
|
# Calculates hash code according to all attributes.
|
|
213
224
|
# @return [Integer] Hash code
|
|
214
225
|
def hash
|
|
215
|
-
[id, order_id, created_at, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
226
|
+
[id, order_id, created_at, expires_at, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
216
227
|
end
|
|
217
228
|
|
|
218
229
|
# Builds the object from hash
|
|
@@ -27,7 +27,6 @@ module Tremendous
|
|
|
27
27
|
AZN = "AZN".freeze
|
|
28
28
|
BAM = "BAM".freeze
|
|
29
29
|
BDT = "BDT".freeze
|
|
30
|
-
BGN = "BGN".freeze
|
|
31
30
|
BHD = "BHD".freeze
|
|
32
31
|
BIF = "BIF".freeze
|
|
33
32
|
BND = "BND".freeze
|
|
@@ -133,7 +132,7 @@ module Tremendous
|
|
|
133
132
|
ZMK = "ZMK".freeze
|
|
134
133
|
|
|
135
134
|
def self.all_vars
|
|
136
|
-
@all_vars ||= [USD, CAD, EUR, AED, AFN, ALL, AMD, ARS, AUD, AZN, BAM, BDT,
|
|
135
|
+
@all_vars ||= [USD, CAD, EUR, AED, AFN, ALL, AMD, ARS, AUD, AZN, BAM, BDT, BHD, BIF, BND, BOB, BRL, BWP, BYR, BZD, CDF, CHF, CLP, CNY, COP, CRC, CVE, CZK, DJF, DKK, DOP, DZD, EEK, EGP, ERN, ETB, GBP, GEL, GHS, GNF, GTQ, HKD, HNL, HRK, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KHR, KRW, KWD, KZT, LBP, LKR, LTL, LVL, MAD, MDL, MGA, MKD, MMK, MOP, MUR, MXN, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SDG, SEK, SGD, SOS, SYP, THB, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, UYU, UZS, VEF, VND, XAF, XOF, YER, ZAR, ZMK].freeze
|
|
137
136
|
end
|
|
138
137
|
|
|
139
138
|
# Builds the enum from string
|
|
@@ -21,7 +21,7 @@ module Tremendous
|
|
|
21
21
|
# Name of the product
|
|
22
22
|
attr_accessor :name
|
|
23
23
|
|
|
24
|
-
# Detailed description of the product.
|
|
24
|
+
# Detailed description of the product.
|
|
25
25
|
attr_accessor :description
|
|
26
26
|
|
|
27
27
|
# The category of the product <table> <thead> <tr> <th>Category</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ach</code></td> <td>Bank transfer to the recipient</td> </tr> <tr> <td><code>charity</code></td> <td>Donations to a charity</td> </tr> <tr> <td><code>instant_debit_transfer</code></td> <td>Instant debit transfer to the recipient</td> </tr> <tr> <td><code>merchant_card</code></td> <td>A gift card for a certain merchant (e.g. Amazon)</td> </tr> <tr> <td><code>paypal</code></td> <td>Payout via PayPal</td> </tr> <tr> <td><code>venmo</code></td> <td>Payout via Venmo</td> </tr> <tr> <td><code>visa_card</code></td> <td>Payout in form of a Visa debit card</td> </tr> <tr> <td><code>cash_app</code></td> <td>Payout via Cash App</td> </tr> </tbody> </table>
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
attr_accessor :value
|
|
29
32
|
|
|
30
33
|
attr_accessor :recipient
|
|
@@ -42,6 +45,7 @@ module Tremendous
|
|
|
42
45
|
:'id' => :'id',
|
|
43
46
|
:'order_id' => :'order_id',
|
|
44
47
|
:'created_at' => :'created_at',
|
|
48
|
+
:'expires_at' => :'expires_at',
|
|
45
49
|
:'value' => :'value',
|
|
46
50
|
:'recipient' => :'recipient',
|
|
47
51
|
:'deliver_at' => :'deliver_at',
|
|
@@ -66,6 +70,7 @@ module Tremendous
|
|
|
66
70
|
:'id' => :'String',
|
|
67
71
|
:'order_id' => :'String',
|
|
68
72
|
:'created_at' => :'Time',
|
|
73
|
+
:'expires_at' => :'Time',
|
|
69
74
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
70
75
|
:'recipient' => :'ListRewards200ResponseRewardsInnerRecipient',
|
|
71
76
|
:'deliver_at' => :'Date',
|
|
@@ -77,6 +82,7 @@ module Tremendous
|
|
|
77
82
|
# List of attributes with nullable: true
|
|
78
83
|
def self.openapi_nullable
|
|
79
84
|
Set.new([
|
|
85
|
+
:'expires_at',
|
|
80
86
|
])
|
|
81
87
|
end
|
|
82
88
|
|
|
@@ -108,6 +114,10 @@ module Tremendous
|
|
|
108
114
|
self.created_at = attributes[:'created_at']
|
|
109
115
|
end
|
|
110
116
|
|
|
117
|
+
if attributes.key?(:'expires_at')
|
|
118
|
+
self.expires_at = attributes[:'expires_at']
|
|
119
|
+
end
|
|
120
|
+
|
|
111
121
|
if attributes.key?(:'value')
|
|
112
122
|
self.value = attributes[:'value']
|
|
113
123
|
end
|
|
@@ -196,6 +206,7 @@ module Tremendous
|
|
|
196
206
|
id == o.id &&
|
|
197
207
|
order_id == o.order_id &&
|
|
198
208
|
created_at == o.created_at &&
|
|
209
|
+
expires_at == o.expires_at &&
|
|
199
210
|
value == o.value &&
|
|
200
211
|
recipient == o.recipient &&
|
|
201
212
|
deliver_at == o.deliver_at &&
|
|
@@ -212,7 +223,7 @@ module Tremendous
|
|
|
212
223
|
# Calculates hash code according to all attributes.
|
|
213
224
|
# @return [Integer] Hash code
|
|
214
225
|
def hash
|
|
215
|
-
[id, order_id, created_at, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
226
|
+
[id, order_id, created_at, expires_at, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
216
227
|
end
|
|
217
228
|
|
|
218
229
|
# Builds the object from hash
|
|
@@ -121,7 +121,7 @@ module Tremendous
|
|
|
121
121
|
def valid?
|
|
122
122
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
123
|
return false if @denomination.nil?
|
|
124
|
-
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "
|
|
124
|
+
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "BHD", "BIF", "BND", "BOB", "BRL", "BWP", "BYR", "BZD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EEK", "EGP", "ERN", "ETB", "GBP", "GEL", "GHS", "GNF", "GTQ", "HKD", "HNL", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KHR", "KRW", "KWD", "KZT", "LBP", "LKR", "LTL", "LVL", "MAD", "MDL", "MGA", "MKD", "MMK", "MOP", "MUR", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SDG", "SEK", "SGD", "SOS", "SYP", "THB", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VND", "XAF", "XOF", "YER", "ZAR", "ZMK"])
|
|
125
125
|
return false unless currency_code_validator.valid?(@currency_code)
|
|
126
126
|
true
|
|
127
127
|
end
|
|
@@ -139,7 +139,7 @@ module Tremendous
|
|
|
139
139
|
# Custom attribute writer method checking allowed values (enum).
|
|
140
140
|
# @param [Object] currency_code Object to be assigned
|
|
141
141
|
def currency_code=(currency_code)
|
|
142
|
-
validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "
|
|
142
|
+
validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "BHD", "BIF", "BND", "BOB", "BRL", "BWP", "BYR", "BZD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EEK", "EGP", "ERN", "ETB", "GBP", "GEL", "GHS", "GNF", "GTQ", "HKD", "HNL", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KHR", "KRW", "KWD", "KZT", "LBP", "LKR", "LTL", "LVL", "MAD", "MDL", "MGA", "MKD", "MMK", "MOP", "MUR", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SDG", "SEK", "SGD", "SOS", "SYP", "THB", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VND", "XAF", "XOF", "YER", "ZAR", "ZMK"])
|
|
143
143
|
unless validator.valid?(currency_code)
|
|
144
144
|
fail ArgumentError, "invalid value for \"currency_code\", must be one of #{validator.allowable_values}."
|
|
145
145
|
end
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -48,6 +51,7 @@ module Tremendous
|
|
|
48
51
|
:'id' => :'id',
|
|
49
52
|
:'order_id' => :'order_id',
|
|
50
53
|
:'created_at' => :'created_at',
|
|
54
|
+
:'expires_at' => :'expires_at',
|
|
51
55
|
:'campaign_id' => :'campaign_id',
|
|
52
56
|
:'products' => :'products',
|
|
53
57
|
:'value' => :'value',
|
|
@@ -74,6 +78,7 @@ module Tremendous
|
|
|
74
78
|
:'id' => :'String',
|
|
75
79
|
:'order_id' => :'String',
|
|
76
80
|
:'created_at' => :'Time',
|
|
81
|
+
:'expires_at' => :'Time',
|
|
77
82
|
:'campaign_id' => :'String',
|
|
78
83
|
:'products' => :'Array<String>',
|
|
79
84
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -87,6 +92,7 @@ module Tremendous
|
|
|
87
92
|
# List of attributes with nullable: true
|
|
88
93
|
def self.openapi_nullable
|
|
89
94
|
Set.new([
|
|
95
|
+
:'expires_at',
|
|
90
96
|
:'campaign_id',
|
|
91
97
|
])
|
|
92
98
|
end
|
|
@@ -119,6 +125,10 @@ module Tremendous
|
|
|
119
125
|
self.created_at = attributes[:'created_at']
|
|
120
126
|
end
|
|
121
127
|
|
|
128
|
+
if attributes.key?(:'expires_at')
|
|
129
|
+
self.expires_at = attributes[:'expires_at']
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
if attributes.key?(:'campaign_id')
|
|
123
133
|
self.campaign_id = attributes[:'campaign_id']
|
|
124
134
|
end
|
|
@@ -253,6 +263,7 @@ module Tremendous
|
|
|
253
263
|
id == o.id &&
|
|
254
264
|
order_id == o.order_id &&
|
|
255
265
|
created_at == o.created_at &&
|
|
266
|
+
expires_at == o.expires_at &&
|
|
256
267
|
campaign_id == o.campaign_id &&
|
|
257
268
|
products == o.products &&
|
|
258
269
|
value == o.value &&
|
|
@@ -271,7 +282,7 @@ module Tremendous
|
|
|
271
282
|
# Calculates hash code according to all attributes.
|
|
272
283
|
# @return [Integer] Hash code
|
|
273
284
|
def hash
|
|
274
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
285
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
275
286
|
end
|
|
276
287
|
|
|
277
288
|
# Builds the object from hash
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -48,6 +51,7 @@ module Tremendous
|
|
|
48
51
|
:'id' => :'id',
|
|
49
52
|
:'order_id' => :'order_id',
|
|
50
53
|
:'created_at' => :'created_at',
|
|
54
|
+
:'expires_at' => :'expires_at',
|
|
51
55
|
:'campaign_id' => :'campaign_id',
|
|
52
56
|
:'products' => :'products',
|
|
53
57
|
:'value' => :'value',
|
|
@@ -74,6 +78,7 @@ module Tremendous
|
|
|
74
78
|
:'id' => :'String',
|
|
75
79
|
:'order_id' => :'String',
|
|
76
80
|
:'created_at' => :'Time',
|
|
81
|
+
:'expires_at' => :'Time',
|
|
77
82
|
:'campaign_id' => :'String',
|
|
78
83
|
:'products' => :'Array<String>',
|
|
79
84
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -87,6 +92,7 @@ module Tremendous
|
|
|
87
92
|
# List of attributes with nullable: true
|
|
88
93
|
def self.openapi_nullable
|
|
89
94
|
Set.new([
|
|
95
|
+
:'expires_at',
|
|
90
96
|
:'campaign_id',
|
|
91
97
|
])
|
|
92
98
|
end
|
|
@@ -119,6 +125,10 @@ module Tremendous
|
|
|
119
125
|
self.created_at = attributes[:'created_at']
|
|
120
126
|
end
|
|
121
127
|
|
|
128
|
+
if attributes.key?(:'expires_at')
|
|
129
|
+
self.expires_at = attributes[:'expires_at']
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
if attributes.key?(:'campaign_id')
|
|
123
133
|
self.campaign_id = attributes[:'campaign_id']
|
|
124
134
|
end
|
|
@@ -253,6 +263,7 @@ module Tremendous
|
|
|
253
263
|
id == o.id &&
|
|
254
264
|
order_id == o.order_id &&
|
|
255
265
|
created_at == o.created_at &&
|
|
266
|
+
expires_at == o.expires_at &&
|
|
256
267
|
campaign_id == o.campaign_id &&
|
|
257
268
|
products == o.products &&
|
|
258
269
|
value == o.value &&
|
|
@@ -271,7 +282,7 @@ module Tremendous
|
|
|
271
282
|
# Calculates hash code according to all attributes.
|
|
272
283
|
# @return [Integer] Hash code
|
|
273
284
|
def hash
|
|
274
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
285
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
275
286
|
end
|
|
276
287
|
|
|
277
288
|
# Builds the object from hash
|
|
@@ -21,7 +21,7 @@ module Tremendous
|
|
|
21
21
|
# Name of the product
|
|
22
22
|
attr_accessor :name
|
|
23
23
|
|
|
24
|
-
# Detailed description of the product.
|
|
24
|
+
# Detailed description of the product.
|
|
25
25
|
attr_accessor :description
|
|
26
26
|
|
|
27
27
|
# The category of the product <table> <thead> <tr> <th>Category</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code>ach</code></td> <td>Bank transfer to the recipient</td> </tr> <tr> <td><code>charity</code></td> <td>Donations to a charity</td> </tr> <tr> <td><code>instant_debit_transfer</code></td> <td>Instant debit transfer to the recipient</td> </tr> <tr> <td><code>merchant_card</code></td> <td>A gift card for a certain merchant (e.g. Amazon)</td> </tr> <tr> <td><code>paypal</code></td> <td>Payout via PayPal</td> </tr> <tr> <td><code>venmo</code></td> <td>Payout via Venmo</td> </tr> <tr> <td><code>visa_card</code></td> <td>Payout in form of a Visa debit card</td> </tr> <tr> <td><code>cash_app</code></td> <td>Payout via Cash App</td> </tr> </tbody> </table>
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -48,6 +51,7 @@ module Tremendous
|
|
|
48
51
|
:'id' => :'id',
|
|
49
52
|
:'order_id' => :'order_id',
|
|
50
53
|
:'created_at' => :'created_at',
|
|
54
|
+
:'expires_at' => :'expires_at',
|
|
51
55
|
:'campaign_id' => :'campaign_id',
|
|
52
56
|
:'products' => :'products',
|
|
53
57
|
:'value' => :'value',
|
|
@@ -74,6 +78,7 @@ module Tremendous
|
|
|
74
78
|
:'id' => :'String',
|
|
75
79
|
:'order_id' => :'String',
|
|
76
80
|
:'created_at' => :'Time',
|
|
81
|
+
:'expires_at' => :'Time',
|
|
77
82
|
:'campaign_id' => :'String',
|
|
78
83
|
:'products' => :'Array<String>',
|
|
79
84
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -87,6 +92,7 @@ module Tremendous
|
|
|
87
92
|
# List of attributes with nullable: true
|
|
88
93
|
def self.openapi_nullable
|
|
89
94
|
Set.new([
|
|
95
|
+
:'expires_at',
|
|
90
96
|
:'campaign_id',
|
|
91
97
|
])
|
|
92
98
|
end
|
|
@@ -119,6 +125,10 @@ module Tremendous
|
|
|
119
125
|
self.created_at = attributes[:'created_at']
|
|
120
126
|
end
|
|
121
127
|
|
|
128
|
+
if attributes.key?(:'expires_at')
|
|
129
|
+
self.expires_at = attributes[:'expires_at']
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
if attributes.key?(:'campaign_id')
|
|
123
133
|
self.campaign_id = attributes[:'campaign_id']
|
|
124
134
|
end
|
|
@@ -253,6 +263,7 @@ module Tremendous
|
|
|
253
263
|
id == o.id &&
|
|
254
264
|
order_id == o.order_id &&
|
|
255
265
|
created_at == o.created_at &&
|
|
266
|
+
expires_at == o.expires_at &&
|
|
256
267
|
campaign_id == o.campaign_id &&
|
|
257
268
|
products == o.products &&
|
|
258
269
|
value == o.value &&
|
|
@@ -271,7 +282,7 @@ module Tremendous
|
|
|
271
282
|
# Calculates hash code according to all attributes.
|
|
272
283
|
# @return [Integer] Hash code
|
|
273
284
|
def hash
|
|
274
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
285
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
275
286
|
end
|
|
276
287
|
|
|
277
288
|
# Builds the object from hash
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -46,6 +49,7 @@ module Tremendous
|
|
|
46
49
|
:'id' => :'id',
|
|
47
50
|
:'order_id' => :'order_id',
|
|
48
51
|
:'created_at' => :'created_at',
|
|
52
|
+
:'expires_at' => :'expires_at',
|
|
49
53
|
:'campaign_id' => :'campaign_id',
|
|
50
54
|
:'products' => :'products',
|
|
51
55
|
:'value' => :'value',
|
|
@@ -71,6 +75,7 @@ module Tremendous
|
|
|
71
75
|
:'id' => :'String',
|
|
72
76
|
:'order_id' => :'String',
|
|
73
77
|
:'created_at' => :'Time',
|
|
78
|
+
:'expires_at' => :'Time',
|
|
74
79
|
:'campaign_id' => :'String',
|
|
75
80
|
:'products' => :'Array<String>',
|
|
76
81
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -83,6 +88,7 @@ module Tremendous
|
|
|
83
88
|
# List of attributes with nullable: true
|
|
84
89
|
def self.openapi_nullable
|
|
85
90
|
Set.new([
|
|
91
|
+
:'expires_at',
|
|
86
92
|
:'campaign_id',
|
|
87
93
|
])
|
|
88
94
|
end
|
|
@@ -115,6 +121,10 @@ module Tremendous
|
|
|
115
121
|
self.created_at = attributes[:'created_at']
|
|
116
122
|
end
|
|
117
123
|
|
|
124
|
+
if attributes.key?(:'expires_at')
|
|
125
|
+
self.expires_at = attributes[:'expires_at']
|
|
126
|
+
end
|
|
127
|
+
|
|
118
128
|
if attributes.key?(:'campaign_id')
|
|
119
129
|
self.campaign_id = attributes[:'campaign_id']
|
|
120
130
|
end
|
|
@@ -245,6 +255,7 @@ module Tremendous
|
|
|
245
255
|
id == o.id &&
|
|
246
256
|
order_id == o.order_id &&
|
|
247
257
|
created_at == o.created_at &&
|
|
258
|
+
expires_at == o.expires_at &&
|
|
248
259
|
campaign_id == o.campaign_id &&
|
|
249
260
|
products == o.products &&
|
|
250
261
|
value == o.value &&
|
|
@@ -262,7 +273,7 @@ module Tremendous
|
|
|
262
273
|
# Calculates hash code according to all attributes.
|
|
263
274
|
# @return [Integer] Hash code
|
|
264
275
|
def hash
|
|
265
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields].hash
|
|
276
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields].hash
|
|
266
277
|
end
|
|
267
278
|
|
|
268
279
|
# Builds the object from hash
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -51,6 +54,7 @@ module Tremendous
|
|
|
51
54
|
:'id' => :'id',
|
|
52
55
|
:'order_id' => :'order_id',
|
|
53
56
|
:'created_at' => :'created_at',
|
|
57
|
+
:'expires_at' => :'expires_at',
|
|
54
58
|
:'campaign_id' => :'campaign_id',
|
|
55
59
|
:'products' => :'products',
|
|
56
60
|
:'value' => :'value',
|
|
@@ -78,6 +82,7 @@ module Tremendous
|
|
|
78
82
|
:'id' => :'String',
|
|
79
83
|
:'order_id' => :'String',
|
|
80
84
|
:'created_at' => :'Time',
|
|
85
|
+
:'expires_at' => :'Time',
|
|
81
86
|
:'campaign_id' => :'String',
|
|
82
87
|
:'products' => :'Array<String>',
|
|
83
88
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -92,6 +97,7 @@ module Tremendous
|
|
|
92
97
|
# List of attributes with nullable: true
|
|
93
98
|
def self.openapi_nullable
|
|
94
99
|
Set.new([
|
|
100
|
+
:'expires_at',
|
|
95
101
|
:'campaign_id',
|
|
96
102
|
])
|
|
97
103
|
end
|
|
@@ -124,6 +130,10 @@ module Tremendous
|
|
|
124
130
|
self.created_at = attributes[:'created_at']
|
|
125
131
|
end
|
|
126
132
|
|
|
133
|
+
if attributes.key?(:'expires_at')
|
|
134
|
+
self.expires_at = attributes[:'expires_at']
|
|
135
|
+
end
|
|
136
|
+
|
|
127
137
|
if attributes.key?(:'campaign_id')
|
|
128
138
|
self.campaign_id = attributes[:'campaign_id']
|
|
129
139
|
end
|
|
@@ -262,6 +272,7 @@ module Tremendous
|
|
|
262
272
|
id == o.id &&
|
|
263
273
|
order_id == o.order_id &&
|
|
264
274
|
created_at == o.created_at &&
|
|
275
|
+
expires_at == o.expires_at &&
|
|
265
276
|
campaign_id == o.campaign_id &&
|
|
266
277
|
products == o.products &&
|
|
267
278
|
value == o.value &&
|
|
@@ -281,7 +292,7 @@ module Tremendous
|
|
|
281
292
|
# Calculates hash code according to all attributes.
|
|
282
293
|
# @return [Integer] Hash code
|
|
283
294
|
def hash
|
|
284
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, language, delivery].hash
|
|
295
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, language, delivery].hash
|
|
285
296
|
end
|
|
286
297
|
|
|
287
298
|
# Builds the object from hash
|
|
@@ -121,7 +121,7 @@ module Tremendous
|
|
|
121
121
|
def valid?
|
|
122
122
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
123
|
return false if @denomination.nil?
|
|
124
|
-
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "
|
|
124
|
+
currency_code_validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "BHD", "BIF", "BND", "BOB", "BRL", "BWP", "BYR", "BZD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EEK", "EGP", "ERN", "ETB", "GBP", "GEL", "GHS", "GNF", "GTQ", "HKD", "HNL", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KHR", "KRW", "KWD", "KZT", "LBP", "LKR", "LTL", "LVL", "MAD", "MDL", "MGA", "MKD", "MMK", "MOP", "MUR", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SDG", "SEK", "SGD", "SOS", "SYP", "THB", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VND", "XAF", "XOF", "YER", "ZAR", "ZMK"])
|
|
125
125
|
return false unless currency_code_validator.valid?(@currency_code)
|
|
126
126
|
true
|
|
127
127
|
end
|
|
@@ -139,7 +139,7 @@ module Tremendous
|
|
|
139
139
|
# Custom attribute writer method checking allowed values (enum).
|
|
140
140
|
# @param [Object] currency_code Object to be assigned
|
|
141
141
|
def currency_code=(currency_code)
|
|
142
|
-
validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "
|
|
142
|
+
validator = EnumAttributeValidator.new('String', ["USD", "CAD", "EUR", "AED", "AFN", "ALL", "AMD", "ARS", "AUD", "AZN", "BAM", "BDT", "BHD", "BIF", "BND", "BOB", "BRL", "BWP", "BYR", "BZD", "CDF", "CHF", "CLP", "CNY", "COP", "CRC", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EEK", "EGP", "ERN", "ETB", "GBP", "GEL", "GHS", "GNF", "GTQ", "HKD", "HNL", "HRK", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KHR", "KRW", "KWD", "KZT", "LBP", "LKR", "LTL", "LVL", "MAD", "MDL", "MGA", "MKD", "MMK", "MOP", "MUR", "MXN", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SDG", "SEK", "SGD", "SOS", "SYP", "THB", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "UYU", "UZS", "VEF", "VND", "XAF", "XOF", "YER", "ZAR", "ZMK"])
|
|
143
143
|
unless validator.valid?(currency_code)
|
|
144
144
|
fail ArgumentError, "invalid value for \"currency_code\", must be one of #{validator.allowable_values}."
|
|
145
145
|
end
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -48,6 +51,7 @@ module Tremendous
|
|
|
48
51
|
:'id' => :'id',
|
|
49
52
|
:'order_id' => :'order_id',
|
|
50
53
|
:'created_at' => :'created_at',
|
|
54
|
+
:'expires_at' => :'expires_at',
|
|
51
55
|
:'campaign_id' => :'campaign_id',
|
|
52
56
|
:'products' => :'products',
|
|
53
57
|
:'value' => :'value',
|
|
@@ -74,6 +78,7 @@ module Tremendous
|
|
|
74
78
|
:'id' => :'String',
|
|
75
79
|
:'order_id' => :'String',
|
|
76
80
|
:'created_at' => :'Time',
|
|
81
|
+
:'expires_at' => :'Time',
|
|
77
82
|
:'campaign_id' => :'String',
|
|
78
83
|
:'products' => :'Array<String>',
|
|
79
84
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -87,6 +92,7 @@ module Tremendous
|
|
|
87
92
|
# List of attributes with nullable: true
|
|
88
93
|
def self.openapi_nullable
|
|
89
94
|
Set.new([
|
|
95
|
+
:'expires_at',
|
|
90
96
|
:'campaign_id',
|
|
91
97
|
])
|
|
92
98
|
end
|
|
@@ -119,6 +125,10 @@ module Tremendous
|
|
|
119
125
|
self.created_at = attributes[:'created_at']
|
|
120
126
|
end
|
|
121
127
|
|
|
128
|
+
if attributes.key?(:'expires_at')
|
|
129
|
+
self.expires_at = attributes[:'expires_at']
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
if attributes.key?(:'campaign_id')
|
|
123
133
|
self.campaign_id = attributes[:'campaign_id']
|
|
124
134
|
end
|
|
@@ -253,6 +263,7 @@ module Tremendous
|
|
|
253
263
|
id == o.id &&
|
|
254
264
|
order_id == o.order_id &&
|
|
255
265
|
created_at == o.created_at &&
|
|
266
|
+
expires_at == o.expires_at &&
|
|
256
267
|
campaign_id == o.campaign_id &&
|
|
257
268
|
products == o.products &&
|
|
258
269
|
value == o.value &&
|
|
@@ -271,7 +282,7 @@ module Tremendous
|
|
|
271
282
|
# Calculates hash code according to all attributes.
|
|
272
283
|
# @return [Integer] Hash code
|
|
273
284
|
def hash
|
|
274
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
285
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
275
286
|
end
|
|
276
287
|
|
|
277
288
|
# Builds the object from hash
|
|
@@ -25,6 +25,9 @@ module Tremendous
|
|
|
25
25
|
# Date the reward was created
|
|
26
26
|
attr_accessor :created_at
|
|
27
27
|
|
|
28
|
+
# Expiration date of the reward. If null, the reward does not expire.
|
|
29
|
+
attr_accessor :expires_at
|
|
30
|
+
|
|
28
31
|
# ID of the campaign in your account, that defines the available products (different gift cards, charity, etc.) that the recipient can choose from.
|
|
29
32
|
attr_accessor :campaign_id
|
|
30
33
|
|
|
@@ -48,6 +51,7 @@ module Tremendous
|
|
|
48
51
|
:'id' => :'id',
|
|
49
52
|
:'order_id' => :'order_id',
|
|
50
53
|
:'created_at' => :'created_at',
|
|
54
|
+
:'expires_at' => :'expires_at',
|
|
51
55
|
:'campaign_id' => :'campaign_id',
|
|
52
56
|
:'products' => :'products',
|
|
53
57
|
:'value' => :'value',
|
|
@@ -74,6 +78,7 @@ module Tremendous
|
|
|
74
78
|
:'id' => :'String',
|
|
75
79
|
:'order_id' => :'String',
|
|
76
80
|
:'created_at' => :'Time',
|
|
81
|
+
:'expires_at' => :'Time',
|
|
77
82
|
:'campaign_id' => :'String',
|
|
78
83
|
:'products' => :'Array<String>',
|
|
79
84
|
:'value' => :'ListRewards200ResponseRewardsInnerValue',
|
|
@@ -87,6 +92,7 @@ module Tremendous
|
|
|
87
92
|
# List of attributes with nullable: true
|
|
88
93
|
def self.openapi_nullable
|
|
89
94
|
Set.new([
|
|
95
|
+
:'expires_at',
|
|
90
96
|
:'campaign_id',
|
|
91
97
|
])
|
|
92
98
|
end
|
|
@@ -119,6 +125,10 @@ module Tremendous
|
|
|
119
125
|
self.created_at = attributes[:'created_at']
|
|
120
126
|
end
|
|
121
127
|
|
|
128
|
+
if attributes.key?(:'expires_at')
|
|
129
|
+
self.expires_at = attributes[:'expires_at']
|
|
130
|
+
end
|
|
131
|
+
|
|
122
132
|
if attributes.key?(:'campaign_id')
|
|
123
133
|
self.campaign_id = attributes[:'campaign_id']
|
|
124
134
|
end
|
|
@@ -253,6 +263,7 @@ module Tremendous
|
|
|
253
263
|
id == o.id &&
|
|
254
264
|
order_id == o.order_id &&
|
|
255
265
|
created_at == o.created_at &&
|
|
266
|
+
expires_at == o.expires_at &&
|
|
256
267
|
campaign_id == o.campaign_id &&
|
|
257
268
|
products == o.products &&
|
|
258
269
|
value == o.value &&
|
|
@@ -271,7 +282,7 @@ module Tremendous
|
|
|
271
282
|
# Calculates hash code according to all attributes.
|
|
272
283
|
# @return [Integer] Hash code
|
|
273
284
|
def hash
|
|
274
|
-
[id, order_id, created_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
285
|
+
[id, order_id, created_at, expires_at, campaign_id, products, value, recipient, deliver_at, custom_fields, delivery].hash
|
|
275
286
|
end
|
|
276
287
|
|
|
277
288
|
# Builds the object from hash
|
data/lib/tremendous/version.rb
CHANGED