create a draft order in market

pstanek
Shopify Partner
8 0 1

Hello, I have a problem.

I need to create a draft order in my instance in another market. In CZK currency. The main currency is PLN.

I have several markets on each different currency. How to do it? using the REST API

 

i have it but it doesn't work

 

{
"draft_order":{
    "email": "xxxxxxxxx@xxxxx.com",
    "currency": "czk",
    "line_items": [
        {
            "variant_id": "xxxxxxxxxxx",
            "quantity": "1",
             "applied_discount": {
                "value_type": "fixed_amount",
                "value": 149,
                "amount": 447,
                "title": "Promo",
                "description": "Promo"
            }
          
        }
    ]
}
}
Replies 2 (2)

Liam
Shopify Staff
2731 302 777

Hi Pstanek,

 

When creating a draft order, you can't directly set the currency via the currency field in the REST API, so `"currency": "czk",` in your code above won't force currency to be CZK. Instead, the currency is determined by the customer's currency or the store's default currency.

 

Is this draft order for a customer that already has a customer account associated with them? If the draft order doesn't have a specific customer attached to it, Shopify will use the store's default currency for that draft order. However, if the draft order is associated with a specific customer, Shopify will use that customer's default currency for the draft order. You can also manually change the default currency for specific customers in the customers section of the admin. 

 

Hope this helps,

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

pstanek
Shopify Partner
8 0 1

This is for a customer who, after creating an order. via api will be redirected to checkout and pay for the order there. I Such a customer MUST see the CZK currency where he will choose the form of payment, etc.