Skip to content

Billing.GetOrganizationPremiumRequestUsageReport failing to unmarshal #3996

@elliotpeele

Description

@elliotpeele

The values for GrossQuantity, DiscountQuantity, and NetQuantity can be floats. The current struct in v82 for PremiumRequestUsageItem in github/billing.go has them defined as ints.

e.g.

{
"product": "Copilot",
"sku": "Copilot Premium Request",
"model": "GPT-5.2",
"unitType": "requests",
"pricePerUnit": 0.04,
"grossQuantity": 5054.0,
"grossAmount": 202.16,
"discountQuantity": 4974.0,
"discountAmount": 198.96,
"netQuantity": 80.0,
"netAmount": 3.2
}

This leads to an error in unmarshalling the json data:

json: cannot unmarshal number 5054.0 into Go struct field PremiumRequestUsageItem.usageItems.grossQuantity of type int

Metadata

Metadata

Assignees

Labels

Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).buggood first issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions