$client->deleteLicensee()
Cancel
Cancels a licensee. Its key stops working and it drops out of the licensee list. Contact us to reverse it.
Endpoint
DELETE /keys/{key}/licensees/{licensee}
See the API reference for this endpoint.
This operation needs a Management Key. Pass it as the second argument to IdealPostcodes::client(), which sends it in the Authorization header. See setup.
Signature
public function deleteLicensee(string $key, string $licensee): DeleteLicenseeResponse
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
$key | string | yes | API Key |
$licensee | string | yes | Licensee Key |
Query Parameters
None.
Response
IdealPostcodes\Responses\DeleteLicenseeResponse. Read fields as properties, such as $response->result, or as an array with the API's field names. toArray() returns the decoded body.
Errors
An HTTP error throws ApiException with the HTTP status, the API error code from getCode() and the decoded body. A transport failure throws TransporterException. See error handling.
Example
delete-licensee.phpphp
<?php
declare(strict_types=1);
use IdealPostcodes\IdealPostcodes;
require 'vendor/autoload.php';
$client = IdealPostcodes::client('ak_test', 'uk_test');
$response = $client->deleteLicensee('ak_test', '56a11209ebe230380bf104c3');
echo 'Deleted: ', $response->result->deleted, PHP_EOL;