Reputation: 35
I have been trying to modify the subscription 'status' from 'trialing' to 'active' once the user buys our standard subscription but it doesn't recognize the parameter 'status'.
Post URL : https://api.stripe.com/v1/subscriptions/sub_DlwSiqrLvSArgV
Request body:
{
"Status": "active",
"items": {
"0": {
"id": "si_DlwSpUvFPN6Mje",
"deleted": "true"
},
"1": {
"plan": "plan_Dk4I92tnE0cmXS"
}
}
}
Response:
{ "error": { "code": "parameter_unknown", "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown", "message": "Received unknown parameter: Status", "param": "Status", "type": "invalid_request_error" } }
I'm not sure if I'm putting the status in wrong place or if i need to add some other additional parameter(s) to change the status.
Upvotes: 2
Views: 1471
Reputation: 25552
The status
property is calculated by Stripe and it's not something you can set yourself. It is not in the list of parameters for the Update Subscription API either.
If you want to move a subscription from 'trialing' to 'active' you have to explicitly end the trial period by passing trial_end: "now"
as documented here. This will automatically charge the customer the expected amount and if the charge succeeds it will switch your subscription to active at the same time.
Upvotes: 4