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

Edit

Update a credit grant
client.V1.CreditGrants.Edit(ctx, body) (*DataIDV1CreditGrantEditResponse, error)
post/v1/credits/editGrant

Edit an existing credit grant

Parameters
bodyIDfieldCreditGrantTypefieldExpiresAtfieldNamefieldV1CreditGrantEditParams
Hide ParametersShow Parameters
IDfield
param.Field[string]

the ID of the credit grant

formatuuid
CreditGrantTypefield
optional
param.Field[string]

the updated credit grant type

ExpiresAtfield
optional
param.Field[Time]

the updated expiration date for the credit grant

formatdate-time
Namefield
optional
param.Field[string]

the updated name for the credit grant

Returns
V1CreditGrantEditResponsestruct
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.CreditGrants.Edit(context.TODO(), metronome.V1CreditGrantEditParams{
    ID: metronome.F("9b85c1c1-5238-4f2a-a409-61412905e1e1"),
    ExpiresAt: metronome.F(time.Now()),
    Name: metronome.F("Acme Corp Promotional Credit Grant"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Data)
}
200 Example
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  }
}