{"openapi":"3.1.0","info":{"title":"ToyProtection Partner API","version":"1.0.0","summary":"Quote, sell, certify and track marine extended-warranty contracts.","description":"Sell ToyProtection plans from your own site or DMS. We handle registration with the administrator (Integrated Warranty Systems), certificates, claims follow-up and remittance. Sandbox keys start with `tp_test_`. All money is CAD.","contact":{"name":"ToyProtection Partners","email":"info@toyprotectionplan.com","url":"https://toyprotectionplan.com/developers"}},"servers":[{"url":"https://toyprotectionplan.com/api/v1"}],"security":[{"bearer":[]}],"tags":[{"name":"Catalog"},{"name":"Quotes"},{"name":"Contracts"},{"name":"Claims"},{"name":"Webhooks"}],"paths":{"/partner":{"get":{"tags":["Catalog"],"summary":"Check your key and see your account","operationId":"getPartner","responses":{"200":{"description":"Your partner account"},"401":{"$ref":"#/components/responses/Error"}}}},"/catalog":{"get":{"tags":["Catalog"],"summary":"Plans, benefits, rules and MSRP tables","operationId":"getCatalog","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Error"}}}},"/quotes":{"post":{"tags":["Quotes"],"summary":"Price a boat under your price book","operationId":"createQuote","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteInput"}}}},"responses":{"201":{"description":"Quote with one option per tier","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/contracts":{"get":{"tags":["Contracts"],"summary":"List your contracts","operationId":"listContracts","parameters":[{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Contracts"},"401":{"$ref":"#/components/responses/Error"}}},"post":{"tags":["Contracts"],"summary":"Sell a contract","description":"Creates the contract, bills it to you on the monthly remittance, and either returns a `signingUrl` for the customer or — if you pass `customerSignedAt` + `customerSignedName` from a signature captured at your desk — sends it straight to the administrator for registration.","operationId":"createContract","parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"Safe retries. Same key returns the original response."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractInput"}}}},"responses":{"201":{"description":"Contract","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"}}}},"/contracts/{number}":{"get":{"tags":["Contracts"],"summary":"Get a contract with its timeline","operationId":"getContract","parameters":[{"$ref":"#/components/parameters/number"}],"responses":{"200":{"description":"Contract","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/contracts/{number}/certificate":{"get":{"tags":["Contracts"],"summary":"Certificate PDF","description":"Rendered live, so it always shows the current status: fetch it again after reporting a signature. In the customer's language (`customer.language`, French by default in Quebec); `?lang=en|fr` overrides. Add `?for=signing` to leave an unsigned contract's signature line blank for your own signing packet.","operationId":"getCertificate","parameters":[{"$ref":"#/components/parameters/number"},{"name":"for","in":"query","required":false,"schema":{"type":"string","enum":["signing"]}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","enum":["en","fr"]}}],"responses":{"200":{"description":"PDF","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"404":{"$ref":"#/components/responses/Error"}}}},"/contracts/{number}/cancel":{"post":{"tags":["Contracts"],"summary":"Cancel a contract","description":"Voids unregistered contracts. Registered contracts are sent to the administrator for a pro-rata refund less the $75 fee, credited to you.","operationId":"cancelContract","parameters":[{"$ref":"#/components/parameters/number"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated contract"},"404":{"$ref":"#/components/responses/Error"}}}},"/contracts/{number}/sign":{"post":{"tags":["Contracts"],"summary":"Report that the customer signed","description":"For contracts created without `customerSignedAt`, typically because you showed the certificate first and collected the signature in your own flow. Records the signature as attested by you and sends the registration to the administrator. Calling it again for an already-signed contract returns the contract unchanged.","operationId":"signContract","parameters":[{"$ref":"#/components/parameters/number"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["customerSignedName"],"properties":{"customerSignedName":{"type":"string","description":"Name the customer signed with"},"customerSignedAt":{"type":"string","format":"date-time","description":"When they signed. Defaults to now; can't be in the future or before the contract was created."},"evidence":{"type":"string","description":"Your reference for the signature record, e.g. an e-sign envelope id. Stored with the contract."}}}}}},"responses":{"200":{"description":"Signed contract, with `registration`: sent, test_mode, failed or null if it was already signed"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"}}}},"/claims/{ref}":{"get":{"tags":["Claims"],"summary":"Claim status on one of your contracts","operationId":"getClaim","parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","example":"CLM-8F3K2Q"}}],"responses":{"200":{"description":"Claim"},"404":{"$ref":"#/components/responses/Error"}}}},"/webhooks/test":{"post":{"tags":["Webhooks"],"summary":"Send a signed test event to your webhook URL","operationId":"testWebhook","responses":{"200":{"description":"Delivery result"},"409":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"event":{"post":{"summary":"Event delivery","description":"POSTed to your webhook URL. Verify `X-ToyProtection-Signature: t=<unix>,v1=<hex>` where hex = HMAC-SHA256(secret, `${t}.${rawBody}`). Types: contract.created, contract.signed, contract.activated, contract.cancelled, claim.updated.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"created":{"type":"string"},"data":{"type":"object"}}}}}},"responses":{"200":{"description":"Acknowledge with any 2xx"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Partner API key, e.g. tp_test_…"}},"parameters":{"number":{"name":"number","in":"path","required":true,"schema":{"type":"string","example":"LBMPPW-26000123"}}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"fields":{"type":"object"}}}}}}}}},"schemas":{"QuoteInput":{"type":"object","required":["province","condition","hp"],"properties":{"province":{"type":"string","enum":["AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"]},"condition":{"type":"string","enum":["new","used"]},"hp":{"type":"integer","minimum":1,"maximum":300,"description":"Total outboard horsepower"},"inServiceDate":{"type":"string","format":"date","description":"New boats. Defaults to today."},"modelYear":{"type":"integer","description":"Used boats. Required."},"termMonths":{"type":"integer","enum":[12,24,36],"description":"Used boats. Defaults to the longest eligible term."},"purchaseDate":{"type":"string","format":"date"},"tier":{"type":"string","enum":["platinum","titanium","titanium_plus"]}}},"Quote":{"type":"object","properties":{"id":{"type":"string"},"options":{"type":"array","items":{"type":"object"}},"included":{"type":"array","items":{"type":"object"}},"notes":{"type":"array","items":{"type":"string"}}}},"Customer":{"type":"object","required":["firstName","lastName","email","phone","address","city","province","postalCode"],"properties":{"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"province":{"type":"string","enum":["AB","BC","MB","NB","NL","NS","NT","NU","ON","PE","QC","SK","YT"]},"postalCode":{"type":"string"},"language":{"type":"string","enum":["en","fr"],"description":"Language for the customer's emails, plan page and certificate. Default en."}}},"Vessel":{"type":"object","required":["year","make","model","hullSerial","engineMake","engineSerial","hp"],"properties":{"year":{"type":"integer"},"make":{"type":"string"},"model":{"type":"string"},"hullSerial":{"type":"string"},"engineMake":{"type":"string"},"engineModel":{"type":"string"},"engineSerial":{"type":"string"},"hp":{"type":"integer"},"purchasePrice":{"type":"number"}}},"ContractInput":{"type":"object","required":["tier","customer","vessel"],"properties":{"quoteId":{"type":"string"},"quote":{"$ref":"#/components/schemas/QuoteInput"},"tier":{"type":"string","enum":["platinum","titanium","titanium_plus"]},"termMonths":{"type":"integer"},"customer":{"$ref":"#/components/schemas/Customer"},"vessel":{"$ref":"#/components/schemas/Vessel"},"trailer":{"type":"object","properties":{"year":{"type":"integer"},"make":{"type":"string"},"model":{"type":"string"},"serial":{"type":"string"}}},"dealer":{"type":"object"},"lienholder":{"type":"object"},"customerSignedAt":{"type":"string","format":"date-time"},"customerSignedName":{"type":"string"},"externalReference":{"type":"string","description":"Your deal or stock number"}}},"Contract":{"type":"object","properties":{"contractNumber":{"type":"string"},"status":{"type":"string","enum":["pending_payment","pending_signature","pending_registration","active","cancelled","expired","void"]},"tier":{"type":"string"},"effectiveDate":{"type":"string","format":"date"},"expiryDate":{"type":"string","format":"date"},"price":{"type":"object"},"included":{"type":"array","items":{"type":"object"}},"signingUrl":{"type":["string","null"]},"planUrl":{"type":"string"},"certificateUrl":{"type":"string"}}}}}}