Hi there - Hoping someone can help. I am sending JSON over to the API to create orders. Some of these orders have discounts. These discounts are set up on the (test) Shopify Shop I am currently working with. In the example below the discount is a whole order discount of 10 percent which, for this order, has a value of £3.22. The relevant section of the JSON I am sending reads as follows:
“discount_applications”:[
{
“type”:“discount_code”,
“value”:“10”, [NOTE this respresents 10% but I have exactly the same result if I send 3.22 here]
“value_type”:“percentage”,
“allocation_method”:“across”,
“target_selection”:“all”,
“code”:“Whole Order Discount”
}
],
“discount_codes”:[
{
“code”:“Whole Order Discount”,
“amount”:“3.22”,
“type”:“percentage”
}
],
Yet, when the order is created the matching part of the response says
“discount_applications”:[
{
“type”:“discount_code”,
“value”:“3.22”,
“value_type”:“percentage”,
“allocation_method”:“across”,
“target_selection”:“all”,
“target_type”:“line_item”,
“code”:“Whole Order Discount”
}
],
“discount_codes”:[
{
“code”:“Whole Order Discount”,
“amount”:“1.00”, [NOTE: This is where the problem lies, as this should be 3.22]
“type”:“percentage”
}
],
As a result of this, the order displayed by Shopify has a discount of £1.00 applied instead of the correct discount of £3.22, so making the order total £2.22 more than it should be.
Can anyone point me in the direction of what I need to change?
In case it helps, this is the full JSON I am sending
{
“order”:{
“name”:“56776”,
“email”:“”, [NOTE removed for data protection - but this customer does exist withing Shopify]
“fulfillment_status”:“fulfilled”,
“discount_applications”:[
{
“type”:“discount_code”,
“value”:“10”,
“value_type”:“percentage”,
“allocation_method”:“across”,
“target_selection”:“all”,
“code”:“Whole Order Discount”
}
],
“discount_codes”:[
{
“code”:“Whole Order Discount”,
“amount”:“3.22”,
“type”:“percentage”
}
],
“line_items”:[
{
“title”:“Zambroza”,
“price”:“16.23”,
“quantity”:“1”,
“tax_lines”:[
{
“price”:“0.00”,
“rate”:“0”,
“title”:“VAT”
}
]
},
{
“title”:“Zinc”,
“price”:“7.19”,
“quantity”:“1”,
“tax_lines”:[
{
“price”:“1.44”,
“rate”:“0.2”,
“title”:“VAT”
}
]
},
{
“title”:“Vitamin D3”,
“price”:“7.91”,
“quantity”:“1”,
“tax_lines”:[
{
“price”:“1.58”,
“rate”:“0.2”,
“title”:“VAT”
}
]
}
],
“total_price”:“32.19”,
“total_tax”:“5.22”,
“currency”:“GBP”
}
}