=begin #Extend API Reference ## Introduction 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). 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. #### You can get up and running with Extend with just 5 simple steps: * Create an account with Extend, and get an access token from your Extend merchant portal * Sync your store's products to Extend * Get the relevant Extend warranty SKUs and add them to your store * Add the JS SDK snippets to your store's website, which will enable warranty offers to be displayed in your store * 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

Pro Tip! Keep your store's products up to date

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.

Need help? Contact us! We love to help!

The version of the OpenAPI document: Default Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1-SNAPSHOT =end require 'spec_helper' require 'json' # Unit tests for HelloextendApiClient::ContractsApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'ContractsApi' do before do # run before each test @api_instance = HelloextendApiClient::ContractsApi.new end after do # run after each test end describe 'test an instance of ContractsApi' do it 'should create an instance of ContractsApi' do expect(@api_instance).to be_instance_of(HelloextendApiClient::ContractsApi) end end # unit tests for contract_invoice # Get invoice information for a contract # 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. # @param store_id Unique identifier for a Store on Extend # @param contract_id Unique identifier for an Extend warranty Contract # @param [Hash] opts the optional parameters # @return [Invoice] describe 'contract_invoice test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for create_contracts # Create a warranty contract # @param store_id Unique identifier for a Store on Extend # @param contract # @param [Hash] opts the optional parameters # @return [Contract] describe 'create_contracts test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end # unit tests for refund_contract # Cancel a warranty contract and request a refund # 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> # @param store_id Unique identifier for a Store on Extend # @param contract_id Unique identifier for an Extend warranty Contract # @param [Hash] opts the optional parameters # @option opts [Boolean] :commit 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. # @return [nil] describe 'refund_contract test' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers end end end