Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: create a draft order in market

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
Community Manager
3108 344 889

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.