🖥
#Stripe #API でカスタマー = 顧客を作成・取得する ( 公式ドキュメントのまま ) ( #Ruby )
Command
Ruby
require 'stripe'
Stripe.api_key = 'sk_test_xxxxx'
Stripe::Customer.create({
description: 'Customer for jenny.rosen@example.com',
})
curl
curl https://api.stripe.com/v1/customers -u sk_test_xxxxx: -d description="Customer for jenny.rosen@example.com"
API Doc
example
$ curl -s curl https://api.stripe.com/v1/customers -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: -d description="Customer for jenny.rosen@example.com"
{
"id": "cus_GHaC8VxZWYuwcl",
"object": "customer",
"account_balance": 0,
"address": null,
"balance": 0,
"created": 1575239418,
"currency": null,
"default_source": null,
"delinquent": false,
"description": "Customer for jenny.rosen@example.com",
"discount": null,
"email": null,
"invoice_prefix": "B92698A0",
"invoice_settings": {
"custom_fields": null,
"default_payment_method": null,
"footer": null
},
"livemode": false,
"metadata": {
},
"name": null,
"phone": null,
"preferred_locales": [
],
"shipping": null,
"sources": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_GHa5lNIgPs4wF3/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_GHa5lNIgPs4wF3/subscriptions"
},
"tax_exempt": "none",
"tax_ids": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_GHa5lNIgPs4wF3/tax_ids"
},
"tax_info": null,
"tax_info_verification": null
}
ダッシュボードで確認
発行された customer_id がURLにも反映されるみたいだ
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2019-12-02
Discussion