Chargify取消订阅:如何设置取消消息

时间:2017-04-06 21:17:49

标签: chargify

The doc表示您可以在发送请求时使用cancellation_message参数/字段。我已尝试过两个网址参数和JSON正文中的字段,但这些参数都没有将响应中的cancellation_message设置为null以外的任何内容。

curl -H "authorization":"Basic somelongkeybase64=" -X DELETE https://myapp.chargify.com/subscriptions/17356012.json?cancellation_message=Application%20deleted

curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"cancellation_message":"Application deleted"}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json

我错过了什么吗?

1 个答案:

答案 0 :(得分:1)

Chargify支持团队得到了答案。 cancellation_message应该包含在请求正文中的subscription中:

{
  'subscription': {
    'cancellation_message': 'Canceling the subscription via the API'
   }
}

因此,工作curl请求如下所示:

curl -H "authorization":"Basic somelongkeybase64=" -H Content-Type:application/json -d '{"subscription":{"cancellation_message":"Application deleted"}}' -X DELETE https://myapp.chargify.com/subscriptions/17356169.json

希望它也可以帮助别人。

相关问题