helloextend_api_client 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +151 -0
  4. data/Rakefile +10 -0
  5. data/docs/Address.md +27 -0
  6. data/docs/Amount.md +19 -0
  7. data/docs/Contract.md +39 -0
  8. data/docs/ContractPlan.md +19 -0
  9. data/docs/ContractProduct.md +27 -0
  10. data/docs/ContractsApi.md +180 -0
  11. data/docs/Customer.md +23 -0
  12. data/docs/Error.md +19 -0
  13. data/docs/Invoice.md +27 -0
  14. data/docs/InvoiceDetails.md +19 -0
  15. data/docs/InvoiceDiscount.md +21 -0
  16. data/docs/InvoiceItems.md +31 -0
  17. data/docs/InvoiceMetadata.md +21 -0
  18. data/docs/InvoiceMetadataProduct.md +21 -0
  19. data/docs/InvoicePayee.md +23 -0
  20. data/docs/InvoicePayer.md +23 -0
  21. data/docs/Offer.md +17 -0
  22. data/docs/OfferPlan.md +23 -0
  23. data/docs/OfferPlanContract.md +27 -0
  24. data/docs/OffersApi.md +58 -0
  25. data/docs/Plan.md +21 -0
  26. data/docs/PlanDetails.md +21 -0
  27. data/docs/PlanPrices.md +21 -0
  28. data/docs/PlansApi.md +61 -0
  29. data/docs/PlansList.md +17 -0
  30. data/docs/Product.md +45 -0
  31. data/docs/ProductIdentifiers.md +25 -0
  32. data/docs/ProductMfrWarranty.md +21 -0
  33. data/docs/ProductsApi.md +241 -0
  34. data/git_push.sh +58 -0
  35. data/helloextend_api_client.gemspec +39 -0
  36. data/lib/helloextend_api_client.rb +68 -0
  37. data/lib/helloextend_api_client/api/contracts_api.rb +229 -0
  38. data/lib/helloextend_api_client/api/offers_api.rb +90 -0
  39. data/lib/helloextend_api_client/api/plans_api.rb +82 -0
  40. data/lib/helloextend_api_client/api/products_api.rb +298 -0
  41. data/lib/helloextend_api_client/api_client.rb +388 -0
  42. data/lib/helloextend_api_client/api_error.rb +57 -0
  43. data/lib/helloextend_api_client/configuration.rb +248 -0
  44. data/lib/helloextend_api_client/models/address.rb +259 -0
  45. data/lib/helloextend_api_client/models/amount.rb +217 -0
  46. data/lib/helloextend_api_client/models/contract.rb +378 -0
  47. data/lib/helloextend_api_client/models/contract_plan.rb +228 -0
  48. data/lib/helloextend_api_client/models/contract_product.rb +268 -0
  49. data/lib/helloextend_api_client/models/customer.rb +245 -0
  50. data/lib/helloextend_api_client/models/error.rb +225 -0
  51. data/lib/helloextend_api_client/models/invoice.rb +254 -0
  52. data/lib/helloextend_api_client/models/invoice_details.rb +216 -0
  53. data/lib/helloextend_api_client/models/invoice_discount.rb +226 -0
  54. data/lib/helloextend_api_client/models/invoice_items.rb +271 -0
  55. data/lib/helloextend_api_client/models/invoice_metadata.rb +226 -0
  56. data/lib/helloextend_api_client/models/invoice_metadata_product.rb +225 -0
  57. data/lib/helloextend_api_client/models/invoice_payee.rb +233 -0
  58. data/lib/helloextend_api_client/models/invoice_payer.rb +233 -0
  59. data/lib/helloextend_api_client/models/offer.rb +208 -0
  60. data/lib/helloextend_api_client/models/offer_plan.rb +236 -0
  61. data/lib/helloextend_api_client/models/offer_plan_contract.rb +258 -0
  62. data/lib/helloextend_api_client/models/plan.rb +225 -0
  63. data/lib/helloextend_api_client/models/plan_details.rb +227 -0
  64. data/lib/helloextend_api_client/models/plan_prices.rb +230 -0
  65. data/lib/helloextend_api_client/models/plans_list.rb +208 -0
  66. data/lib/helloextend_api_client/models/product.rb +429 -0
  67. data/lib/helloextend_api_client/models/product_identifiers.rb +247 -0
  68. data/lib/helloextend_api_client/models/product_mfr_warranty.rb +228 -0
  69. data/lib/helloextend_api_client/version.rb +15 -0
  70. data/spec/api/contracts_api_spec.rb +74 -0
  71. data/spec/api/offers_api_spec.rb +48 -0
  72. data/spec/api/plans_api_spec.rb +46 -0
  73. data/spec/api/products_api_spec.rb +88 -0
  74. data/spec/api_client_spec.rb +226 -0
  75. data/spec/configuration_spec.rb +42 -0
  76. data/spec/models/address_spec.rb +71 -0
  77. data/spec/models/amount_spec.rb +47 -0
  78. data/spec/models/contract_plan_spec.rb +47 -0
  79. data/spec/models/contract_product_spec.rb +71 -0
  80. data/spec/models/contract_spec.rb +111 -0
  81. data/spec/models/customer_spec.rb +59 -0
  82. data/spec/models/error_spec.rb +47 -0
  83. data/spec/models/invoice_details_spec.rb +47 -0
  84. data/spec/models/invoice_discount_spec.rb +53 -0
  85. data/spec/models/invoice_items_spec.rb +83 -0
  86. data/spec/models/invoice_metadata_product_spec.rb +53 -0
  87. data/spec/models/invoice_metadata_spec.rb +53 -0
  88. data/spec/models/invoice_payee_spec.rb +59 -0
  89. data/spec/models/invoice_payer_spec.rb +59 -0
  90. data/spec/models/invoice_spec.rb +71 -0
  91. data/spec/models/offer_plan_contract_spec.rb +71 -0
  92. data/spec/models/offer_plan_spec.rb +59 -0
  93. data/spec/models/offer_spec.rb +41 -0
  94. data/spec/models/plan_details_spec.rb +53 -0
  95. data/spec/models/plan_prices_spec.rb +53 -0
  96. data/spec/models/plan_spec.rb +53 -0
  97. data/spec/models/plans_list_spec.rb +41 -0
  98. data/spec/models/product_identifiers_spec.rb +65 -0
  99. data/spec/models/product_mfr_warranty_spec.rb +53 -0
  100. data/spec/models/product_spec.rb +129 -0
  101. data/spec/spec_helper.rb +111 -0
  102. metadata +235 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 755034bcf174711deda51894028b01db245e579d1f2603fe3406b891df492520
4
+ data.tar.gz: e103fae0a49247a16146e8230eb501af87d8943727acbecd4f66ed9e4d6c5347
5
+ SHA512:
6
+ metadata.gz: 2670f4a176b26460b4cfc06e5230882ed1680b270e8498195229c1513f3a58a12a8555286534894e29a16069c7e10cf21760888a5d86d9605a7a70ab578e83c4
7
+ data.tar.gz: 785112f5542af7da5aae9342851c12746fdfd98fab52499098f833af30147f7db680d0427b01ce554d2cc90f445046169f352c9e9fb8fef0e061d130cf40377a
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
@@ -0,0 +1,151 @@
1
+ # helloextend_api_client
2
+
3
+ HelloextendApiClient - the Ruby gem for the Extend API Reference
4
+
5
+ # Introduction
6
+ Welcome to the Extend API Documentation! Our goal is to make your integration as clear and easy as possible, so if you have feedback or suggestions for our API or reference docs, [please let us know](mailto:devs@helloextend.com).
7
+
8
+ If you are implementing the API for the first time, please use the latest \"2019-08-01\" API version. If you have already implemented the API and haven't specified a version, you are on the \"Default\" API version.
9
+
10
+ #### You can get up and running with Extend with just 5 simple steps:
11
+
12
+ * Create an account with Extend, and get an access token from your Extend merchant portal
13
+
14
+ * Sync your store's products to Extend
15
+ * Get the relevant Extend warranty SKUs and add them to your store
16
+
17
+ * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store
18
+
19
+ * Record warranty purchases with Extend so we can create a new contract and deliver it to the customer, or record warranty returns / refunds so we can cancel the contract and account for the refunded amount
20
+ <div class='wrapper tip'><h2>Pro Tip! Keep your store's products up to date</h2><p>To make sure you are selling warranty plans on all eligible products (and not selling them on ineligible ones), it is best to keep your store's products in sync with Extend. If you update your products infrequently, it might be easiest to manually upload or edit products in your merchant portal. If you do update frequently, though, consider integrating with our Products API resource.</p><p>Need help? <a href='mailto:devs@helloextend.com'>Contact us!</a> We love to help!</p></div>
21
+
22
+ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
23
+
24
+ - API version: Default
25
+ - Package version: 1.0.2
26
+ - Build package: org.openapitools.codegen.languages.RubyClientCodegen
27
+
28
+ ## Installation
29
+
30
+ ### Build a gem
31
+
32
+ To build the Ruby code into a gem:
33
+
34
+ ```shell
35
+ gem build helloextend_api_client.gemspec
36
+ ```
37
+
38
+ Then either install the gem locally:
39
+
40
+ ```shell
41
+ gem install ./helloextend_api_client-1.0.2.gem
42
+ ```
43
+
44
+ (for development, run `gem install --dev ./helloextend_api_client-1.0.2.gem` to install the development dependencies)
45
+
46
+ or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
47
+
48
+ Finally add this to the Gemfile:
49
+
50
+ gem 'helloextend_api_client', '~> 1.0.2'
51
+
52
+ ### Install from Git
53
+
54
+ If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
55
+
56
+ gem 'helloextend_api_client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
57
+
58
+ ### Include the Ruby code directly
59
+
60
+ Include the Ruby code directly using `-I` as follows:
61
+
62
+ ```shell
63
+ ruby -Ilib script.rb
64
+ ```
65
+
66
+ ## Getting Started
67
+
68
+ Please follow the [installation](#installation) procedure and then run the following code:
69
+
70
+ ```ruby
71
+ # Load the gem
72
+ require 'helloextend_api_client'
73
+
74
+ # Setup authorization
75
+ HelloextendApiClient.configure do |config|
76
+ # Configure API key authorization: ExtendAccessToken
77
+ config.api_key['X-Extend-Access-Token'] = 'YOUR API KEY'
78
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
79
+ #config.api_key_prefix['X-Extend-Access-Token'] = 'Bearer'
80
+ end
81
+
82
+ api_instance = HelloextendApiClient::ContractsApi.new
83
+ store_id = 'c57ed096-24ef-49a4-a20a-d1b8bf770980' # String | Unique identifier for a Store on Extend
84
+ contract_id = 'cc957cb3-3d5d-430b-90a2-9ec96ee4c3cf' # String | Unique identifier for an Extend warranty Contract
85
+
86
+ begin
87
+ #Get invoice information for a contract
88
+ result = api_instance.contract_invoice(store_id, contract_id)
89
+ p result
90
+ rescue HelloextendApiClient::ApiError => e
91
+ puts "Exception when calling ContractsApi->contract_invoice: #{e}"
92
+ end
93
+
94
+ ```
95
+
96
+ ## Documentation for API Endpoints
97
+
98
+ All URIs are relative to *https://api-demo.helloextend.com*
99
+
100
+ Class | Method | HTTP request | Description
101
+ ------------ | ------------- | ------------- | -------------
102
+ *HelloextendApiClient::ContractsApi* | [**contract_invoice**](docs/ContractsApi.md#contract_invoice) | **GET** /stores/{storeId}/contracts/{contractId}/invoice | Get invoice information for a contract
103
+ *HelloextendApiClient::ContractsApi* | [**create_contracts**](docs/ContractsApi.md#create_contracts) | **POST** /stores/{storeId}/contracts | Create a warranty contract
104
+ *HelloextendApiClient::ContractsApi* | [**refund_contract**](docs/ContractsApi.md#refund_contract) | **POST** /stores/{storeId}/contracts/{contractId}/refund | Cancel a warranty contract and request a refund
105
+ *HelloextendApiClient::OffersApi* | [**get_offer**](docs/OffersApi.md#get_offer) | **GET** /offers?storeId&#x3D;{storeId}&amp;productId&#x3D;{productId} | Get Offer information
106
+ *HelloextendApiClient::PlansApi* | [**offers_liststore_idstore_id_get**](docs/PlansApi.md#offers_liststore_idstore_id_get) | **GET** /offers/list?storeId&#x3D;{storeId} | A list of warranty plans available to the store
107
+ *HelloextendApiClient::ProductsApi* | [**stores_store_id_products_post**](docs/ProductsApi.md#stores_store_id_products_post) | **POST** /stores/{storeId}/products | Create a product
108
+ *HelloextendApiClient::ProductsApi* | [**stores_store_id_products_product_id_delete**](docs/ProductsApi.md#stores_store_id_products_product_id_delete) | **DELETE** /stores/{storeId}/products/{productId} | Delete a product
109
+ *HelloextendApiClient::ProductsApi* | [**stores_store_id_products_product_id_get**](docs/ProductsApi.md#stores_store_id_products_product_id_get) | **GET** /stores/{storeId}/products/{productId} | Get a product
110
+ *HelloextendApiClient::ProductsApi* | [**stores_store_id_products_product_id_put**](docs/ProductsApi.md#stores_store_id_products_product_id_put) | **PUT** /stores/{storeId}/products/{productId} | Update a product
111
+
112
+
113
+ ## Documentation for Models
114
+
115
+ - [HelloextendApiClient::Address](docs/Address.md)
116
+ - [HelloextendApiClient::Amount](docs/Amount.md)
117
+ - [HelloextendApiClient::Contract](docs/Contract.md)
118
+ - [HelloextendApiClient::ContractPlan](docs/ContractPlan.md)
119
+ - [HelloextendApiClient::ContractProduct](docs/ContractProduct.md)
120
+ - [HelloextendApiClient::Customer](docs/Customer.md)
121
+ - [HelloextendApiClient::Error](docs/Error.md)
122
+ - [HelloextendApiClient::Invoice](docs/Invoice.md)
123
+ - [HelloextendApiClient::InvoiceDetails](docs/InvoiceDetails.md)
124
+ - [HelloextendApiClient::InvoiceDiscount](docs/InvoiceDiscount.md)
125
+ - [HelloextendApiClient::InvoiceItems](docs/InvoiceItems.md)
126
+ - [HelloextendApiClient::InvoiceMetadata](docs/InvoiceMetadata.md)
127
+ - [HelloextendApiClient::InvoiceMetadataProduct](docs/InvoiceMetadataProduct.md)
128
+ - [HelloextendApiClient::InvoicePayee](docs/InvoicePayee.md)
129
+ - [HelloextendApiClient::InvoicePayer](docs/InvoicePayer.md)
130
+ - [HelloextendApiClient::Offer](docs/Offer.md)
131
+ - [HelloextendApiClient::OfferPlan](docs/OfferPlan.md)
132
+ - [HelloextendApiClient::OfferPlanContract](docs/OfferPlanContract.md)
133
+ - [HelloextendApiClient::Plan](docs/Plan.md)
134
+ - [HelloextendApiClient::PlanDetails](docs/PlanDetails.md)
135
+ - [HelloextendApiClient::PlanPrices](docs/PlanPrices.md)
136
+ - [HelloextendApiClient::PlansList](docs/PlansList.md)
137
+ - [HelloextendApiClient::Product](docs/Product.md)
138
+ - [HelloextendApiClient::ProductIdentifiers](docs/ProductIdentifiers.md)
139
+ - [HelloextendApiClient::ProductMfrWarranty](docs/ProductMfrWarranty.md)
140
+
141
+
142
+ ## Documentation for Authorization
143
+
144
+
145
+ ### ExtendAccessToken
146
+
147
+
148
+ - **Type**: API key
149
+ - **API key parameter name**: X-Extend-Access-Token
150
+ - **Location**: HTTP header
151
+
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,27 @@
1
+ # HelloextendApiClient::Address
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **address1** | **String** | |
8
+ **address2** | **String** | | [optional]
9
+ **city** | **String** | | [optional]
10
+ **country_code** | **String** | This is an ISO 3166 formatted country code. See &lt;a href&#x3D;&#39;https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes for examples&#39;&gt;https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes for examples&lt;/a&gt; for more information | [optional]
11
+ **postal_code** | **String** | | [optional]
12
+ **province_code** | **String** | This is an ISO 3166-2 formatted region. See &lt;a href&#x3D;&#39;https://en.wikipedia.org/wiki/ISO_3166-2&#39;&gt;https://en.wikipedia.org/wiki/ISO_3166-2&lt;/a&gt; for more information | [optional]
13
+
14
+ ## Code Sample
15
+
16
+ ```ruby
17
+ require 'HelloextendApiClient'
18
+
19
+ instance = HelloextendApiClient::Address.new(address1: 535 Mission Street,
20
+ address2: 11th Floor,
21
+ city: San Francisco,
22
+ country_code: USA,
23
+ postal_code: 94526,
24
+ province_code: CA)
25
+ ```
26
+
27
+
@@ -0,0 +1,19 @@
1
+ # HelloextendApiClient::Amount
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **currency_code** | **String** | This is an ISO-4217 currency code. See &lt;a href&#x3D;&#39;https://en.wikipedia.org/wiki/ISO_4217&#39;&gt;https://en.wikipedia.org/wiki/ISO_4217&lt;/a&gt; for more information | [optional]
8
+ **amount** | **Float** | Amount, in cents, eg $19.99 would be 1999 | [optional]
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'HelloextendApiClient'
14
+
15
+ instance = HelloextendApiClient::Amount.new(currency_code: USD,
16
+ amount: 1999)
17
+ ```
18
+
19
+
@@ -0,0 +1,39 @@
1
+ # HelloextendApiClient::Contract
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **id** | **String** | The unique Extend ID for the warranty contract. Use this for reference when recording returns / refunds. | [optional] [readonly]
8
+ **created_at** | **Float** | The timestamp when the object was created (internal). | [optional] [readonly]
9
+ **updated_at** | **Float** | The timestamp when the object was updated (internal). | [optional] [readonly]
10
+ **transaction_id** | **String** | Your store&#39;s unique transaction identifier, which may be used to query for transactions in the future |
11
+ **po_number** | **String** | An optional merchant generated purchase order number used for reconciliation | [optional]
12
+ **transaction_total** | **Integer** | The total sale transaction amount, in the base unit (i.e. cents) with no currency code. This will help us more easily find transactions and associated warranty contracts during the claims process. | [optional]
13
+ **customer** | [**Customer**](Customer.md) | |
14
+ **product** | [**ContractProduct**](ContractProduct.md) | |
15
+ **currency** | **String** | This is an ISO-4217 currency code. See &lt;a href&#x3D;&#39;https://en.wikipedia.org/wiki/ISO_4217&#39;&gt;https://en.wikipedia.org/wiki/ISO_4217&lt;/a&gt; for more information |
16
+ **transaction_date** | **Float** | The sale transaction date. The warranty contract term is based on this date. This is the epoch time as an integer. |
17
+ **plan** | [**ContractPlan**](ContractPlan.md) | |
18
+ **status** | **String** | The current status of the contract. When requesting a refund, this will have a different value. | [optional] [readonly]
19
+
20
+ ## Code Sample
21
+
22
+ ```ruby
23
+ require 'HelloextendApiClient'
24
+
25
+ instance = HelloextendApiClient::Contract.new(id: cc957cb3-3d5d-430b-90a2-9ec96ee4c3cf,
26
+ created_at: 1557267465,
27
+ updated_at: 1557267556,
28
+ transaction_id: 99999999,
29
+ po_number: ABC-123,
30
+ transaction_total: 14999,
31
+ customer: null,
32
+ product: null,
33
+ currency: USD,
34
+ transaction_date: 1563388069,
35
+ plan: null,
36
+ status: null)
37
+ ```
38
+
39
+
@@ -0,0 +1,19 @@
1
+ # HelloextendApiClient::ContractPlan
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **purchase_price** | **Float** | Price paid for the plan at time of sale. Please ensure this is the same price that was listed on the offer or this request might be rejected. |
8
+ **plan_id** | **String** | The plan id being purchased. This is provided in the sdk as well as being visible per product once the product has been approved as warrantable. |
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'HelloextendApiClient'
14
+
15
+ instance = HelloextendApiClient::ContractPlan.new(purchase_price: 499,
16
+ plan_id: 10001-misc-elec-adh-replace-1y)
17
+ ```
18
+
19
+
@@ -0,0 +1,27 @@
1
+ # HelloextendApiClient::ContractProduct
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **reference_id** | **String** | The store-specific unique reference identifier for the product that the warranty plan is connected to. In other words, if the customer is buying a TV and a warranty plan for the TV, this would be the ID for the TV. Example ID types: a product SKU, variant ID, GTIN, or any other unique identifier you use in your store. Please see the documentation for &lt;a href&#x3D;&#39;/#tag/Store&#39;&gt;&#39;Create a product&#39;&lt;/a&gt; for more information. |
8
+ **purchase_price** | **Integer** | The price paid for the product, in the base unit (i.e. cents) with no currency code. If this amount was lower than the retail price, Extend will assume the price was discounted. |
9
+ **manufacturer_warranty_length** | **Integer** | The duration of the product&#39;s manufacturer warranty as a numer of months. | [optional] [readonly]
10
+ **manufacturer_warranty_length_parts** | **Integer** | The manufacturer warranty length parts. | [optional] [readonly]
11
+ **manufacturer_warranty_length_labor** | **Integer** | The manufacturer warranty length labor. | [optional] [readonly]
12
+ **serial_number** | **String** | The serial number of the product. | [optional]
13
+
14
+ ## Code Sample
15
+
16
+ ```ruby
17
+ require 'HelloextendApiClient'
18
+
19
+ instance = HelloextendApiClient::ContractProduct.new(reference_id: SKU-123-456,
20
+ purchase_price: 14999,
21
+ manufacturer_warranty_length: 12,
22
+ manufacturer_warranty_length_parts: 123456,
23
+ manufacturer_warranty_length_labor: 123456,
24
+ serial_number: ABCD123456)
25
+ ```
26
+
27
+
@@ -0,0 +1,180 @@
1
+ # HelloextendApiClient::ContractsApi
2
+
3
+ All URIs are relative to *https://api-demo.helloextend.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**contract_invoice**](ContractsApi.md#contract_invoice) | **GET** /stores/{storeId}/contracts/{contractId}/invoice | Get invoice information for a contract
8
+ [**create_contracts**](ContractsApi.md#create_contracts) | **POST** /stores/{storeId}/contracts | Create a warranty contract
9
+ [**refund_contract**](ContractsApi.md#refund_contract) | **POST** /stores/{storeId}/contracts/{contractId}/refund | Cancel a warranty contract and request a refund
10
+
11
+
12
+
13
+ ## contract_invoice
14
+
15
+ > Invoice contract_invoice(store_id, contract_id)
16
+
17
+ Get invoice information for a contract
18
+
19
+ Extend automatically generates an invoice to the merchant whenever a warranty contract is sold. If it helps with your record-keeping and back end reconciliation, you can get the invoice details using this API call. If you sent us a purchase order number when making the 'Create a warranty contract' call, we'll include that in the invoice, too, for your reference.
20
+
21
+ ### Example
22
+
23
+ ```ruby
24
+ # load the gem
25
+ require 'helloextend_api_client'
26
+ # setup authorization
27
+ HelloextendApiClient.configure do |config|
28
+ # Configure API key authorization: ExtendAccessToken
29
+ config.api_key['X-Extend-Access-Token'] = 'YOUR API KEY'
30
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
31
+ #config.api_key_prefix['X-Extend-Access-Token'] = 'Bearer'
32
+ end
33
+
34
+ api_instance = HelloextendApiClient::ContractsApi.new
35
+ store_id = 'c57ed096-24ef-49a4-a20a-d1b8bf770980' # String | Unique identifier for a Store on Extend
36
+ contract_id = 'cc957cb3-3d5d-430b-90a2-9ec96ee4c3cf' # String | Unique identifier for an Extend warranty Contract
37
+
38
+ begin
39
+ #Get invoice information for a contract
40
+ result = api_instance.contract_invoice(store_id, contract_id)
41
+ p result
42
+ rescue HelloextendApiClient::ApiError => e
43
+ puts "Exception when calling ContractsApi->contract_invoice: #{e}"
44
+ end
45
+ ```
46
+
47
+ ### Parameters
48
+
49
+
50
+ Name | Type | Description | Notes
51
+ ------------- | ------------- | ------------- | -------------
52
+ **store_id** | [**String**](.md)| Unique identifier for a Store on Extend |
53
+ **contract_id** | [**String**](.md)| Unique identifier for an Extend warranty Contract |
54
+
55
+ ### Return type
56
+
57
+ [**Invoice**](Invoice.md)
58
+
59
+ ### Authorization
60
+
61
+ [ExtendAccessToken](../README.md#ExtendAccessToken)
62
+
63
+ ### HTTP request headers
64
+
65
+ - **Content-Type**: Not defined
66
+ - **Accept**: application/json
67
+
68
+
69
+ ## create_contracts
70
+
71
+ > Contract create_contracts(store_id, contract)
72
+
73
+ Create a warranty contract
74
+
75
+ ### Example
76
+
77
+ ```ruby
78
+ # load the gem
79
+ require 'helloextend_api_client'
80
+ # setup authorization
81
+ HelloextendApiClient.configure do |config|
82
+ # Configure API key authorization: ExtendAccessToken
83
+ config.api_key['X-Extend-Access-Token'] = 'YOUR API KEY'
84
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
85
+ #config.api_key_prefix['X-Extend-Access-Token'] = 'Bearer'
86
+ end
87
+
88
+ api_instance = HelloextendApiClient::ContractsApi.new
89
+ store_id = 'c57ed096-24ef-49a4-a20a-d1b8bf770980' # String | Unique identifier for a Store on Extend
90
+ contract = HelloextendApiClient::Contract.new # Contract |
91
+
92
+ begin
93
+ #Create a warranty contract
94
+ result = api_instance.create_contracts(store_id, contract)
95
+ p result
96
+ rescue HelloextendApiClient::ApiError => e
97
+ puts "Exception when calling ContractsApi->create_contracts: #{e}"
98
+ end
99
+ ```
100
+
101
+ ### Parameters
102
+
103
+
104
+ Name | Type | Description | Notes
105
+ ------------- | ------------- | ------------- | -------------
106
+ **store_id** | [**String**](.md)| Unique identifier for a Store on Extend |
107
+ **contract** | [**Contract**](Contract.md)| |
108
+
109
+ ### Return type
110
+
111
+ [**Contract**](Contract.md)
112
+
113
+ ### Authorization
114
+
115
+ [ExtendAccessToken](../README.md#ExtendAccessToken)
116
+
117
+ ### HTTP request headers
118
+
119
+ - **Content-Type**: application/json
120
+ - **Accept**: application/json
121
+
122
+
123
+ ## refund_contract
124
+
125
+ > refund_contract(store_id, contract_id, opts)
126
+
127
+ Cancel a warranty contract and request a refund
128
+
129
+ This endpoint is your way to report a refunded warranty contract to Extend. If a customer returns an item for which a warranty was purchased, or just the warranty itself, to your store, you should let Extend know so we can cancel the warranty contract. We will also refund you, the merchant, in the next invoice. The amount Extend will refund you (and the amount you should refund to the customer), depends on the date of the refund and the terms of the warranty contract. <div class='wrapper tip'><h2>Pro Tip! Check the refund amount before you refund your customer</h2> To make sure you refund your customer the same amount as Extend will be refunding you, there is a three-step process: <ul><li>Send the cancellation API request to Extend with query parameter \"commit\" set to FALSE. This gives you a preview of the cancellation, Including the amount that would be refunded (the \"cancellation quote\") </li><li>Issue a refund to the customer for the amount matching the cancellation quote</li><li>Re-send the cancellation API request to Extend with query parameter \"commit\" set to TRUE. This will cause Extend to cancel the contract and issue the merchant refund for the amount matching the cancellation quote</li></ul></div><div class='wrapper important'><h2>Important:</h2> Please note that this endpoint <strong>does not cause Extend to refund the customer</strong> - they would get the refund from the store where they purchased the product and warranty contract. A successful call to this endpoint <strong>will void the customer’s warranty contract</strong>, and initiate reimbursement to you, the merchant.</div>
130
+
131
+ ### Example
132
+
133
+ ```ruby
134
+ # load the gem
135
+ require 'helloextend_api_client'
136
+ # setup authorization
137
+ HelloextendApiClient.configure do |config|
138
+ # Configure API key authorization: ExtendAccessToken
139
+ config.api_key['X-Extend-Access-Token'] = 'YOUR API KEY'
140
+ # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
141
+ #config.api_key_prefix['X-Extend-Access-Token'] = 'Bearer'
142
+ end
143
+
144
+ api_instance = HelloextendApiClient::ContractsApi.new
145
+ store_id = 'c57ed096-24ef-49a4-a20a-d1b8bf770980' # String | Unique identifier for a Store on Extend
146
+ contract_id = 'cc957cb3-3d5d-430b-90a2-9ec96ee4c3cf' # String | Unique identifier for an Extend warranty Contract
147
+ opts = {
148
+ commit: true # Boolean | Use the value <strong>\"false\"</strong> to get a preview of the cancellation quote - the amount you will be refunded for the cancelled contract. If you use the value <strong>\"true\"</strong> or omit the query parameter, Extend will execute the contract cancellation.
149
+ }
150
+
151
+ begin
152
+ #Cancel a warranty contract and request a refund
153
+ api_instance.refund_contract(store_id, contract_id, opts)
154
+ rescue HelloextendApiClient::ApiError => e
155
+ puts "Exception when calling ContractsApi->refund_contract: #{e}"
156
+ end
157
+ ```
158
+
159
+ ### Parameters
160
+
161
+
162
+ Name | Type | Description | Notes
163
+ ------------- | ------------- | ------------- | -------------
164
+ **store_id** | [**String**](.md)| Unique identifier for a Store on Extend |
165
+ **contract_id** | [**String**](.md)| Unique identifier for an Extend warranty Contract |
166
+ **commit** | **Boolean**| Use the value &lt;strong&gt;\&quot;false\&quot;&lt;/strong&gt; to get a preview of the cancellation quote - the amount you will be refunded for the cancelled contract. If you use the value &lt;strong&gt;\&quot;true\&quot;&lt;/strong&gt; or omit the query parameter, Extend will execute the contract cancellation. | [optional]
167
+
168
+ ### Return type
169
+
170
+ nil (empty response body)
171
+
172
+ ### Authorization
173
+
174
+ [ExtendAccessToken](../README.md#ExtendAccessToken)
175
+
176
+ ### HTTP request headers
177
+
178
+ - **Content-Type**: Not defined
179
+ - **Accept**: application/json
180
+