Closed rizaldirnm closed 5 years ago
@Rizaldinurm thanks for reporting your issue.
You've wrongly mixed two ways of defining order item. As you can find in official docs you can:
1) define product_id
OR
2) define source_id
and related_object = "product"
Second option has higher precedence that's why it didn't work for you, you missed related_object
so we couldn't know if given source_id
is a product
or sku
.
Regarding the message, truly it is misleading and we will fix API response soon.
AHH! thankyou so much.
Hi, I dont konw its my problem or not. this is my code:
clientVoucher.validations.validate(code, { customer: { source_id: userdata.id }, order: { items:[ { product_id: product_id, quantity: 1, price: parseInt(amount)*100, source_id: productCode } ] } })
and my response is:
{ code: 400, message: 'Invalid Order', details: 'Property items should be an array', key: 'invalid_order', toString: [Function] }
BUT if I comment source_id its work fine. if source_id not work its hard for my system to request data product only for get product_id. Help me.