{"_id":"5845391929c0970f00e84417","githubsync":"","user":"5795d43eb9ee2d0e00df357a","category":{"_id":"584538ecba4f1c0f0096925e","__v":0,"project":"56e29a8dd3b68d0e00b48ffa","version":"56e29a8dd3b68d0e00b48ffd","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-12-05T09:52:44.472Z","from_sync":false,"order":8,"slug":"traffic-lights","title":"Traffic Lights"},"__v":1,"project":"56e29a8dd3b68d0e00b48ffa","parentDoc":null,"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"},"updates":["58ef774cf8dd1f1b00c1973d"],"next":{"pages":[],"description":""},"createdAt":"2016-12-05T09:53:29.098Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"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  'timeout'   => 4.0,\n  'verify'  => true,\n  'debug'   => true\n]);\n\ntry\n{\n  // Define the buyer ID, as looked up from one of the \"Search Company\" endpoints. \n  $buyerid = \"2ab73aae-4223-422c-85ea-ce3d39b5e260\"; // example from Sandbox environment\n  \n  $response = $client->request('GET', $api_base_uri.\"/trafficlight/$buyerid\", [\n    'headers' => [ 'apikey' => 'Z5JAzsUVju7BiqbA9XslWjMRgdvAdTtvp214UTZgjaKxJ46TKlqPt' ],\n  ]);\n\n  // Check the status code returned by the call\n  $statusCode = $response->getStatusCode();\n\n  // Get the data\n  $data = json_decode($response->getBody(), true);\n}\ncatch (GuzzleHttp\\Exception\\ClientException $e) \n{\n  $response = $e->getResponse();\n  $responseBodyAsString = $response->getBody()->getContents();\n}","language":"php"},{"language":"curl","code":"curl -H \"apikey: Z5JAzsUVju7BiqbA9XslWjMRgdvAdTtvp214UTZgjaKxJ46TKlqPt\" -H \"Content-Type: application/json\" https://api.single-invoice.co/v2.0/trafficlight -v "},{"code":"// Example assumes the packages request and request-promise have been installed (npm install request request-promise)\nvar rp = require('request-promise');\n\nvar apiBaseUri = 'https://ehda-dev-api.azurewebsites.net/v2.0';\nvar apikey = 'A1VmVXUF9Z9EP5NHLomCzTLgDbC564IKVVnUKq4vr0W5O55C4opUkmd4cIvbU2Q';\n\n// This is the company ID, as retreived from one of the Search Company methods\nvar companyid = 'ca1574c8-07b4-4be8-a87d-00067f3887b0';\n\nrp({\n  method: 'GET',\n  uri: apiBaseUri + '/trafficlight/' + companyid,\n  headers: {\n    apikey: apikey\n  },\n  json: true\n})\n  .then(function (res) {\n    // request succeeded, the result is available in the res object\n    console.log(res);\n  })\n  .catch(function (err) {\n    // request failed, the error is available in the err object\n    console.log(err);\n  })\n;","language":"javascript"}]},"method":"get","results":{"codes":[{"status":200,"language":"json","code":"{\n  \"color\":\"Green\"\n}","name":""},{"language":"json","status":401,"code":"{\n\t\"Message\":\"The API key is invalid.\"\n}"},{"code":"","language":"json","status":404}]},"settings":"","auth":"required","params":[{"_id":"56e635e0cfa58f0e00eafcff","ref":"","in":"path","required":true,"desc":"The Single-Invoice.co ID for a given transactor","default":"","type":"string","name":"sicid"},{"_id":"579e57398cc49e0e00dea8ce","ref":"","in":"header","required":true,"desc":"Your Traffic Light API Key, in the HTTP request headers.","default":"","type":"string","name":"apikey"}],"url":"/trafficlight/:sicid"},"isReference":false,"order":0,"body":"This method will search the Single-Invoice.co database for a company with the provided Single-Invoice.co (SIC) ID. \n\nIf the search is successful, the endpoint will return JSON containing the Traffic Light grading for this company. \n\nThe color ranges returned will depend on your policy. Our Sandbox environment has a set of default colors: \n\nWhite: no result available\nGreen: excellent credit risk\nYellow: good credit risk \nRed: medium credit risk \nBlack: uninsurable due to insolvency\n\nNote that this method requires a Traffic Light API Key (instead of the Coverage API Key required for other operations like company search or quoting); you may need to request additional access for access to the Traffic Light API.","excerpt":"Returns risk information about a company as a \"traffic light color\", identified by Single-Invoice.co ID.","slug":"get-traffic-light","type":"endpoint","title":"Get Traffic Light"}

getGet Traffic Light

Returns risk information about a company as a "traffic light color", identified by Single-Invoice.co ID.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

sicid:
required
string
The Single-Invoice.co ID for a given transactor

Headers

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

Examples


Result Format


Documentation

This method will search the Single-Invoice.co database for a company with the provided Single-Invoice.co (SIC) ID. If the search is successful, the endpoint will return JSON containing the Traffic Light grading for this company. The color ranges returned will depend on your policy. Our Sandbox environment has a set of default colors: White: no result available Green: excellent credit risk Yellow: good credit risk Red: medium credit risk Black: uninsurable due to insolvency Note that this method requires a Traffic Light API Key (instead of the Coverage API Key required for other operations like company search or quoting); you may need to request additional access for access to the Traffic Light API.