{"_id":"56e982bf8617502200f19c11","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,"githubsync":"","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,"__v":5,"project":"56e29a8dd3b68d0e00b48ffa","editedParams2":true,"user":"56e62c36cfa58f0e00eafcfb","updates":["57e914bac698700e000ba869","57e9152bc698700e000ba86a"],"next":{"pages":[],"description":""},"createdAt":"2016-03-16T15:58:55.758Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"php","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 = \"kCQXGoD48U3wUc5sRx19bLAgQESH2dFgA4nkHJiZ3a9IufN8hu5QqPINRN\";\n  $quoteid = \"25bdc1f1-8659-9a25-17f9-6cfd668bb2a1\";\n\t\n\t$response = $client->request('PUT', $api_base_uri.\"/coverage/$quoteid/activate\", [\n\t\t'headers' => [ 'apikey' => $apikey ],\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":"curl","code":"curl -H \"apikey: CdF49I89tjCSoYHXh9tCXQxzNuY1C4oJM4SS7q1c\" -H \"Content-Type: application/json\" -X PUT https://api-demo.single-invoice.co/v2.0/coverage/b37239eb-3f85-86ec-6433-d8f61c480dc4/activate -v "}]},"method":"put","results":{"codes":[{"status":200,"name":"","code":"{\n    \"Id\": \"9a3342f9-f8d2-1486-af35-ebb905e85833\",\n    \"Status\": \"Activated\",\n    \"Coverage\": {\n        \"Amount\": 216.77,\n        \"Currency\": \"eur\",\n        \"ActivatedAt\": \"2016-08-12T14:08:24Z\"\n    },\n    \"SellerId\": \"9a292f83-0cc6-71d9-4b86-ae9cbc4c42bd\",\n    \"BuyerId\": \"758a537e-6dca-1b4a-b604-77c82199d922\",\n    \"Invoice\": {\n        \"Amount\": 100000,\n        \"Currency\": \"eur\",\n        \"DueAt\": \"2016-10-10T00:00:00Z\",\n        \"IssuedAt\": \"2016-08-10T00:00:00Z\",\n        \"Number\": null\n    }\n}","language":"json"},{"language":"json","status":404,"name":"","code":"{\n\t\"message\" : \"Resource not found\",\n  \"docUrl\": \"https://armadill.io/docs/errors#section-resource_not_found\"\n}"},{"code":"{\n\t\"message\" : \"Bad authentication information\",\n  \"docUrl\": \"http://docs.armadill.io/docs/errors#section-bad-authentication-information\"\n}","language":"json","status":401},{"status":400,"language":"json","code":"{\n\t\"message\" : \"Missing parameters\",\n  \"docUrl\": \"https://armadill.io/docs/errors#section-missing_param\"\n}"},{"code":"","language":"json","status":304},{"code":"{\n\t\"message\" : \"Expired date stamp\",\n  \"docUrl\": \"https://armadill.io/docs/authentication\"\n}","language":"json","status":408},{"code":"{\n\t\"message\" : \"Can not activate policy\",\n  \"docUrl\": \"https://armadill.io/docs/errors#section-could_not_activate\"\n}","language":"json","status":409}]},"settings":"","auth":"required","params":[{"_id":"56e982bf8617502200f19c12","ref":"","in":"path","required":true,"desc":"The ID of coverage policy to activate","default":"","type":"string","name":"id"},{"_id":"579e5613b0baa40e00a5ea05","ref":"","in":"header","required":true,"desc":"Your Coverage API Key, in the HTTP request headers.","default":"","type":"string","name":"apikey"}],"url":"/coverage/:id/activate"},"isReference":true,"order":0,"body":"This method allows activation of a coverage, based on a particular quote. \n\nThe quote must be in 'Pending' status to be approved. \n\nOnce a quote is approved, insurance coverage is granted subject to the conditions of your policy.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Make sure you confirm activation was successful!\",\n  \"body\": \"Note that under most circumstances, any quote in Pending stage will be able to be Activated. \\n\\nHowever, it is critical to check that a quote was successfully Activated in order to make sure that you are correctly covered for an invoice. The simplest way to do this is to check the response JSON and make sure that the Status has correctly been set to Activated. \\n\\nThis will ensure that you can be made aware of any problems with the Activation - for example, if network problems or temporary issues with the API prevent you from successfully activating.\"\n}\n[/block]\nNote: once a cover has been activated it cannot be Rejected or \"de-activated\".","excerpt":"Activates a cover by ID.","slug":"coverage-activation","type":"endpoint","title":"Activate Cover"}

putActivate Cover

Activates a cover by ID.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
string
The ID of coverage policy to activate

Headers

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

Examples


Result Format


Documentation

This method allows activation of a coverage, based on a particular quote. The quote must be in 'Pending' status to be approved. Once a quote is approved, insurance coverage is granted subject to the conditions of your policy. [block:callout] { "type": "danger", "title": "Make sure you confirm activation was successful!", "body": "Note that under most circumstances, any quote in Pending stage will be able to be Activated. \n\nHowever, it is critical to check that a quote was successfully Activated in order to make sure that you are correctly covered for an invoice. The simplest way to do this is to check the response JSON and make sure that the Status has correctly been set to Activated. \n\nThis will ensure that you can be made aware of any problems with the Activation - for example, if network problems or temporary issues with the API prevent you from successfully activating." } [/block] Note: once a cover has been activated it cannot be Rejected or "de-activated".