Change Status of Order

Henrique3
Shopify Partner
4 0 1

Hi guys, i need to change the status of order.. But it like impossible, anybody know how can i do this?

I create the order with the status pending.

POST

{
  "order": {
    "email": "foo@example.com",
    "fulfillment_status": "fulfilled",
    "line_items": [
      {
        "variant_id": 44765498,
        "quantity": 1,
        "name" : "teste",
        "price" : "10.00",
        "title" : "teste title"        
      }
    ],
    "financial_status": "pending"
  }
}

 

Now i need to change to “paid”.

PUT

{

  "order": {

    "id": "3311344838",

    "financial_status": “paid"

   }

}

This ins’t to working, the status remains “pending”.

 

Thanks and regards.

 

Replies 26 (26)
Adam_Schaffer
Shopify Partner
29 0 3

This topic is closed but I have the same question. What is the proper way to update the financial status for an order where the money was captured outside of shopify.

 

HunkyBill
Shopify Expert
4612 54 531

Did you try the simple action of creating a transaction?

https://help.shopify.com/api/reference/transaction

You might have some success with that to change the financial status of an order.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
Adam_Schaffer
Shopify Partner
29 0 3

That did the change.

It wasn't clear to me that I could pass a transaction even though I was using an external gateway. This is good to know.

Thanks for your answer.   I appreciate your help. 

Adam_Schaffer
Shopify Partner
29 0 3

An update on this.

I am not clear why but this is not working consistently.  On some orders it did work, and yet on others I am getting:

"No capturable transaction was found"

I can't find enough information in the api reference page to help me debug this. I've tried sending

    {transaction: { kind: 'capture' } }

    {transaction: { kind: 'capture', amount: "NN.NN" } }

and other combinations where I send more data (order number, authorization id, etc).  It's puzzling. What kind of validation does shopify do on the background when one sends a transaction?

I also tried passing kind: 'sale', which should be valid according to the reference page but I then get:

"sale is not a valid transaction"

which makes absolutely no sense to me based on the api spec.

 

Adam_Schaffer
Shopify Partner
29 0 3

Ok. another update. The orders that work are those where I mark as pending via the shopify admin web interface. The ones that are not working are those I created via the API.  I need to now figure out what parameter the web interface is setting that I am not setting and that causes this failure.  Unfortunately I don't see what it could be based on reading the API documentation.  Comparing parameters side by side I see that the following are set by the web page:

  •       payment_gateway_names: [ "manual" ],
  •       processing_method: "manual"

Unfortunately when I try to set these when creating the order via the API (or after order creation) these are not set. Similarly, when I try passing these values as part of the transaction.

So I still have problems with changing the pending status for orders created via the API.

 

Adam_Schaffer
Shopify Partner
29 0 3

Can anyone from Shopify comment on this issue? I can create an order via the API as listed above but I can not then get transactions to this order to be accepted.  I've also tried sending the gateway and payment_gateway_names when I create the order but this makes no difference. Basically any time I try to send a transaction for an order sent via the API I always get "no capturable transactions".  Can someone from shopify confirm is this is simply not supported, or which values in the api I need to set to be able to support this.

One additional point: If I go to the web admin and I push "Mark as Paid" I get the popup to mark as paid but it does not show me a drop down to select any of the configured payment methods.  

This is different from when I hit "Mark as pending" from a Draft order where it asks "Are you going to receive payment outside of shopify?"  

I think *THIS* step is what is missing - what can I do via the API to converts and order into a 'pay outside of shopify' transaction?

Jamie_D_
Shopify Staff (Retired)
531 1 102

The error "no capturable transaction" would indicate that you can't create a capture transaction for an order that doesn't already have an existing transaction.

Orders created via the API do not have any transactions attached to them by default, so you'll need to create an authorization transaction first, or specify a sale transaction which is an authorization and capture all in one.

Hope this helps!

Adam_Schaffer
Shopify Partner
29 0 3

Thanks for getting back to me.

As I mentioned in a previous post, when I use sale the response is:

-> "{\"errors\":{\"kind\":[\"sale is not a valid transaction\"]}}"

It's not clear why it would not accept sale as a transaction. I get the 'not a valid transction error for everything but capture.

Adam_Schaffer
Shopify Partner
29 0 3

Can anyone from shopify help me figure out why the transaction "kind: sale" would respond with "sale is not a valid transaction"?

Here's a sample of my post request:

POSTing to: /admin/orders/3980863237/transactions.json

{
"transaction":{
  "amount":"113.42",
  "kind":"sale",
  "user_id":72,
  "currency":"USD",
  "gateway":"manual"
  }
}

I've tried with and without passing the last 3 fields.