Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$ curl -u $STRIPE_API_KEY: https://api.stripe.com/v1/customers -d plan=monthly
{
"error": {
"type": "invalid_request_error",
"message": "This customer has no attached card"
}
}
$ curl -u $STRIPE_API_KEY: https://api.stripe.com/v1/customers -d plan=monthly -d trial_end=1421427622
{
"object": "customer",
"created": 1421423593,
"id": "cus_5WfkR4vvmYlpX2",
"livemode": false,
"description": null,
"email": null,
"delinquent": false,
"metadata": {},
"subscriptions": {
"object": "list",
"total_count": 1,
"has_more": false,
"url": "/v1/customers/cus_5WfkR4vvmYlpX2/subscriptions",
"data": [
{
"id": "sub_5WfkZb34OPisx4",
"plan": {
"interval": "month",
"name": "Monthly",
"created": 1380491006,
"amount": 10000,
"currency": "usd",
"id": "monthly",
"object": "plan",
"livemode": false,
"interval_count": 1,
"trial_period_days": null,
"metadata": {},
"statement_descriptor": null,
"statement_description": null
},
"object": "subscription",
"start": 1421423593,
"status": "trialing",
"customer": "cus_5WfkR4vvmYlpX2",
"cancel_at_period_end": false,
"current_period_start": 1421423593,
"current_period_end": 1421427622,
"ended_at": null,
"trial_start": 1421423593,
"trial_end": 1421427622,
"canceled_at": null,
"quantity": 1,
"application_fee_percent": null,
"discount": null,
"tax_percent": null,
"metadata": {}
}
],
"count": 1
},
"discount": null,
"account_balance": 0,
"currency": "usd",
"cards": {
"object": "list",
"total_count": 0,
"has_more": false,
"url": "/v1/customers/cus_5WfkR4vvmYlpX2/cards",
"data": [],
"count": 0
},
"default_card": null,
"subscription": {
"id": "sub_5WfkZb34OPisx4",
"plan": {
"interval": "month",
"name": "Monthly",
"created": 1380491006,
"amount": 10000,
"currency": "usd",
"id": "monthly",
"object": "plan",
"livemode": false,
"interval_count": 1,
"trial_period_days": null,
"metadata": {},
"statement_descriptor": null,
"statement_description": null
},
"object": "subscription",
"start": 1421423593,
"status": "trialing",
"customer": "cus_5WfkR4vvmYlpX2",
"cancel_at_period_end": false,
"current_period_start": 1421423593,
"current_period_end": 1421427622,
"ended_at": null,
"trial_start": 1421423593,
"trial_end": 1421427622,
"canceled_at": null,
"quantity": 1,
"application_fee_percent": null,
"discount": null,
"tax_percent": null,
"metadata": {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.