WooCommerce REST API 文档

title: "Webhooks #" post_status: publish comment_status: open taxonomy: category: - woocommerce-rest-api post_tag: - Wp Api V1 - Includes - Source


Webhooks

Webhooks API 允许您创建、查看、更新和删除单个或批量 Webhook。

Webhook 可以通过 WooCommerce 设置界面或使用 REST API 端点进行管理。WC_Webhook 类负责管理 Webhook 自定义文章类型的所有数据存储和检索,以及将 Webhook 操作加入队列并处理/发送/记录 Webhook。在 woocommerce_init 时,会加载所有活跃的 Webhook。

每个 Webhook 包含:

主题

主题是资源(例如订单)和事件(例如创建)的组合,并映射到一个或多个钩子名称(例如 woocommerce_checkout_order_processed)。可以使用主题名称创建 Webhook,相应的钩子会自动添加。

核心主题包括:

也可以使用自定义主题,它们映射到单个钩子名称。例如,您可以添加一个主题为 action.woocommerce_add_to_cart 的 Webhook,该 Webhook 会在该事件触发时执行。自定义主题会将第一个钩子参数传递给有效载荷,因此在此示例中,cart_item_key 将包含在有效载荷中。

交付/负载

交付使用 wp_remote_post()(HTTP POST)执行,默认通过 wp-cron 在后台处理。请求中添加了一些自定义标头,以帮助接收方处理 webhook:

负载采用 JSON 编码,对于 API 资源(优惠券、客户、订单、产品),响应与通过 REST API 请求时完全相同。

日志记录

请求/响应会以评论形式记录在 webhook 自定义文章类型中。每条投递日志包含:

为减少评论表膨胀,仅保留最近的 25 条投递日志。

连续 5 次投递失败(定义为非 HTTP 2xx 响应代码)后,webhook 将被禁用,必须通过 REST API 编辑才能重新启用。

可通过 REST API 端点或使用 WC_Webhook::get_delivery_logs() 代码获取投递日志。

可视化界面

您可以在 "WooCommerce" > "设置" > "API" > "Webhooks" 中找到 Webhooks 界面,更多详情请参阅我们的可视化 Webhooks 文档

Webhook properties

Attribute Type Description
id integer Unique identifier for the resource. read-only
name string A friendly name for the webhook. Default is Webhook created on <date>.
status string Webhook status. Default is active. Options active (delivers payload), paused (does not deliver), or disabled (does not deliver due delivery failures).
topic string Webhook topic, e.g. coupon.updated. See the complete list. required
resource string Webhook resource, e.g. coupon read-only
event string Webhook event, e.g. updated read-only
hooks array WooCommerce action names associated with the webhook. read-only
delivery_url string The URL where the webhook payload is delivered. required
secret string Secret key used to generate a hash of the delivered webhook and provided in the request headers. required write-only
date_created date-time UTC DateTime when the webhook was created read-only
date_modified date-time UTC DateTime when the webhook was last updated read-only

Webhooks delivery properties

Attribute Type Description
id integer Unique identifier for the resource. read-only
duration string The delivery duration, in seconds. read-only
summary string A friendly summary of the response including the HTTP response code, message, and body. read-only
request_url string The URL where the webhook was delivered. read-only
request_headers array Request headers. See Request Headers Attributes for more details. read-only
request_body string Request body. read-only
response_code string The HTTP response code from the receiving server. read-only
response_message string The HTTP response message from the receiving server. read-only
response_headers array Array of the response headers from the receiving server. read-only
response_body string The response body from the receiving server. read-only
date_created date-time The date the webhook delivery was logged, in the site's timezone. read-only

Request header properties

Attribute Type Description
User-Agent string The request user agent, default is "WooCommerce/{version} Hookshot (WordPress/{version})". read-only
Content-Type string The request content-type, default is "application/json". read-only
X-WC-Webhook-Topic string The webhook topic. read-only
X-WC-Webhook-Resource string The webhook resource. read-only
X-WC-Webhook-Event string The webhook event. read-only
X-WC-Webhook-Signature string A base64 encoded HMAC-SHA256 hash of the payload. read-only
X-WC-Webhook-ID integer The webhook's ID. read-only
X-WC-Webhook-Delivery-ID integer The delivery ID. read-only

创建 Webhook

此 API 可帮助您创建一个新的 webhook。

HTTP 请求

POST
/wp-json/wc/v1/webhooks
curl -X POST https://example.com/wp-json/wc/v1/webhooks \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "name": "Order updated",
  "topic": "order.updated",
  "delivery_url": "http://requestb.in/1g0sxmo1"
}'
const data = {
  name: "Order updated",
  topic: "order.updated",
  delivery_url: "http://requestb.in/1g0sxmo1"
};

WooCommerce.post("webhooks", data)
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php
$data = [
    'name' => 'Order updated',
    'topic' => 'order.updated',
    'delivery_url' => 'http://requestb.in/1g0sxmo1'
];

print_r($woocommerce->post('webhooks', $data));
?>
data = {
    "name": "Order updated",
    "topic": "order.updated",
    "delivery_url": "http://requestb.in/1g0sxmo1"
}

print(wcapi.post("webhooks", data).json())
data = {
  name: "Order updated",
  topic: "order.updated",
  delivery_url: "http://requestb.in/1g0sxmo1"
}

woocommerce.post("webhooks", data).parsed_response

JSON 响应示例:

{
  "id": 142,
  "name": "Order updated",
  "status": "active",
  "topic": "order.updated",
  "resource": "order",
  "event": "updated",
  "hooks": [
    "woocommerce_process_shop_order_meta",
    "woocommerce_api_edit_order",
    "woocommerce_order_edit_status",
    "woocommerce_order_status_changed"
  ],
  "delivery_url": "http://requestb.in/1g0sxmo1",
  "date_created": "2016-05-15T20:17:52",
  "date_modified": "2016-05-15T20:17:52",
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks"
      }
    ]
  }
}

Retrieve a webhook

This API lets you retrieve and view a specific webhook.

HTTP request

GET
/wp-json/wc/v1/webhooks/<id>
curl https://example.com/wp-json/wc/v1/webhooks/142 \
    -u consumer_key:consumer_secret
WooCommerce.get("webhooks/142")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->get('webhooks/142')); ?>
print(wcapi.get("webhooks/142").json())
woocommerce.get("webhooks/142").parsed_response

JSON response example:

{
  "id": 142,
  "name": "Order updated",
  "status": "active",
  "topic": "order.updated",
  "resource": "order",
  "event": "updated",
  "hooks": [
    "woocommerce_process_shop_order_meta",
    "woocommerce_api_edit_order",
    "woocommerce_order_edit_status",
    "woocommerce_order_status_changed"
  ],
  "delivery_url": "http://requestb.in/1g0sxmo1",
  "date_created": "2016-05-15T20:17:52",
  "date_modified": "2016-05-15T20:17:52",
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks"
      }
    ]
  }
}

List all webhooks

This API helps you to view all the webhooks.

HTTP request

GET
/wp-json/wc/v1/webhooks
curl https://example.com/wp-json/wc/v1/webhooks \
    -u consumer_key:consumer_secret
WooCommerce.get("webhooks")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->get('webhooks')); ?>
print(wcapi.get("webhooks").json())
woocommerce.get("webhooks").parsed_response

JSON response example:

[
  {
    "id": 143,
    "name": "Customer created",
    "status": "active",
    "topic": "customer.created",
    "resource": "customer",
    "event": "created",
    "hooks": [
      "user_register",
      "woocommerce_created_customer",
      "woocommerce_api_create_customer"
    ],
    "delivery_url": "http://requestb.in/1g0sxmo1",
    "date_created": "2016-05-15T20:17:52",
    "date_modified": "2016-05-15T20:17:52",
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/143"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks"
        }
      ]
    }
  },
  {
    "id": 142,
    "name": "Order updated",
    "status": "active",
    "topic": "order.updated",
    "resource": "order",
    "event": "updated",
    "hooks": [
      "woocommerce_process_shop_order_meta",
      "woocommerce_api_edit_order",
      "woocommerce_order_edit_status",
      "woocommerce_order_status_changed"
    ],
    "delivery_url": "http://requestb.in/1g0sxmo1",
    "date_created": "2016-05-15T20:17:52",
    "date_modified": "2016-05-15T20:17:52",
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks"
        }
      ]
    }
  }
]

Available parameters

Parameter Type Description
context string Scope under which the request is made; determines fields present in response. Options: view and edit.
page integer Current page of the collection.
per_page integer Maximum number of items to be returned in result set.
search string Limit results to those matching a string.
after string Limit response to resources published after a given ISO8601 compliant date.
before string Limit response to resources published before a given ISO8601 compliant date.
dates_are_gmt boolean Interpret after and before as UTC dates when true.
exclude string Ensure result set excludes specific ids.
include string Limit result set to specific ids.
offset integer Offset the result set by a specific number of items.
order string Order sort attribute ascending or descending. Default is asc. Options: asc and desc.
orderby string Sort collection by object attribute. Default is date, Options: date, id, include, title and slug.
slug string Limit result set to posts with a specific slug.
status string Limit result set to webhooks assigned a specific status. Default is all. Options: all, active, paused and disabled.

Update a webhook

This API lets you make changes to a webhook.

HTTP request

PUT
/wp-json/wc/v1/webhook/<id>
curl -X PUT https://example.com/wp-json/wc/v1/webhook/142 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "status": "paused"
}'
const data = {
  status: "paused"
}

WooCommerce.put("webhooks/142", data)
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php
$data = [
    'status' => 'paused'
];

print_r($woocommerce->put('webhooks/142', $data));
?>
data = {
    "status": "paused"
}

print(wcapi.put("webhooks/142", data).json())
data = {
  status: "paused"
}

woocommerce.put("webhooks/142", data).parsed_response

JSON response example:

{
  "id": 142,
  "name": "Order updated",
  "status": "paused",
  "topic": "order.updated",
  "resource": "order",
  "event": "updated",
  "hooks": [
    "woocommerce_process_shop_order_meta",
    "woocommerce_api_edit_order",
    "woocommerce_order_edit_status",
    "woocommerce_order_status_changed"
  ],
  "delivery_url": "http://requestb.in/1g0sxmo1",
  "date_created": "2016-05-15T20:17:52",
  "date_modified": "2016-05-15T20:30:12",
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks"
      }
    ]
  }
}

Delete a webhook

This API helps you delete a webhook.

HTTP request

DELETE
/wp-json/wc/v1/webhooks/<id>
curl -X DELETE https://example.com/wp-json/wc/v1/webhooks/142 \
    -u consumer_key:consumer_secret
WooCommerce.delete("webhooks/142")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->delete('webhooks/142')); ?>
print(wcapi.delete("webhooks/142").json())
woocommerce.delete("webhooks/142").parsed_response

JSON response example:

{
  "id": 142,
  "name": "Order updated",
  "status": "paused",
  "topic": "order.updated",
  "resource": "order",
  "event": "updated",
  "hooks": [
    "woocommerce_process_shop_order_meta",
    "woocommerce_api_edit_order",
    "woocommerce_order_edit_status",
    "woocommerce_order_status_changed"
  ],
  "delivery_url": "http://requestb.in/1g0sxmo1",
  "date_created": "2016-05-15T20:17:52",
  "date_modified": "2016-05-15T20:30:12",
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks"
      }
    ]
  }
}

Available parameters

Parameter Type Description
force string Use true whether to permanently delete the webhook, Defaults is false.

批量更新 Webhook

此 API 可帮助您批量创建、更新和删除多个 Webhook。

HTTP request

POST
/wp-json/wc/v1/webhooks/batch
curl -X POST https://example.com//wp-json/wc/v1/webhooks/batch \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "create": [
    {
      "name": "Coupon created",
      "topic": "coupon.created",
      "delivery_url": "http://requestb.in/1g0sxmo1"
    },
    {
      "name": "Customer deleted",
      "topic": "customer.deleted",
      "delivery_url": "http://requestb.in/1g0sxmo1"
    }
  ],
  "delete": [
    143
  ]
}'
const data = {
  create: [
    {
      name: "Round toe",
      topic: "coupon.created",
      delivery_url: "http://requestb.in/1g0sxmo1"
    },
    {
      name: "Customer deleted",
      topic: "customer.deleted",
      delivery_url: "http://requestb.in/1g0sxmo1"
    }
  ],
  delete: [
    143
  ]
};

WooCommerce.post("webhooks/batch", data)
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php
$data = [
    'create' => [
        [
            'name' => 'Round toe',
            'topic' => 'coupon.created',
            'delivery_url' => 'http://requestb.in/1g0sxmo1'
        ],
        [
            'name' => 'Customer deleted',
            'topic' => 'customer.deleted',
            'delivery_url' => 'http://requestb.in/1g0sxmo1'
        ]
    ],
    'delete' => [
        143
    ]
];

print_r($woocommerce->post('webhooks/batch', $data));
?>
data = {
    "create": [
        {
            "name": "Round toe",
            "topic": "coupon.created",
            "delivery_url": "http://requestb.in/1g0sxmo1"
        },
        {
            "name": "Customer deleted",
            "topic": "customer.deleted",
            "delivery_url": "http://requestb.in/1g0sxmo1"
        }
    ],
    "delete": [
        143
    ]
}

print(wcapi.post("webhooks/batch", data).json())
data = {
  create: [
    {
      name: "Round toe",
      topic: "coupon.created",
      delivery_url: "http://requestb.in/1g0sxmo1"
    },
    {
      name: "Customer deleted",
      topic: "customer.deleted",
      delivery_url: "http://requestb.in/1g0sxmo1"
    }
  ],
  delete: [
    143
  ]
}

woocommerce.post("webhooks/batch", data).parsed_response

JSON response example:

{
  "create": [
    {
      "id": 146,
      "name": "Coupon created",
      "status": "active",
      "topic": "coupon.created",
      "resource": "coupon",
      "event": "created",
      "hooks": [
        "woocommerce_process_shop_coupon_meta",
        "woocommerce_api_create_coupon"
      ],
      "delivery_url": "http://requestb.in/1g0sxmo1",
      "date_created": "2016-05-24T22:56:26",
      "date_modified": "2016-05-24T22:56:26",
      "_links": {
        "self": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks/146"
          }
        ],
        "collection": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks"
          }
        ]
      }
    },
    {
      "id": 147,
      "name": "Customer deleted",
      "status": "active",
      "topic": "customer.deleted",
      "resource": "customer",
      "event": "deleted",
      "hooks": [
        "delete_user"
      ],
      "delivery_url": "http://requestb.in/1g0sxmo1",
      "date_created": "2016-05-24T22:56:30",
      "date_modified": "2016-05-24T22:56:30",
      "_links": {
        "self": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks/147"
          }
        ],
        "collection": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks"
          }
        ]
      }
    }
  ],
  "delete": [
    {
      "id": 143,
      "name": "Webhook created on May 24, 2016 @ 03:20 AM",
      "status": "active",
      "topic": "customer.created",
      "resource": "customer",
      "event": "created",
      "hooks": [
        "user_register",
        "woocommerce_created_customer",
        "woocommerce_api_create_customer"
      ],
      "delivery_url": "http://requestb.in/1g0sxmo1",
      "date_created": "2016-05-15T20:17:52",
      "date_modified": "2016-05-15T20:17:52",
      "_links": {
        "self": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks/143"
          }
        ],
        "collection": [
          {
            "href": "https://example.com/wp-json/wc/v1/webhooks"
          }
        ]
      }
    }
  ]
}

检索 Webhook 投递记录

此 API 允许您检索并查看特定的 Webhook 投递记录。

HTTP 请求

GET
/wp-json/wc/v1/webhooks/<id>/deliveries/<delivery_id>
curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54 \
    -u consumer_key:consumer_secret
WooCommerce.get("webhooks/142/deliveries/54")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->get('webhooks/142/deliveries/54')); ?>
print(wcapi.get("webhooks/142/deliveries/54").json())
woocommerce.get("webhooks/142/deliveries/54").parsed_response

JSON 响应示例:

{
  "id": 54,
  "duration": "0.40888",
  "summary": "HTTP 200 OK: ok",
  "request_method": "POST",
  "request_url": "http://requestb.in/1g0sxmo1",
  "request_headers": {
    "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
    "Content-Type": "application/json",
    "X-WC-Webhook-Source": "http://example.com/",
    "X-WC-Webhook-Topic": "order.updated",
    "X-WC-Webhook-Resource": "order",
    "X-WC-Webhook-Event": "updated",
    "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
    "X-WC-Webhook-ID": 142,
    "X-WC-Webhook-Delivery-ID": 54
  },
  "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
  "response_code": "200",
  "response_message": "OK",
  "response_headers": {
    "connection": "close",
    "server": "gunicorn/19.3.0",
    "date": "Tue, 16 May 2016 03:30:31 GMT",
    "content-type": "text/html; charset=utf-8",
    "content-length": "2",
    "sponsored-by": "https://www.runscope.com",
    "via": "1.1 vegur"
  },
  "response_body": "ok",
  "date_created": "2016-05-16T03:30:31",
  "_links": {
    "self": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54"
      }
    ],
    "collection": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
      }
    ],
    "up": [
      {
        "href": "https://example.com/wp-json/wc/v1/webhooks/142"
      }
    ]
  }
}

列出所有 Webhook 投递记录

此 API 可帮助您查看特定 Webhook 的所有投递记录。

HTTP 请求

GET
/wp-json/wc/v1/webhooks/<id>/deliveries
curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries \
    -u consumer_key:consumer_secret
WooCommerce.get("webhooks/142/deliveries")
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.log(error.response.data);
  });
<?php print_r($woocommerce->get('webhooks/142/deliveries')); ?>
print(wcapi.get("webhooks/142/deliveries").json())
woocommerce.get("webhooks/142/deliveries").parsed_response

JSON 响应示例:

[
  {
    "id": 54,
    "duration": "0.40888",
    "summary": "HTTP 200 OK: ok",
    "request_method": "POST",
    "request_url": "http://requestb.in/1g0sxmo1",
    "request_headers": {
      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
      "Content-Type": "application/json",
      "X-WC-Webhook-Source": "http://example.com/",
      "X-WC-Webhook-Topic": "order.updated",
      "X-WC-Webhook-Resource": "order",
      "X-WC-Webhook-Event": "updated",
      "X-WC-Webhook-Signature": "J72iu7hL93aUt2dFnyOBoBypwbmP6nt6Aor33nnOHxU=",
      "X-WC-Webhook-ID": 142,
      "X-WC-Webhook-Delivery-ID": 54
    },
    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:30:30Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
    "response_code": "200",
    "response_message": "OK",
    "response_headers": {
      "connection": "close",
      "server": "gunicorn/19.3.0",
      "date": "Tue, 16 May 2016 03:30:31 GMT",
      "content-type": "text/html; charset=utf-8",
      "content-length": "2",
      "sponsored-by": "https://www.runscope.com",
      "via": "1.1 vegur"
    },
    "response_body": "ok",
    "date_created": "2016-05-16T03:30:31",
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
        }
      ],
      "up": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
        }
      ]
    }
  },
  {
    "id": 53,
    "duration": "0.7615",
    "summary": "HTTP 200 OK: ok",
    "request_method": "POST",
    "request_url": "http://requestb.in/1g0sxmo1",
    "request_headers": {
      "User-Agent": "WooCommerce/2.6.0 Hookshot (WordPress/4.5.2)",
      "Content-Type": "application/json",
      "X-WC-Webhook-Source": "http://example.com/",
      "X-WC-Webhook-Topic": "order.updated",
      "X-WC-Webhook-Resource": "order",
      "X-WC-Webhook-Event": "updated",
      "X-WC-Webhook-Signature": "Z996ccyueeoqdXZFq2ND2ETpsPGrXmWKj+yvQ0c2N1w=",
      "X-WC-Webhook-ID": 142,
      "X-WC-Webhook-Delivery-ID": 53
    },
    "request_body": "{\"order\":{\"id\":118,\"order_number\":118,\"order_key\":\"wc_order_5728e9a347a2d\",\"created_at\":\"2016-05-03T18:10:00Z\",\"updated_at\":\"2016-05-16T03:29:13Z\",\"completed_at\":\"2016-05-16T03:29:19Z\",\"status\":\"completed\",\"currency\":\"BRL\",\"total\":\"14.00\",\"subtotal\":\"4.00\",\"total_line_items_quantity\":2,\"total_tax\":\"0.00\",\"total_shipping\":\"10.00\",\"cart_tax\":\"0.00\",\"shipping_tax\":\"0.00\",\"total_discount\":\"0.00\",\"shipping_methods\":\"Flat Rate\",\"payment_details\":{\"method_id\":\"bacs\",\"method_title\":\"Direct Bank Transfer\",\"paid\":true},\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"},\"note\":\"\",\"customer_ip\":\"127.0.0.1\",\"customer_user_agent\":\"curl/7.47.0\",\"customer_id\":0,\"view_order_url\":\"http://example.com/my-account/view-order/118\",\"line_items\":[{\"id\":8,\"subtotal\":\"4.00\",\"subtotal_tax\":\"0.00\",\"total\":\"4.00\",\"total_tax\":\"0.00\",\"price\":\"2.00\",\"quantity\":2,\"tax_class\":null,\"name\":\"Woo Single #2\",\"product_id\":99,\"sku\":\"12345\",\"meta\":[]}],\"shipping_lines\":[{\"id\":9,\"method_id\":\"flat_rate\",\"method_title\":\"Flat Rate\",\"total\":\"10.00\"}],\"tax_lines\":[],\"fee_lines\":[],\"coupon_lines\":[],\"is_vat_exempt\":false,\"customer\":{\"id\":0,\"email\":\"john.doe@claudiosmweb.com\",\"first_name\":\"John\",\"last_name\":\"Doe\",\"billing_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\",\"email\":\"john.doe@claudiosmweb.com\",\"phone\":\"(555) 555-5555\"},\"shipping_address\":{\"first_name\":\"John\",\"last_name\":\"Doe\",\"company\":\"\",\"address_1\":\"969 Market\",\"address_2\":\"\",\"city\":\"San Francisco\",\"state\":\"CA\",\"postcode\":\"94103\",\"country\":\"US\"}}}}",
    "response_code": "200",
    "response_message": "OK",
    "response_headers": {
      "connection": "close",
      "server": "gunicorn/19.3.0",
      "date": "Tue, 16 May 2016 03:29:20 GMT",
      "content-type": "text/html; charset=utf-8",
      "content-length": "2",
      "sponsored-by": "https://www.runscope.com",
      "via": "1.1 vegur"
    },
    "response_body": "ok",
    "date_created": "2016-05-16T03:29:19",
    "_links": {
      "self": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries/53"
        }
      ],
      "collection": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142/deliveries"
        }
      ],
      "up": [
        {
          "href": "https://example.com/wp-json/wc/v1/webhooks/142"
        }
      ]
    }
  }
]