Validate Billing Address
client.Billing.AddressValidation(ctx, body) (*BillingAddressValidationResponse, error)
POST/billing/address-validation
Validates a billing address and returns validated address suggestions. Authentication is not enforced to support pre-signup address validation flows, so credentials are accepted but not required.
Security
API Token
The preferred authorization scheme for interacting with the Cloudflare API. Create a token.
Example:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Validate Billing Address
package main
import (
"context"
"fmt"
"github.com/cloudflare/cloudflare-go"
"github.com/cloudflare/cloudflare-go/billing"
"github.com/cloudflare/cloudflare-go/option"
)
func main() {
client := cloudflare.NewClient(
option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
)
response, err := client.Billing.AddressValidation(context.TODO(), billing.BillingAddressValidationParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.ValidatedAddresses)
}
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"validated_addresses": [
{
"address": "address",
"address2": "address2",
"city": "city",
"country": "country",
"state": "state",
"validation_code": "validation_code",
"zipcode": "zipcode"
}
]
},
"success": true
}Returns Examples
{
"errors": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"messages": [
{
"code": 1000,
"message": "message",
"documentation_url": "documentation_url",
"source": {
"pointer": "pointer"
}
}
],
"result": {
"validated_addresses": [
{
"address": "address",
"address2": "address2",
"city": "city",
"country": "country",
"state": "state",
"validation_code": "validation_code",
"zipcode": "zipcode"
}
]
},
"success": true
}