WooCommerce REST API(订阅):创建续订订单,已连接到订阅

时间:2019-09-09 12:32:15

标签: rest woocommerce subscription

我可以成功地使用REST-API(通过Zapier)创建订单,但是我无法获得该新订单以连接到相关订阅。

在请求中发送的JSON中,我尝试将parent_id设置为订阅ID,并使用“ order_type”:“ renewal_order”,但是订单永远不会最终连接到订阅。

{
    "payment_method": "stripe",
    "payment_method_title": "Test JR Stripe",
    "billing_company": "PP",
    "customer_id": 6035,
    "order_type": "renewal_order", 
    "parent_id": "64150", 
    "currency": "EUR",
    "set_paid": true,
    "date": "{{65371588__payment_date}}",
    "billing": {
        "first_name": "J2",
        "last_name": "R",
        "country": "PT",
        "email": "example@gmail.com"},
    "line_items": [{
        "product_id": 60198,
        "quantity": 1,
        "subtotal": "{{65371588__mc_gross}}",
        "subtotal_tax": "0.00",
        "total": "{{65371588__mc_gross}}",
        "total_tax": "0.00",
        "type": "subscription"
    }]
}

在Wordpress数据库中,没有为该订单创建_subscription_renewal元(我相信这是用于将订单链接到其订阅的字段)。在Wordpress管理员中,顺序也显示为未链接到任何订阅。

我要尝试做不可能的事吗?使用WooCommerce REST API是否有可能?预先感谢!

0 个答案:

没有答案