Hi guys i'm creating an e-commerce with CommerceJs and NextJS when handling payment i get this error
message: "The given data was invalid." type: "unprocessable_entity" line_items.item_7RyWOwmK5nEa2V.quantity: ["Requested quantity is not available."]
i tried to change my code like the docs but no luck
const orderData = {
line_items: {
item_7RyWOwmK5nEa2V: {
quantity: 1,
}
},
customer: {
firstname: 'John',
lastname: 'Doe',
email: 'john.doe@example.com'
},
shipping: {
name: 'John Doe',
street: '123 Fake St',
town_city: 'San Francisco',
county_state: 'US-CA',
postal_zip_code: '94103',
country: 'US'
},
fulfillment: {
shipping_method: 'ship_7RyWOwmK5nEa2V'
},
billing: {
name: 'John Doe',
street: '234 Fake St',
town_city: 'San Francisco',
county_state: 'US-CA',
postal_zip_code: '94103',
country: 'US'
},
payment: {
gateway: 'stripe',
stripe: {
payment_method_id: paymentMethod.id,
},
}
}