Update Order

This page describes the request data identifiers and response structure required to update an order (payment status, shipping, etc.).

Data Identifier

{
  "dataID": "UPDATE_ORDER",
  "order_key": "E477FEEBAABBCCDD208AFC505D20C022",
  "payment_status": "PAID",
  "shipping_total": 2500,
  "discount_total": 0,
  "tax_total": 0,
  "shipping_snapshot": {
    "receiver": "Jane Kim",
    "zipcode": "06236",
    "address1": "456 Seolleung-ro, Gangnam-gu, Seoul",
    "address2": "Suite 300"
  },
  "order_extra_data": {
    "memo": "Address changed by customer"
  }
}
KeyDescription
dataIDData identifier UPDATE_ORDER
order_keyOrder key (recommended)
order_seqOrder number (when no order_key)
payment_statusPayment status
currencyCurrency code
shipping_totalShipping fee
discount_totalDiscount
tax_totalTax
shipping_snapshotShipping address JSON (changed only if sent)
order_extra_dataExtra data JSON (changed only if sent)

HTML

<form id="frm_update_order">
  <input type="hidden" name="order_key" value="E477FEEBAABBCCDD208AFC505D20C022">
  <select name="payment_status"><option>UNPAID</option><option>PAID</option><option>REFUNDED</option></select>
  <input name="shipping_total" value="3000.0000">
  <input name="discount_total" value="2000.0000">
  <input name="tax_total" value="0.0000">
  <!-- shipping_snapshot / order_extra_data are JSON objects -->
  <input type="hidden" name="shipping_snapshot" value="{&quot;receiver&quot;:&quot;Jane Kim&quot;,&quot;address1&quot;:&quot;456 Seolleung-ro, Gangnam-gu&quot;,&quot;city&quot;:&quot;Seoul&quot;,&quot;country&quot;:&quot;KR&quot;}">
  <button type="submit" class="btn btn-primary">Save changes</button>
</form>

Response Result

{
  "result": true,
  "result_code": 200,
  "order_seq": 123
}
KeyDescription
resultUpdated or not (true / false)
result_code200 on success
order_seqUpdated order number
  • Screen example (admin order detail → edit): change payment status, shipping fee, discount or address, then save. The response has no amounts, so call GET_ORDER again to show the new grand_total.
  • Items, quantities, unit prices and customer_snapshot cannot be changed here. Use the item status APIs for item status.
  • payment_status: UNPAID / PENDING / PAID / FAILED / REFUND_PENDING / PARTIALLY_REFUNDED / REFUNDED. Any other value returns 400.
  • order_key is the encrypted order number. Use order_key in page URLs and requests; keep order_seq for admin tools. When both are sent, order_key wins.
  • Error codes — errors also come back as HTTP 200. Check result:false, then error_code (string) and error_message.
  • 401 — Login required. Every order API needs a signed-in session.
  • 404 — Order not found. The order_key is wrong or the order was deleted.
  • 400 — Both order_key and order_seq are empty.
  • 400 — Invalid JSON (Invalid shipping_snapshot (must be a JSON object)) or an invalid value.

Example

Edit order ORD-20261015-000123
Shipping address
<script setup>
import { ref } from 'vue'
// Order-level fields only. item_subtotal is derived from items and is not editable here;
// grand_total is recomputed from subtotal + shipping - discount + tax.
const form = ref({ payment_status: 'PAID', shipping_total: '3000.0000', discount_total: '2000.0000', tax_total: '0.0000' })
const address = ref({ receiver: 'Jane Kim', phone: '010-2222-3333', zipcode: '06236', address1: '456 Seolleung-ro, Gangnam-gu', address2: 'Suite 300', city: 'Seoul', country: 'KR' })
const msg = ref('')
async function save() {
  const { output } = await useNuxtApp().$connector({
    dataID: 'UPDATE_ORDER', order_key: 'E477FEEBAABBCCDD208AFC505D20C022',
    ...form.value, shipping_snapshot: address.value
  })
  msg.value = output.result ? `Updated order #${output.order_seq}` : 'Update failed'
}
</script>

<template>
  <form class="card shadow-sm p-4" @submit.prevent="save">
    <h5 class="mb-3">Edit order ORD-20261015-000123</h5>
    <div class="row g-3">
      <div class="col-md-4"><label class="form-label">Payment status</label>
        <select class="form-select" v-model="form.payment_status"><option>UNPAID</option><option>PAID</option><option>REFUNDED</option></select></div>
      <div class="col-md-4"><label class="form-label">Shipping total</label><input class="form-control" v-model="form.shipping_total"></div>
      <div class="col-md-4"><label class="form-label">Discount total</label><input class="form-control" v-model="form.discount_total"></div>
    </div>
    <h6 class="mt-4">Shipping address</h6>
    <div class="row g-3">
      <div class="col-md-6"><label class="form-label">Receiver</label><input class="form-control" v-model="address.receiver"></div>
      <div class="col-md-6"><label class="form-label">Phone</label><input class="form-control" v-model="address.phone"></div>
      <div class="col-12"><label class="form-label">Address</label><input class="form-control" v-model="address.address1"></div>
    </div>
    <button class="btn btn-primary mt-3">Save changes</button>
    <p class="mt-2 text-success">{{ msg }}</p>
  </form>
</template>
<?php
$requestData = [
    'dataID'         => 'UPDATE_ORDER',
    'order_key'      => 'E477FEEBAABBCCDD208AFC505D20C022',  // or 'order_seq' => 123
    'payment_status' => 'PAID',
    'currency'       => 'KRW',
    'shipping_total' => '3000.0000',
    'discount_total' => '2000.0000',
    'tax_total'      => '0.0000',
    'shipping_snapshot' => [
        'receiver' => 'Jane Kim', 'phone' => '010-2222-3333',
        'zipcode'  => '06236', 'address1' => '456 Seolleung-ro, Gangnam-gu', 'city' => 'Seoul', 'country' => 'KR',
    ],
];
$output = $connector->request($requestData);

// grand_total is recomputed server-side; item_subtotal stays item-derived.
echo $output['result'] ? 'Updated order #' . $output['order_seq'] : 'Update failed';