Tokens
Token resource


>>>

POST /api/v1/tokens
Create a token

Create a token

サンプル

  • クレジットカード
  • コンビニ
  • 銀行振込
  • PayEasy
  • WebMoney
  • ビットキャッシュ
  • nanaco
  • NET CASH
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=nanaco" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=steam_prepaid_card" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=foo@bar.com" \
  -d "payment_details[return_url]=http://example.com" \
  -d "payment_details[type]=zgold" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[family_name]=Yamada" \
  -d "payment_details[given_name]=Taro" \
  -d "payment_details[month]=01" \
  -d "payment_details[number]=4111111111111111" \
  -d "payment_details[type]=credit_card" \
  -d "payment_details[verification_value]=123" \
  -d "payment_details[year]=2023" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=bit_cash" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[expiry_days]=14" \
  -d "payment_details[family_name]=山田" \
  -d "payment_details[family_name_kana]=ヤマダ" \
  -d "payment_details[given_name]=太郎" \
  -d "payment_details[given_name_kana]=タロウ" \
  -d "payment_details[phone]=080-1111-2222" \
  -d "payment_details[type]=bank_transfer" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[expiry_days]=3" \
  -d "payment_details[phone]=090-1111-2222" \
  -d "payment_details[store]=lawson" \
  -d "payment_details[type]=konbini" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=net_cash" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=web_money" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "currency=KRW" \
  -d "payment_details[email]=foo@bar.com" \
  -d "payment_details[type]=mobile" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[culture_id]=11111111" \
  -d "payment_details[culture_password]=11111111" \
  -d "payment_details[type]=culture_voucher" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[happy_money_id]=11111111" \
  -d "payment_details[happy_money_password]=11111111" \
  -d "payment_details[type]=happy_money" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[type]=dospara" \
  -d "payment_details[user_no]=12345" \
  -d "payment_details[user_password]=password" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=foo@bar.com" \
  -d "payment_details[type]=toss" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[family_name]=山田" \
  -d "payment_details[family_name_kana]=ヤマダ" \
  -d "payment_details[given_name]=太郎" \
  -d "payment_details[given_name_kana]=タロウ" \
  -d "payment_details[phone]=080-1111-2222" \
  -d "payment_details[type]=pay_easy" 
curl -X POST https://komoju.com/api/v1/tokens \
  -u sk_123456: \
  -d "payment_details[email]=foo@bar.com" \
  -d "payment_details[type]=cvs" 
{
  "id": "tok_a70369047b32d3307eda3dc26c773d8c199208f608618d54e547a390e17111e68obzezpgn307rk2541oc6icuf",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "nanaco",
    "email": "test@example.com"
  }
}
{
  "id": "tok_9f4b808dcd579d6ba7e725fcc343a5baa5a5474dd000915da201f6da7a7352e8eddhhcq7pcinip6m294uvrcgw",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "steam_prepaid_card",
    "email": "test@example.com"
  }
}
{
  "id": "tok_5075fad34482402381a05de93f7882a498e6d9aea941394f34fa1f3786064dce9pxr4cc6odrsicn1ry7c8vcm2",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "zgold",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_0da4036de291ce5fafa6c7a0f481ecbb5d76b22305dad6932f9b071e6ec83990ckeynlt7f0k8yil28jyngk3o8",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "credit_card",
    "given_name": "Taro",
    "family_name": "Yamada",
    "email": "test@example.com"
  }
}
{
  "id": "tok_dcf5c9cd98d495844114a661151fe0fcbcd21338d9b21047751e2453dd937a9b07les9hxxiuhio9i68dm6mahe",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "bit_cash",
    "email": "test@example.com"
  }
}
{
  "id": "tok_8f4a177fe74746e86c3debcaeb89054a615a589f566de16158cdec2c3277d946263lh4jlsdworm34u7t0j8fo1",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "bank_transfer",
    "given_name": "太郎",
    "family_name": "山田",
    "given_name_kana": "タロウ",
    "family_name_kana": "ヤマダ",
    "phone": "080-1111-2222",
    "email": "test@example.com"
  }
}
{
  "id": "tok_254edaa9d99b88958645823eb291e85fc1edb26bf6ffb513a9ff413df3039da30wtj6mjsfxwxmbtkablz08cw9",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "konbini",
    "store": "lawson",
    "email": "test@example.com",
    "phone": "090-1111-2222"
  }
}
{
  "id": "tok_5d490fa063ab688995bcebb4362a23d519846c264661890d08acbd28b3c587699nclo6cilizojpi6b0mc1y34n",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "net_cash",
    "email": "test@example.com"
  }
}
{
  "id": "tok_f499ddf20a0b616661a399d46b2f06f7e45f9050599043fa911b65da11d4243a6q8xgh05dti42igg9c0httwyv",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "web_money",
    "email": "test@example.com"
  }
}
{
  "id": "tok_92da3bee1921b03f0fb09771431eb015b6eb5d6923d3605feca42331027b6cfa5qme4br17bge3oogpslnc2g5s",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "mobile",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_0ea97047d6a5b72403d6f381d3d5a66a790781928fdcf3a987c2273e325a00315c7xqwrcgl8kwda7ylle6892x",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "culture_voucher"
  }
}
{
  "id": "tok_a3dca10fdd3df78d4ad103fc013773a56a9c746088797114e45ab951cc14462ee9o6lnosugryci14dg8mf0t5o",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "happy_money"
  }
}
{
  "id": "tok_504735d413b0ed2c62a5abca41aaf01b2b30a5cead4c11954e3bf1cc2d98ee2865u64krt2mdc9kl0bqn7wxvot",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "dospara"
  }
}
{
  "id": "tok_a373dad10a7e4b54392e39a581fbe994cf0dc2a0d850404067c1b2abf89931257jsjxnd0h5yw1o301ycztm7ve",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "toss",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_91d8b115db58161ca235d37cadd8e42f18944828e23618ed83b442f1ab429286e7z7qmwoimepkg8m5n2vvdxgq",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "pay_easy",
    "given_name": "太郎",
    "family_name": "山田",
    "given_name_kana": "タロウ",
    "family_name_kana": "ヤマダ",
    "phone": "080-1111-2222",
    "email": "test@example.com"
  }
}
{
  "id": "tok_c84b9833a5d07de619358f3a6aa3856ebd5c74fc9ea4a5dcedbd464828f0d46771ybmtm3sxw2yprdgrfgp6sro",
  "resource": "token",
  "created_at": "2018-10-15T03:13:55Z",
  "payment_details": {
    "type": "cvs",
    "email": "foo@bar.com"
  }
}

パラメータ

名前 説明
payment_details
必須
A hash or token describing the payment method used to make the payment.
currency
任意
3 letter ISO currency code of the transaction