# 更新订单状态

## 订单的状态有哪些？

| Value               | Description |
| ------------------- | ----------- |
| `pending`           | 用户还未支付成功    |
| `processing`        | 确认收款，履约订单   |
| `partially-shipped` | 部分已发货       |
| `shipped`           | 所有商品已发货     |
| `completed`         | 订单已完成       |
| `canceled`          | 订单已取消       |

<figure><img src="/files/3DEuCXXTKM7HLaEI8qJP" alt=""><figcaption></figcaption></figure>

## 如何通知客户通知订单状态的变更？

当订单的状态发生变更时，您可以通过发送order status updates 模板对客户进行通知。

例如：当订单已经发货，您可以给客户发送order status updates 的模板，发送模板时告知客户

### 创建order status updates 模板

{% hint style="info" %}
前提： 您已经完成了收款账户的绑定
{% endhint %}

1、通过接口进行创建

<https://docs.ycloud.com/reference/whatsapp_template-create>

创建的example：

<https://docs.ycloud.com/reference/whatsapp-template-creation-examples#order-status-template>

2、通过页面进行创建

访问：<https://www.ycloud.com/console/#/app/dashboard/template>

<figure><img src="/files/m4gKfL3zXBubsI9PZQ4a" alt=""><figcaption></figcaption></figure>

### 发送Order status updates消息

发送接口：<https://docs.ycloud.com/reference/whatsapp_message-send-directly>

发送的示例：

```
curl 'https://api.ycloud.com/v2/whatsapp/messages/sendDirectly' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: {{YOUR-API-KEY}}' \
-d '{
  "from": "{{BUSINESS-PHONE-NUMBER}}",
  "to": "{{CUSTOMER-PHONE-NUMBER}}",
  "type": "template",
  "template": {
    "name": "order_status_template",
    "language": {
      "policy": "deterministic",
      "code": "en_US"
    },
    "components": [
      {
        "type": "order_status",
        "parameters": [
          {
            "type": "order_status",
            "order_status": {
              "reference_id": "<reference_id_value>",
              "order": {
                "status": "processing | partially_shipped | shipped | completed | canceled",
                "description": "<OPTIONAL_DESCRIPTION>"
              }
            }
          }
        ]
      }
    ]
  }
}'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helpdocs.ycloud.com/help-center/zh/whatsapp-pay/update-order-status.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
