d
Topic
yeza Member
Posts:
4
Last edited August 19, 2016
g
1
upvotes

How to Update "pending" transaction status of an Order ? This post is outdated

How exactly to do this, I did as shown on documentation  but the result is always gone wrong.

First, I posted an order with transaction status "pending" 
 

{
   "order":{
      "transactions":[
         {
            "kind":"authorization",
            "status":"pending",
            "amount":6400000
         }
      ],
      "line_items":[
         {
            "variant_id":21063243585,
            "quantity":1
         },
         {
            "variant_id":21063482369,
            "quantity":1
         }
      ],
      "customer":{
         "customer_id":"3100589825"
      },
      "financial_status":"pending",
      "shipping_address":{
         "first_name":"-",
         "last_name":"-",
         "address1":"-",
         "phone":"-",
         "city":"Jakarta Barat",
         "province":"Jakarta",
         "country":"Indonesia",
         "zip":"-"
      },
      "subtotal_price":6400000,
      "total_price":6440000,
      "currency":"IDR",
      "email":"-",
      "total_weight":4000,
      "gateway":"veritrans",
      "shipping_lines":[
         {
            "code":"PELIKAN",
            "price":40000,
            "source":"-",
            "title":"Unknown service",
            "carrier_identifier":"JNE"
         }
      ]
   }
}

And then, I want to update the transaction status after completed the payment, 

{
    "transaction": 
      {
        "kind": "authorization",
        "status": "success"
      }
    }

But the response 

{
  "errors": {
    "kind": [
      "authorization is not a valid transaction"
    ]
  }
}