godo.Prepayment.GetConfig()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Prepayment.GetConfig(ctx context.Context) (*godo.PrepaymentConfigResponse, *godo.Response, error)

Description

GetConfig retrieves the authenticated customer’s prepayment configuration and status.

This method sends a GET request to /v2/customers/my/prepayment_config.

Returns

*godo.PrepaymentConfigResponse
*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.PrepaymentConfigResponse

PrepaymentConfigResponse is the response from the public prepayment config endpoint.

Config *godo.PrepaymentConfig

JSON key: config

Status *godo.PrepaymentStatus

JSON key: status

Request Sample

Show Request Sample
package main

import (
	"context"
	"fmt"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	result, _, err := client.Prepayment.GetConfig(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", result)
}

Response Example

Show Response Example
{
  "config": {
    "spend_limit": "100.00",
    "is_auto_prepay_enabled": true,
    "prepay_amount": "50.00",
    "prepay_threshold": "10.00",
    "created_at": "2026-06-22T19:31:51Z",
    "updated_at": "2026-06-25T18:40:07Z"
  },
  "status": {
    "balance": "25.00",
    "is_auto_prepay_enabled": true,
    "blocked": true,
    "eligible": true,
    "month_to_date_balance": "75.00"
  }
}

More Information

See GET /v2/customers/my/prepayment_config in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.