Skip to main content

client.delete_licensee

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 management_key: to IdealPostcodes::Client.new, which sends it in the Authorization header. See setup.

Signature​

def delete_licensee(key, licensee)

Arguments​

NameTypeRequiredDescription
keyStringyesAPI Key
licenseeStringyesLicensee Key

Query Parameters​

None.

Response​

IdealPostcodes::Responses::DeleteLicenseeResponse. Read fields with readers named as the API names them, such as response.result, or with response["result"]. to_h returns the decoded body.

Errors​

An HTTP error raises IdealPostcodes::ApiError with the HTTP status, the API error code and the decoded body. A transport failure raises IdealPostcodes::TransportError. See error handling.

Example​

delete-licensee.rbruby
require "ideal_postcodes"

client = IdealPostcodes::Client.new(api_key: "ak_test", management_key: "uk_test")

response = client.delete_licensee("ak_test", "56a11209ebe230380bf104c3")

puts "Deleted: #{response.result.deleted}"