Note
All URIs are relative to https://api.fastly.com
Method | HTTP request | Description |
---|---|---|
AddBillingAddr | POST /customer/{customer_id}/billing_address |
Add a billing address to a customer |
DeleteBillingAddr | DELETE /customer/{customer_id}/billing_address |
Delete a billing address |
GetBillingAddr | GET /customer/{customer_id}/billing_address |
Get a billing address |
UpdateBillingAddr | PATCH /customer/{customer_id}/billing_address |
Update a billing address |
Add a billing address to a customer
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
customerID := "customerId_example" // string | Alphanumeric string identifying the customer.
billingAddressRequest := *openapiclient.NewBillingAddressRequest() // BillingAddressRequest | Billing address (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.BillingAddressAPI.AddBillingAddr(ctx, customerID).BillingAddressRequest(billingAddressRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BillingAddressAPI.AddBillingAddr`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AddBillingAddr`: BillingAddressResponse
fmt.Fprintf(os.Stdout, "Response from `BillingAddressAPI.AddBillingAddr`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerID | string | Alphanumeric string identifying the customer. |
Other parameters are passed through a pointer to a apiAddBillingAddrRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
billingAddressRequest | BillingAddressRequest | Billing address |
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Delete a billing address
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
customerID := "customerId_example" // string | Alphanumeric string identifying the customer.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.BillingAddressAPI.DeleteBillingAddr(ctx, customerID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BillingAddressAPI.DeleteBillingAddr`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerID | string | Alphanumeric string identifying the customer. |
Other parameters are passed through a pointer to a apiDeleteBillingAddrRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
(empty response body)
- Content-Type: Not defined
- Accept: Not defined
Back to top | Back to API list | Back to README
Get a billing address
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
customerID := "customerId_example" // string | Alphanumeric string identifying the customer.
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.BillingAddressAPI.GetBillingAddr(ctx, customerID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BillingAddressAPI.GetBillingAddr`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetBillingAddr`: BillingAddressResponse
fmt.Fprintf(os.Stdout, "Response from `BillingAddressAPI.GetBillingAddr`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerID | string | Alphanumeric string identifying the customer. |
Other parameters are passed through a pointer to a apiGetBillingAddrRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/vnd.api+json
Back to top | Back to API list | Back to README
Update a billing address
package main
import (
"context"
"fmt"
"os"
"github.com/fastly/fastly-go/fastly"
)
func main() {
customerID := "customerId_example" // string | Alphanumeric string identifying the customer.
updateBillingAddressRequest := *openapiclient.NewUpdateBillingAddressRequest() // UpdateBillingAddressRequest | One or more billing address attributes (optional)
cfg := fastly.NewConfiguration()
apiClient := fastly.NewAPIClient(cfg)
ctx := fastly.NewAPIKeyContextFromEnv("FASTLY_API_TOKEN")
resp, r, err := apiClient.BillingAddressAPI.UpdateBillingAddr(ctx, customerID).UpdateBillingAddressRequest(updateBillingAddressRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `BillingAddressAPI.UpdateBillingAddr`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateBillingAddr`: BillingAddressResponse
fmt.Fprintf(os.Stdout, "Response from `BillingAddressAPI.UpdateBillingAddr`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
customerID | string | Alphanumeric string identifying the customer. |
Other parameters are passed through a pointer to a apiUpdateBillingAddrRequest struct via the builder pattern
Name | Type | Description | Notes |
---|---|---|---|
updateBillingAddressRequest | UpdateBillingAddressRequest | One or more billing address attributes |
- Content-Type: application/vnd.api+json
- Accept: application/vnd.api+json