The Komoju v1 API provides a RESTful HTTP interface for creating payments. You can view a detailed breakdown of each resource in the resources page.

Currently the API supports eight payment methods: Credit Card, Bank Transfer, Konbini, PayEasy, BitCash, NET CASH, nanaco and WebMoney.

Requests to the API must use HTTPS and use the endpoint https://sandbox.komoju.com/api/v1. All data returned from the API is in JSON format. Character encoding used to make requests should use UTF-8.

Authentication

Komoju provides merchants with secret and publishable API keys for making requests to the API. You can view these keys in your merchant account settings page.

The API uses HTTP Basic Authentication to authenticate API requests. You will need to pass your API key as the username (password is not needed). For example

curl -u secret_key: "https://sandbox.komoju.com/api/v1/payments"

Response & Errors

HTTP Status Codes

Komoju uses HTTP status codes to indicate the success or failure of a request. Below are the the following status codes your application should handle.

Code Description
200 OK The server successfully processed the request
202 Accepted The resource is successfully created but the process is not finished
204 No Content The server successfully processed the request, but is not returning any content.
401 Not Authorized API key provided was invalid or missing
403 Forbidden API key provided doesn’t have permission to access specified resource
404 Not Found Resource not found
422 Unprocessible Entity Missing or invalid parameters
500 Internal Server Error Something went wrong on our side
502 Bad Gateway Upstream payment processor returned an error
503 Service Unavailable Server maintenance

Errors

Errors are returned in JSON format. A code and message parameter are returned for each error message.

Attributes

Parameter Type Description
message string a string describing the error message
code string error code
param string parameter having the validation error

JSON Object

{
  "error": {
     "message": "A required parameter (amount) is missing",
     "code": "missing_parameter",
     "param": "amount"
  }
}

Error Codes

Error Code HTTP Status Code Example Message
bad_request 400 The server cannot or will not process the request due to something that is perceived to be a client error.
unauthorized 401 User authorization failed.
not_found 404 The requested resource could not be found but may be available again in the future.
internal_server_error 500 We're sorry but something went wrong. Please try your request again.
forbidden 403 You are not authorized to perform that action.
unprocessable_entity 422 The request was well-formed but was unable to be followed due to semantic errors.
bad_gateway 502 We are unable to process your request due to an invalid response from the upstream server.
gateway_timeout 504 When attempting to process your payment, we encountered a gateway timeout. Fear not, we have not processed the payment. Please try your payment again.
service_unavailable 503 The server is down for maintenance. Please try again later.
request_failed 402 The request failed
invalid_payment_type 422 Payment method was invalid. %{provided} is not one of %{allowed}.
invalid_token 422 The token you requested is invalid
invalid_currency 422 The currency you requested is invalid.
not_refundable 422 The payment you requested is not refundable.
not_capturable 422 The payment you requested is not capturable.
not_cancellable 422 This payment is noncancellable.
fraudulent 422 This payment is fraudulent.
invalid_parameter 422 The value of %{param} is invalid
missing_parameter 422 A required parameter (%{param}) is missing
insufficient_funds 502 Insufficient funds
used_number 502 Used number
card_declined 502 Card declined
invalid_password 502 Invalid password
bad_verification_value 502 Bad verification value
exceeds_limit 502 Exceeds limit
card_expired 502 Card expired
invalid_number 502 The number you requested is invalid.
invalid_account 502 Invalid account

Pagination

Requests containing more that 10 items will be paginated by default. Komoju has a page and per_page parameter for use in pagination. Note per_page parameter has a maximum value of 100.

curl -u komoju-mart: "https://sandbox.komoju.com/api/v1/payments?page=2&per_page=100"

Payments

Payment Resource

Field Description
id string
resource string Value of payment
status string The status of the payment
amount integer The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator
tax integer The amount of tax to be charged, or ‘auto’ to use the current consumption tax rate in Japan. Use a ‘.’ as a decimal separator, and no thousands separator. If the tax is more precise than the currency allows, it will be rounded using a round half up algorithm.
customer string The ID of the customer the payment was created with.
payment_deadline timestamp Time when the payment will expire. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
payment_details hash or token Describes the payment method used to make the payment
payment_method_fee integer An additional fee added to specific payment types
total integer The payment total, this is the amount + tax + paymentmethodfee
currency string 3 letter ISO currency code of the transaction
description string Description of the payment (used in e-mail receipts if enabled).
subscription subscription Shown if payment was part of a subscription
captured_at timestamp An ISO 8601 formatted timestamp of when a payment was captured
external_order_num string This is the merchant unique ID for the transaction. It will be included in all callbacks to identify the transaction.
metadata hash A set of key-value pairs
created_at timestamp An ISO 8601 formatted timestamp of when a payment was created
amount_refunded integer The amount in cents refunded
locale string Sets the language to use for e-mail receipts and payment instructions
refunds hash Refund information
refund_requests translation missing: en.serializers.payments.refund_requests

Payment Details

The API attempts to abstract the differences between the different payment methods as much as possible. In order to make it easy to integrate multiple payment methods Komoju uses a payments_details hash in requests and responses for payments.

The payment_details hash requires a type parameter which can be one of bank_transfercredit_cardkonbinipay_easyweb_moneybit_cashnanaconet_cash

Examples

  • Bank transfer
  • Credit Card
  • Konbini
  • PayEasy
  • WebMoney
  • BitCash
  • nanaco
  • NET CASH
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=net_cash" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[phone]=090-1111-2222" \
  -d "payment_details[store]=lawson" \
  -d "payment_details[type]=konbini" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -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]=090-1111-2222" \
  -d "payment_details[type]=pay_easy" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -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]=bank_transfer" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=nanaco" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=web_money" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -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]=2018" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=1000" \
  -d "currency=KRW" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[culture_id]=11111111" \
  -d "payment_details[culture_password]=11111111" \
  -d "payment_details[type]=culture_voucher" 
curl -X POST https://sandbox.komoju.com/api/v1/payments \
  -u komoju-mart: \
  -d "amount=100" \
  -d "currency=JPY" \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=bit_cash" 
{
  "id": "blflnmbl9pzmfyzrydswnoldc",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-11T07:52:34Z",
  "payment_details": {
    "type": "net_cash",
    "email": null,
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:35Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:34Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "4wwkq1vpwgzl1cgkz3excvfmy",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-07T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "test@example.com",
    "store": "lawson",
    "confirmation_code": null,
    "receipt": "303001",
    "instructions_url": "https://komoju.com/ja/instructions/4wwkq1vpwgzl1cgkz3excvfmy"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:35Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "adgy38l7srnc1cintgbm2m9fo",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-14T14:59:59Z",
  "payment_details": {
    "type": "pay_easy",
    "email": "test@example.com",
    "bank_id": "58191",
    "customer_id": "20001900030947960025",
    "confirmation_id": "288916",
    "instructions_url": "https://komoju.com/ja/instructions/adgy38l7srnc1cintgbm2m9fo"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:37Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "ettoo9dqwc02f0tburwfif0ha",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-11T14:59:59Z",
  "payment_details": {
    "type": "bank_transfer",
    "email": "test@example.com",
    "order_id": "D4959232956",
    "bank_name": "三井住友銀行",
    "account_branch_name": "吉祥寺",
    "account_number": "7352514",
    "account_type": "普通預金",
    "account_name": "株式会社DEGICA(カブシキガイシャ デジカ)",
    "instructions_url": "https://komoju.com/ja/instructions/ettoo9dqwc02f0tburwfif0ha"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:38Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "ab8ub42kaywku966310gxxk7a",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-11T07:52:38Z",
  "payment_details": {
    "type": "nanaco",
    "email": null,
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:38Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:38Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "13bgxuyrg7uwv5ahrw8qtzpov",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "web_money",
    "email": null,
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:39Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:39Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "a52fo5c2w4rkdfpyirjhky1fx",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-11T14:59:59Z",
  "payment_details": {
    "type": "credit_card",
    "email": null,
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2018
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:40Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:40Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "7vece2xh0glq17vc8waeb64q2",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2017-01-11T07:52:40Z",
  "payment_details": {
    "type": "culture_voucher",
    "culture_id": "11111111"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "KRW",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:40Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2017-01-04T07:52:40Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
{
  "id": "ctui3yw1enfk2tvgwlfv22ut5",
  "resource": "payment",
  "status": "captured",
  "amount": 100,
  "tax": 8,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "bit_cash",
    "email": null
  },
  "payment_method_fee": 0,
  "total": 108,
  "currency": "JPY",
  "description": null,
  "subscription": null,
  "captured_at": "2017-01-04T07:52:49Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2017-01-04T07:52:49Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}

Credit Card

Payment Details

Request Parameter Type Description
type string Value of credit_card
email string The e-mail address used to send the payment receipt to. Note, this value is optional.
number numeric credit card number
month numeric expiry month
year numeric expiry year
verification_value numeric CCV security number
given_name string Customer given name
family_name string Customer family name
Response Parameter Description
type Value of credit_card
email The e-mail address used to send payment receipt to.
brand Brand of credit card e.g. visa, mastercard, etc.
last_four_digits Last four digits of the credit card number
month Expiry month of the credit card
year Expiry year of the credit card

Test Cards

Card Number Type
3530111333300000 JCB
378282246310005 American Express
4111111111111111 Visa
5555555555554444 MasterCard
30569309025904 Diners Club
4123111111111000 Insufficient funds
4123111111111018 Exceeds card limit
4123111111111034 Bad verification value
4123111111111042 Card expired
4123111111111059 Cannot use card
4123111111111067 Invalid card

Bank Transfer

Once a payment is created we return a bank_number which the user must send the funds to with the attached order_id as their payee name. Once we receive the payment we will send a webhook indicating the status of the payment.

Restrictions

  • Bank transfers are only captured during regular business hours in Japan
  • Payments expire after 14 days (send a webhook indicating its expired)

Payment Details

Request Parameter Type Description
type string value of bank_transfer
email string The e-mail address used to send the payment receipt and instructions to. Note, this value is optional.
given_name string Customer given name
family_name string Customers family name
given_name_kana string Customer given name in katakana
family_name_kana string Customers family name in katakana
expiry_days numeric The number of days before the payment expires (maximum 59 days). Note, this value is optional.
Response Parameter Description
type Value of bank_transfer
email The e-mail address used to send the payment receipt and instructions to.
order_id Remitters/payers name customer needs to use to send money as
bank_name The name of the bank the user needs to wire funds to
account_branch_name translation missing: en.serializers.banktransfer.accountbranch_name
account_number The account number
account_type The account type (e.g. savings)
account_name The account name
instructions_url A URL for an instructions page

Convenience Store (Konbini)

Restrictions

  • Payment total has a minimum of 1 and a maximum of 299,999 JPY. The total is based on the amount + tax + transaction fee
  • Payments expire after 3 days (we send a webhook indicating its expired)

Convenience Stores

When creating a Konbini payment you will need to pass a store parameter inside the payment_details hash. This value is the store slug (shown below) which the customer will make the purchase at.

English Name Japanese Name Store Slug Logo
Circle K サークルK circle-k
Daily Yamazaki デイリーヤマザキ daily-yamazaki
Family Mart ファミリーマート family-mart
Lawson ローソン lawson
Ministop ミニストップ ministop
7-Eleven セブンイレブン seven-eleven
Sunkus サンクス sunkus

Payment Details

Request Parameter Type Description
type string value of konbini
email string The e-mail address used to send the payment receipt and instructions to. Note, this value is optional.
store string store slug
phone string Customers phone number (eg. 080-1111-1111)
expiry_days numeric The number of days before the payment expires (maximum 59 days). Note, this value is optional.
Response Parameter Description
type Value of konbini
email The e-mail address used to send the payment receipt and instructions to.
store Store slug name e.g. lawson, family_mart, etc.
confirmation_code A number customers will need when paying at the konbini (used by some konbini)
receipt A number customers will need when paying at the konbini
instructions_url A URL for an instructions page

WebMoney

WebMoney is a popular prepaid card in Japan. The API for WebMoney supports multiple prepaid card requests. For example, if the customer does not have enough funds to cover the cost of the payment you can continue the request by updating the payment and passing a second prepaid_number in the payment_details hash.

Continuing a WebMoney Request

In the case the customer does not have enough funds we return a 202 Accepted status code with the payment status remaining in the pending state. The pending payment can then be updated again using the payment update endpoint and passing an additional prepaid card inside the payment details hash e.g. payment_details[prepaid_number]=XXXXXXXXXXXX.

Payment Details

Request Parameter Type Description
type string Value of web_money
email string The e-mail address used to send the payment receipt to. Note, this value is optional.
prepaid_number string 16-character prepaid card number
Response Parameter Description
type Value of web_money
email The e-mail address used to send the payment receipt to.
short_amount The amount of yen that payment was short by
prepaid_cards A list of prepaid cards used in this transaction

Test Cards

Card Number Type
1111111111111111 WebMoney prepaid card with a 2000 yen balance
e111111111111112 Invalid card number
e111111111111113 Prepaid card has already been used
e111111111111114 Card has been declined due to an unknown error

NET CASH

Similar to WebMoney, NET CASH is another prepaid card in Japan.

Continuing a NET CASH Request

Same case of WebMoney. Please see that for reference.

Payment Details

Request Parameter Type Description
type string Value of net_cash
email string The e-mail address used to send the payment receipt to. Note, this value is optional.
prepaid_number string 16-character prepaid card number
Response Parameter Description
type Value of net_cash
email The e-mail address used to send the payment receipt to.
short_amount The amount of yen that payment was short by
prepaid_cards A list of prepaid cards used in this transaction

Test Cards

Card Number Type
1111111111111111 NET CASH prepaid card with a 2000 yen balance

nanaco

Similar to WebMoney, nanaco is another prepaid card in Japan.

Continuing a nanaco Request

Same case of WebMoney. Please see that for reference.

Payment Details

Request Parameter Type Description
type string Value of nanaco
email string The e-mail address used to send the payment receipt to. Note, this value is optional.
prepaid_number string 16-character prepaid card number
Response Parameter Description
type Value of nanaco
email The e-mail address used to send the payment receipt to.
short_amount The amount of yen that payment was short by
prepaid_cards A list of prepaid cards used in this transaction

Test Cards

Card Number Type
1111111111111111 nanaco prepaid card with a 2000 yen balance

BitCash

Similar to WebMoney, BitCash is another prepaid card in Japan. The integration is identical to WebMoney expect BitCash does not support continuing requests with additional prepaid cards. In the case a customer has insuffcient funds they can merge prepaid cards online via the BitCash website.

Payment Details

Request Parameter Type Description
type string Value of bit_cash
email string The e-mail address used to send the payment receipt to. Note, this value is optional.
prepaid_number string 16-character prepaid card number
Response Parameter Description
type Value of bit_cash
email The e-mail address used to send the payment receipt to.

Test Cards

Card Number Type
1111111111111111 BitCash prepaid card with a 2000 yen balance
e111111111111112 Invalid card number
e111111111111113 Card has been declined due to an unknown error

PayEasy

PayEasy allows customers to pay via online banking.

This is a delayed payment type, which means after a payment is created there is a period of time which elapses before the payment is captured. Komoju will send a webhook once the payment has been captured.

Restrictions

  • PayEasy payments have a minimum of ¥1 and a maximum of ¥999,999.
  • Payments expire after 10 days (we send a webhook indicating its expired)

Payment Details

Request Parameter Type Description
type string value of pay_easy
email string The e-mail address used to send the payment receipt and instructions to. Note, this value is optional.
given_name string Customers given name
family_name string Customers family name
given_name_kana string Customers given name in katakana
family_name_kana string Customers family name in katakana
phone string Customers phone number (eg. 080-1111-1111)
Response Parameter Description
type Value of pay_easy
email The e-mail address used to send the payment receipt and instructions to.
bank_id A code required by customers when paying with pay-easy
customer_id A code required by customers when paying with pay-easy
confirmation_id A code required by customers when paying with pay-easy
instructions_url A URL for an instructions page

Tokens

For security reasons you may want Komoju to handle sensitive customer information for you. Komoju exposes a tokens endpoint for this purpose to allow clients to create tokens directly with the API using your publishable key.

You can use a payment details token anywhere payment details are used by passing the token id field for payment_details

Restrictions

  • Tokens can only be used once
  • Tokens expire after 30 days

Examples

  • Bank transfer
  • Credit Card
  • Konbini
  • PayEasy
  • WebMoney
  • BitCash
  • nanaco
  • NET CASH
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=bit_cash" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -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]=bank_transfer" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=web_money" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=nanaco" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[culture_id]=11111111" \
  -d "payment_details[culture_password]=11111111" \
  -d "payment_details[type]=culture_voucher" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -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]=2018" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -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]=090-1111-2222" \
  -d "payment_details[type]=pay_easy" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[prepaid_number]=1111111111111111" \
  -d "payment_details[type]=net_cash" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[phone]=090-1111-2222" \
  -d "payment_details[store]=lawson" \
  -d "payment_details[type]=konbini" 
curl -X POST https://sandbox.komoju.com/api/v1/tokens \
  -u komoju-mart: \
  -d "payment_details[type]=dospara" \
  -d "payment_details[user_no]=12345" \
  -d "payment_details[user_password]=password" 
{
  "id": "tok_e7a2d0175d9204f55f7e1fc6848178efcaa05a18aac91a6f64bec7b845a209d35agmbwixkqrf48kw6wliek98t",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "bit_cash"
  }
}
{
  "id": "tok_d1b7b3e445d2276876714d5c2bef5ed87f773056e3ff1f1e594c65dd1905c24812ingqjf6wdrnzy6959eolcs6",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "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_a2e19700c6b5beb97758f2c2132d1de49b7e391405c1bb4d9794e87b65175fe97ullijya5b5bpqe6e82v8vjt3",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "web_money"
  }
}
{
  "id": "tok_c15d7d4d2801c177c791cd36bd2da28c4b56c233128219a5e219c70dd0aaf7e23rvuj0dvevnwjbkravl0xwl9y",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "nanaco"
  }
}
{
  "id": "tok_1cca1150dacc5539508f1f58ef94549b3f702fd8e15a617d38d5e8a51576ea871rsrdpdzxecfdrgk0djgky07k",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "culture_voucher"
  }
}
{
  "id": "tok_2f308774203e08d6dce5abd2814c204459e531358e7c8e583ac9049e38f3c9d22vptfdnr59pr9gdgm1rev2mli",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "credit_card",
    "given_name": "Taro",
    "family_name": "Yamada"
  }
}
{
  "id": "tok_d0bc60928955851710d5da2ff05ae542adc6406cafa57299bfbe646abff8bc5423c8zvljrqljbw0u191uyqksx",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "pay_easy",
    "given_name": "太郎",
    "family_name": "山田",
    "given_name_kana": "タロウ",
    "family_name_kana": "ヤマダ",
    "email": "test@example.com",
    "phone": "090-1111-2222"
  }
}
{
  "id": "tok_bd269e95e1bf59c12f8f330df78ba1d24af6028c3dbd0a55400e7cbf542d10658piz60mheub8dslokpa1ez9ht",
  "resource": "token",
  "created_at": "2017-01-04T07:52:31Z",
  "payment_details": {
    "type": "net_cash"
  }
}
{
  "id": "tok_6f88cf1c9c987d40876e15e1d48fb649871f27181612c777dc3597469cb30f87a6ribb1sttxipurz1bfw9q3cs",
  "resource": "token",
  "created_at": "2017-01-04T07:52:32Z",
  "payment_details": {
    "type": "konbini",
    "store": "lawson",
    "email": "test@example.com",
    "phone": "090-1111-2222"
  }
}
{
  "id": "tok_240eb0f6489827bdf7d12abed889816ce6e1ca827347b9d77ff588d99921b0651pimnlyp30cn7o19jkn3qvxoi",
  "resource": "token",
  "created_at": "2017-01-04T07:52:32Z",
  "payment_details": {
    "type": "dospara"
  }
}