MNASATI - API Docs
  • Introduction
  • Authentication
  • Limitation
  • Pagination
  • SSL Settings
  • API Methods
    • Authorization
    • Branches
    • Brands List
      • Delete Brand
      • Update Brand
      • Create Brand
    • List Categories
      • Create Category
      • Update Category
    • Countries
      • Cities
    • Customer List
      • Create customer
    • Order List
      • Update Order Status
      • Order Status List
      • Order Status History
    • Payment Methods
    • Product List
      • Product Update
      • Create Product
      • Delete Product
      • Update Product Status
    • Taxes List
    • Vouchers
Powered by GitBook
On this page
  • Update order status
  • Examples

Was this helpful?

  1. API Methods
  2. Order List

Update Order Status

Update order status

POST https://sandbox.mnasati.com/v1/update_order_status

This endpoint allows you to update the status of an order.

Headers

Name
Type
Description

Authentication

string

Authentication token to track down who is emptying our stocks.

Request Body

Name
Type
Description

sale_code

string

e.g "ZBXL-6324"

order_status

string

e.g "preparing"

comment

string

Add comment to order for reference.

{
   "status":true,
   "message":"Order status changed successfully"
}
{    "message": "Not found."}

Examples

import http.client

conn = http.client.HTTPSConnection("papi.gallarias.com")

payload = "{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}"

headers = {
    'Content-Type': "",
    'Authorization-Jwt': ""
    }

conn.request("POST", "/v1/update_order_status", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://sandbox.mnasati.com/v1/update_order_status",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}",
  CURLOPT_HTTPHEADER => [
    "Authorization-Jwt: ",
    "Content-Type: "
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}");
Request request = new Request.Builder()
  .url("https://sandbox.mnasati.com/v1/update_order_status")
  .post(body)
  .addHeader("Content-Type", "")
  .addHeader("Authorization-Jwt", "")
  .build();

Response response = client.newCall(request).execute();
var client = new HttpClient();
var request = new HttpRequestMessage
{
    Method = HttpMethod.Post,
    RequestUri = new Uri("https://sandbox.mnasati.com/v1/update_order_status"),
    Headers =
    {
        { "Content-Type", "" },
        { "Authorization-Jwt", "" },
    },
    Content = new StringContent("{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}")
    {
        Headers =
        {
            ContentType = new MediaTypeHeaderValue("application/json")
        }
    }
};
using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Console.WriteLine(body);
}
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.mnasati.com/v1/update_order_status")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = ''
request["Authorization-Jwt"] = ''
request.body = "{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}"

response = http.request(request)
puts response.read_body
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://sandbox.mnasati.com/v1/update_order_status"

	payload := strings.NewReader("{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "")
	req.Header.Add("Authorization-Jwt", "")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
import Foundation

let headers = [
  "Content-Type": "",
  "Authorization-Jwt": ""
]
let parameters = [
  "sale_code": "ZBXL-6324",
  "order_status": "preparing",
  "comment": "test comment"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.mnasati.com/v1/update_order_status")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
const settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox.mnasati.com/v1/update_order_status",
  "method": "POST",
  "headers": {
    "Content-Type": "",
    "Authorization-Jwt": ""
  },
  "processData": false,
  "data": "{\"sale_code\":\"ZBXL-6324\",\"order_status\":\"preparing\",\"comment\":\"test comment\"}"
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
PreviousOrder ListNextOrder Status List

Last updated 4 years ago

Was this helpful?