Tokens

>>>

POST /api/v1/tokens
Create a token

Create a token

Examples

  • Credit Card
  • Konbini
  • Bank transfer
  • PayEasy
  • WebMoney
  • BitCash
  • nanaco
  • NET CASH
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 "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[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[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]=web_money" 
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[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[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[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]=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[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]=foo@bar.com" \
  -d "payment_details[type]=cvs" 
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]=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[happy_money_id]=11111111" \
  -d "payment_details[happy_money_password]=11111111" \
  -d "payment_details[type]=happy_money" 
{
  "id": "tok_c6bb3278d52809dda7d1dd3548541358efc6143b2b741becf40fd6265a97a6a85tdizbp22sszmsurhq4rp0tqv",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "dospara"
  }
}
{
  "id": "tok_e9c7e565930002b48f0f56c8fbc62e976ea47a2887e7b5c58644f11c012c241calaseqdso7bgusjnl5cd1osyh",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "mobile",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_bcc1a5c7c88cada8d9dbf82ad00baa416d871e1004ac12b57d0433871dc74cf1e274wjee5u4v33bspa6m7rppz",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "net_cash",
    "email": "test@example.com"
  }
}
{
  "id": "tok_b5184b2a022c6f229d643a472ce0eb01b60e3fa16bfbe880718163277ba33c7b39kxzc14p9yoj69fvp8awml07",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "credit_card",
    "given_name": "Taro",
    "family_name": "Yamada",
    "email": "test@example.com"
  }
}
{
  "id": "tok_82bfeb5592ae019dc1dac1d66dddf16e1bd551791f00a3145e4bdcfb7963c31514gopmjnw1cnxrb117ga8hynz",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "web_money",
    "email": "test@example.com"
  }
}
{
  "id": "tok_4840ea6cb4d81070555269aedb874968c06da9f8128d45259a7df845f5b725d16ki1a53ag9on4ek82vzwpvmoo",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "bit_cash",
    "email": "test@example.com"
  }
}
{
  "id": "tok_a651ef777eae94c700a478cfa52b2055fddefd31a9b5eeae7e79756fc1c0c22b40dmztfsnj4m25zxdcobsemb2",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "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_1e317dd48729c4dcbb53db51e75f4483ee780007a1c47201e00245db49a8c06e2rro8s4sre4a57q5mmtsnte7v",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "culture_voucher"
  }
}
{
  "id": "tok_74babbdd1f0983776eefc6c82adf61a4d88d92a3b3687e2bb9c19db812c8b9cdeup8t885ljaxusnb30yo85zpi",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "zgold",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_3973b16d57e66bde8ac9b175e5709b78c8a45115eb737acb8f8b8a25ba081db616mpj5fzjdorz1ciytwfni1bn",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "toss",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_8da75d9f0aef068bf9b35c7697738bb9c9184ea8a20448ea78a31b3dd7708476brfybahp49x9ynuypcc9wlnb6",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "konbini",
    "store": "lawson",
    "email": "test@example.com",
    "phone": "090-1111-2222"
  }
}
{
  "id": "tok_1dc891878fe81a29bd38a4a6d24e78963335c029fb1e4e826c27509b3de4871173g3mcrc2fd17hr7yuslj1l3c",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "cvs",
    "email": "foo@bar.com"
  }
}
{
  "id": "tok_d7fc72f1fc1b3d0b3b0dc0211d96a99de6287261161019f9ae7aff86b58531829di4sltcu2xrr5kl34w10wllq",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "nanaco",
    "email": "test@example.com"
  }
}
{
  "id": "tok_b419b726539abcd2bd97d9e619f50ef9e9adeba9e0a59d39dcf0768d95d9d35e3g0sa2trox1ayppe8hlv17h3c",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "steam_prepaid_card",
    "email": "test@example.com"
  }
}
{
  "id": "tok_c139072b0858604e8361bf6132fec91ba8c70abb08c7a23013455cf9fac8064302ux8tysnohwkqsyftz2tpegr",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "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_8dfae073c3cf9f451231b74618fcebec9f087144306a89d129ea05613d93c4cc9e6cir3nfxa0gkm3i3vcpjjoo",
  "resource": "token",
  "created_at": "2018-11-13T06:20:21Z",
  "payment_details": {
    "type": "happy_money"
  }
}

Params

Param name Description
payment_details
required
A hash or token describing the payment method used to make the payment.
currency
optional
3 letter ISO currency code of the transaction