Skip to content
  • Auto
  • Light
  • Dark
Talk to an expert

Update End Date

Update the commit end date
client.V1.Customers.Commits.UpdateEndDate(ctx, body) (*DataIDV1CustomerCommitUpdateEndDateResponse, error)
post/v1/contracts/customerCommits/updateEndDate

Pull forward the end date of a prepaid commit. Use the "edit a commit" endpoint to extend the end date of a prepaid commit, or to make other edits to the commit.

Parameters
bodyCommitIDfieldCustomerIDfieldAccessEndingBeforefieldInvoicesEndingBeforefieldV1CustomerCommitUpdateEndDateParams
Hide ParametersShow Parameters
CommitIDfield
param.Field[string]

ID of the commit to update. Only supports "PREPAID" commits.

formatuuid
CustomerIDfield
param.Field[string]

ID of the customer whose commit is to be updated

formatuuid
AccessEndingBeforefield
optional
param.Field[Time]

RFC 3339 timestamp indicating when access to the commit will end and it will no longer be possible to draw it down (exclusive). If not provided, the access will not be updated.

formatdate-time
InvoicesEndingBeforefield
optional
param.Field[Time]

RFC 3339 timestamp indicating when the commit will stop being invoiced (exclusive). If not provided, the invoice schedule will not be updated.

formatdate-time
Returns
V1CustomerCommitUpdateEndDateResponsestruct
Hide ParametersShow Parameters
DataIDstringID
package main

import (
  "context"
  "fmt"
  "time"

  "github.com/Metronome-Industries/metronome-go"
  "github.com/Metronome-Industries/metronome-go/option"
)

func main() {
  client := metronome.NewClient(
    option.WithBearerToken("My Bearer Token"),
  )
  response, err := client.V1.Customers.Commits.UpdateEndDate(context.TODO(), metronome.V1CustomerCommitUpdateEndDateParams{
    CommitID: metronome.F("6162d87b-e5db-4a33-b7f2-76ce6ead4e85"),
    CustomerID: metronome.F("13117714-3f05-48e5-a6e9-a66093f13b4d"),
    AccessEndingBefore: metronome.F(time.Now()),
    InvoicesEndingBefore: metronome.F(time.Now()),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}