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 with addresszen.WithManagementKey(...) when you create the client, which sends it in the Authorization header. See setup.
Signature
func (c *Client) DeleteLicensee(ctx context.Context, key string, licensee string) (*DeleteLicenseeResponse, error)Arguments
| Name | Type | Required | Description |
|---|---|---|---|
ctx | context.Context | yes | Cancels the request and sets its deadline. |
key | string | yes | API Key |
licensee | string | yes | Licensee Key |
Query Parameters
None.
Response
*addresszen.DeleteLicenseeResponse. Fields the API may leave out or send as null are pointers. RawJSON() returns the body as received. See responses.
Errors
An HTTP error returns *addresszen.APIError with the HTTP status, the API error code and the body; match it with errors.AsType. A transport failure returns the net/http error, wrapped. See error handling.
Example
delete-licensee/main.gogo
package main
import (
"context"
"fmt"
"log"
addresszen "go.addresszen.com/sdk"
)
func main() {
client := addresszen.NewClient("ak_test", addresszen.WithManagementKey("uk_test"))
res, err := client.DeleteLicensee(context.Background(), "ak_test", "sl_hk71kco54zGSGvF9eXXrvvnMOLLNh")
if err != nil {
log.Fatal(err)
}
fmt.Println("Deleted:", res.Result.Deleted)
}