{"_id":"5715209fb54f5c19007686fa","category":{"_id":"56eb92252109011700f3ba5e","pages":["56eb92af06e2c6190046dc8d","56ebae2543304e2900e21142"],"project":"56e29a8dd3b68d0e00b48ffa","__v":2,"version":"56e29a8dd3b68d0e00b48ffd","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-03-18T05:29:09.180Z","from_sync":false,"order":7,"slug":"coverage-api","title":"Coverages Lifecycle"},"parentDoc":null,"user":"56e62c36cfa58f0e00eafcfb","__v":3,"githubsync":"","project":"56e29a8dd3b68d0e00b48ffa","version":{"_id":"56e29a8dd3b68d0e00b48ffd","hasReference":true,"project":"56e29a8dd3b68d0e00b48ffa","__v":15,"hasDoc":true,"createdAt":"2016-03-11T10:14:37.460Z","releaseDate":"2016-03-11T10:14:37.460Z","categories":["56e29a8ed3b68d0e00b48ffe","56eb917a2e58011700afdfcc","56eb92252109011700f3ba5e","5704d4af849f721900f27835","57052a31473f900e004d5d54","5715222811537f19006aab2d","5715b57b810df00e00cc7832","5715baa9810df00e00cc7837","57180ed83a17770e009a7322","571810273a17770e009a7325","579b22d3f4ad7b190094b60e","584538ecba4f1c0f0096925e","586bb88e5602870f00ae7177","5a70407fb0a01400369583c5","5ace359e40606a0003eac1de"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"editedParams":true,"editedParams2":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-18T17:59:59.986Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"code":"<?php\n// Example assumes Composer is in use with GuzzleHttp as the API library.\nrequire_once(\"vendor/autoload.php\");\nuse GuzzleHttp\\Client;\n\n// Production environment endpoint\n// $api_base_uri = 'https://api.single-invoice.co/v2.0';\n\n// Sandbox environment endpoint\n$api_base_uri = 'https://api-demo.single-invoice.co/v2.0';\n\n// Create a client and provide a base URL\n$client = new Client([ \n\t'timeout' \t=> 8.0,\n\t'verify'\t=> true,\n\t'debug'\t\t=> true\n]);\n\ntry\n{\n\t$apikey = \"FuRLaw2qhCNslfg2em0Wfs8lftfYBUp37HfjalQXzNMIHxaNmvAVWd8jfApGD8v\";\n  $quoteid = \"25bdc1f1-8659-9a25-17f9-6cfd668bb2a1\";\n\t\n\t$response = $client->request('PUT', $api_base_uri.\"/coverage/$quoteid/settle\", [\n\t\t'headers' => [ 'apikey' => $apikey ],\n    'json' => [\n\t\t\t\t\t\t\"settledat\" => \"2017-01-18T16:03:28Z\" // this section is optional; if not passed,\n      \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the current time will be used.\n\t\t\t]    \n\t]);\n\n\t// Check the status code returned by the call\n\t$statusCode = $response->getStatusCode();\n\n\t// Get the data\n\t$data = json_decode($response->getBody(), true);\n}\ncatch (GuzzleHttp\\Exception\\ClientException $e) {\n    $response = $e->getResponse();\n    $responseBodyAsString = $response->getBody()->getContents();\n}","language":"php"}]},"method":"put","results":{"codes":[{"name":"","code":"{\n    \"id\": \"05bb2466-3115-95dc-3f35-4664cae5f3dc\",\n    \"status\": \"Settled\",\n    \"coverage\": {\n        \"currency\": \"EUR\",\n        \"bpsperday\": 1.123333333,\n        \"serviceFee\": 13.63,\n    },\n    \"sellerId\": \"ada2c9ee-9d1b-e8b4-01ec-d84fa5ef576a\",\n    \"buyerId\": \"1233b55b-6feb-d755-3aa0-3d502e5eb31b\",\n    \"invoice\": {\n        \"Amount\": 10000,\n        \"Currency\": \"EUR\",\n        \"DueAt\": \"2016-12-06T00:00:00Z\",\n        \"IssuedAt\": \"2016-11-23T11:03:28Z\"\n    }\n}","language":"json","status":200},{"name":"","code":"{\n\t\"message\" : \"Missing parameters\",\n  \"docUrl\": \"https://docs.single-invoice.co/docs/errors#section-missing_param\"\n}","language":"json","status":400},{"code":"{\n\t\"message\" : \"Resource not found\",\n  \"docUrl\": \"https://docs.single-invoice.codocs.single-invoice.co/docs/errors#section-resource_not_found\"\n}","language":"json","status":404},{"code":"{\n\t\"message\" : \"Bad authentication information\",\n  \"docUrl\": \"http://docs.single-invoice.co/docs/errors#section-bad-authentication-information\"\n}","language":"json","status":401}]},"auth":"required","params":[{"_id":"56e98c69cbeede0e0006e56d","ref":"","in":"path","required":true,"desc":"The ID of coverage policy to settle","default":"","type":"string","name":"id"},{"_id":"579e56598cc49e0e00dea8ca","ref":"","in":"header","required":true,"desc":"Your Coverage API Key, in the HTTP request headers.","default":"","type":"string","name":"apikey"},{"_id":"587f903106ea712300ecb42b","ref":"","in":"body","required":false,"desc":"Date and time the invoice was settled at (ISO 8601 timestamp)","default":"","type":"string","name":"settledat"}],"url":"/coverage/:id/settle"},"isReference":true,"order":5,"body":"This method allows settling of a cover, and should be used once your invoice has been paid in full. \n\nThe quote must be in 'Activated' status to be approved. \n\nOnce a cover has been settled, it is no longer insured.\n\nYou can pass an optional 'settledat' parameter as the JSON body to this endpoint, specifying the date (in ISO 8601 timestamp format) that the invoice was settled. If this parameter is not present, it will use the time that the request was received as the settlement date.","excerpt":"Settles a coverage policy, returning the details of the coverage upon success.","slug":"settle","type":"endpoint","title":"Settle Cover"}

putSettle Cover

Settles a coverage policy, returning the details of the coverage upon success.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
The ID of coverage policy to settle

Body Params

settledat:
string
Date and time the invoice was settled at (ISO 8601 timestamp)

Headers

apikey:
required
string
Your Coverage API Key, in the HTTP request headers.

Examples


Result Format


Documentation

This method allows settling of a cover, and should be used once your invoice has been paid in full. The quote must be in 'Activated' status to be approved. Once a cover has been settled, it is no longer insured. You can pass an optional 'settledat' parameter as the JSON body to this endpoint, specifying the date (in ISO 8601 timestamp format) that the invoice was settled. If this parameter is not present, it will use the time that the request was received as the settlement date.