Hi!
I am working with App Store Connect API, and I am receiving this error when I want to make a post.
"'2023-07-12T20:25:38.321Z' is not a valid value for the attribute 'expirationDate'. Expected an ISO 8601 date",
my code is:
const date = new Date(addMonths(new Date(), 1));
const formattedDate = date.toISOString();
try {
const data = {
attributes: {
numberOfCodes: 1,
expirationDate: formattedDate,
},
relationships: {
offerCode: {
data: {
id: 'productID',
type: 'subscriptionOfferCodes',
},
},
},
type: 'subscriptionOfferCodeOneTimeUseCodes',
};
const result = await axios.post(
'https://api.appstoreconnect.apple.com/v1/subscriptionOfferCodeOneTimeUseCodes',
{ data },
{ headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` } },
);
Could someone let me know wich is the issue with my date.
I think 2023-07-12T20:25:38.321Z is a ISO 8601 format
Thank you!!