是的,可以使用Bigcommerce API中的“自定义订单属性”功能来为订单添加自定义字段和行项目属性。
以下是如何使用Bigcommerce API添加自定义订单属性的示例代码:
POST /stores/{store_hash}/v2/orders/{order_id}/attributes.json
请求体:
{
"name": "custom_field_name",
"value": "custom_field_value"
}
GET /stores/{store_hash}/v2/orders/{order_id}/attributes.json
POST /stores/{store_hash}/v2/orders/{order_id}/products/{product_id}/attributes.json
请求体:
{
"name": "custom_field_name",
"value": "custom_field_value"
}
GET /stores/{store_hash}/v2/orders/{order_id}/products/{product_id}/attributes.json
请注意,该示例代码仅适用于添加和获取单个自定义属性。您可以根据需要添加和获取多个自定义属性。