Skip to main content

$client->deleteConfig()

Delete

Permanently deletes a configuration object.

Endpoint​

DELETE /keys/{key}/configs/{config}

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 deleteConfig(string $key, string $config): DeleteConfigResponse

Arguments​

NameTypeRequiredDescription
$keystringyesAPI Key
$configstringyesConfiguration Name

Query Parameters​

None.

Response​

IdealPostcodes\Responses\DeleteConfigResponse. 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-config.phpphp
<?php

declare(strict_types=1);

use IdealPostcodes\IdealPostcodes;

require 'vendor/autoload.php';

$client = IdealPostcodes::client('ak_test', 'uk_test');

$response = $client->deleteConfig('ak_test', 'woocommerce');

echo 'Deleted: ', $response->result->deleted, PHP_EOL;