Skip to main content

client.update_licensee

Update

Updates a licensee's address, postcode, allowed URLs and daily limit. Returns the updated licensee. The name is fixed at creation.

Endpoint​

POST /keys/{key}/licensees/{licensee}

See the API reference for this endpoint.

This operation needs a Management Key. Pass it as management_key: to AddressZen::Client.new, which sends it in the Authorization header. See setup.

Signature​

def update_licensee(
key,
licensee,
name: nil,
address: nil,
postcode: nil,
whitelist: nil,
daily: nil
)

Arguments​

NameTypeRequiredDescription
keyStringyesAPI Key
licenseeStringyesLicensee Key
keywordskeyword argumentsnoOne per body field, named as the API names them. A keyword left out or nil is not sent.

Query Parameters​

None.

Request Body​

Pass these as keyword arguments too; the SDK sends them as the JSON body.

NameTypeRequiredDescription
nameStringnoLicensee individual or organisation name
addressStringnoLicensee's first, second and third line address as well as post town concatenated by commas
postcodeStringnoLicensee's postcode
whitelistArray<String>noA list of allowed URLs. An empty list disables the check.
dailyHashno

Response​

AddressZen::Responses::LicenseeResponse. 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 AddressZen::ApiError with the HTTP status, the API error code and the decoded body. A transport failure raises AddressZen::TransportError. See error handling.

Example​

update-licensee.rbruby
require "addresszen"

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

response = client.update_licensee("ak_test", "sl_hk71kco54zGSGvF9eXXrvvnMOLLNh", name: "Acme Inc")

puts response.result.name