Overview
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: Credit Card, Bank Transfer, LINE Pay, Merpay, PayPay, Rakuten Pay, Konbini, PayEasy, BitCash, NET CASH, WebMoney, Alipay, Bancontact, BLIK, EPS, Giropay, iDEAL, Multibanco, MyBank, paysafecard, paysafecash, Przelewy24, Sofort, UnionPay, WeChat Pay, Dragonpay, eNETS, FPX Online Banking, GrabPay Singapore, PAYCO, Happy Money, Culture Voucher, and Carrier Billing.
Requests to the API must use HTTPS and use the endpoint https://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://komoju.com/api/v1/payments"
Secret Key
Your secret key allows access to all API resources. You should store this key securely as it can be used to perform any action on your account.
Publishable Key
Publishable keys are used for creating tokens on the client-side part of your application. You can use this key to avoid processing sensitive payment details such as credit card numbers, prepaid numbers, etc.
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. |
not_chargebackable |
422 |
The payment is not chargebackable. |
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 |
restricted_account |
502 |
Restricted account |
other_error |
502 |
Other error |
invalid_user_key |
502 |
Invalid user key |
other_invalid |
502 |
Invalid card |
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://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, without thousands separator. The amount cannot be a decimal value. For example, for an amount of 10 and currency of EUR, the payment will be 0.10 EUR. |
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). |
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 |
hash Refund request information |
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
credit_card
, konbini
, bank_transfer
, pay_easy
, web_money
, bit_cash
, net_cash
, japan_mobile
, linepay
, merpay
, paypay
, paidy
, rakutenpay
, alipay
, bancontact
, blik
, eps
, giropay
, ideal
, multibanco
, mybank
, paysafe_card
, paysafe_cash
, przelewy24
, sofortbanking
, unionpay
, wechatpay
, dragonpay
, grabpayotp
, enets
, fpx
, payco
, happy_money
, culture_voucher
, mobile
.
Examples
- Credit Card
- Konbini
- Bank transfer
- PayEasy
- WebMoney
- BitCash
- NET CASH
- Japan Mobile
- LINE Pay
- Merpay
- PayPay
- Paidy
- Rakuten Pay
- Alipay
- Bancontact
- BLIK
- EPS
- Giropay
- iDEAL
- Multibanco
- MyBank
- paysafecard
- paysafecash
- Przelewy24
- SOFORT Banking
- UnionPay
- Wechat Pay
- Dragonpay
- GrabPay Singapore
- eNETS
- FPX Online Banking
- PAYCO
- Happy Money
- Culture Voucher
- Carrier Billing
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=KRW" \
-d "email=foo@bar.com" \
-d "payment_details[email]=foo@bar.com" \
-d "payment_details[type]=mobile" \
-d "return_url=http://example.com" \
-d "tax=0"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'KRW',
'email': 'foo@bar.com',
'payment_details[email]': 'foo@bar.com',
'payment_details[type]': 'mobile',
'return_url': 'http://example.com',
'tax': '0'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "KRW",
email: "foo@bar.com",
payment_details: {
email: "foo@bar.com",
type: "mobile"
},
return_url: "http://example.com",
tax: "0"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=100" \
-d "currency=JPY" \
-d "debug=true" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[prepaid_number]=1111111111111111" \
-d "payment_details[type]=bit_cash"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '100',
'currency': 'JPY',
'debug': 'true',
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'bit_cash'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "100",
currency: "JPY",
debug: "true",
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "bit_cash"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=linepay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'linepay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
email: "test@example.com",
type: "linepay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=merpay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'merpay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
email: "test@example.com",
type: "merpay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=paypay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'paypay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
email: "test@example.com",
type: "paypay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=rakutenpay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'rakutenpay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
email: "test@example.com",
type: "rakutenpay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[brand]=docomo" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=japan_mobile" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[brand]': 'docomo',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'japan_mobile',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
brand: "docomo",
email: "test@example.com",
type: "japan_mobile"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[expiry_days]=3" \
-d "payment_details[phone]=090-1111-2222" \
-d "payment_details[store]=lawson" \
-d "payment_details[type]=konbini"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[expiry_days]': '3',
'payment_details[phone]': '090-1111-2222',
'payment_details[store]': 'lawson',
'payment_details[type]': 'konbini'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
expiry_days: "3",
phone: "090-1111-2222",
store: "lawson",
type: "konbini"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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]=pay_easy"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[family_name]': '山田',
'payment_details[family_name_kana]': 'ヤマダ',
'payment_details[given_name]': '太郎',
'payment_details[given_name_kana]': 'タロウ',
'payment_details[phone]': '080-1111-2222',
'payment_details[type]': 'pay_easy'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
family_name: "山田",
family_name_kana: "ヤマダ",
given_name: "太郎",
given_name_kana: "タロウ",
phone: "080-1111-2222",
type: "pay_easy"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[prepaid_number]=1111111111111111" \
-d "payment_details[type]=net_cash"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'net_cash'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "net_cash"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=KRW" \
-d "external_order_num=123" \
-d "metadata[foobar]=hoge" \
-d "payment_details[happy_money_id]=11111111" \
-d "payment_details[happy_money_password]=11111111" \
-d "payment_details[type]=happy_money"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'KRW',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[happy_money_id]': '11111111',
'payment_details[happy_money_password]': '11111111',
'payment_details[type]': 'happy_money'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "KRW",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
happy_money_id: "11111111",
happy_money_password: "11111111",
type: "happy_money"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[expiry_days]': '14',
'payment_details[family_name]': '山田',
'payment_details[family_name_kana]': 'ヤマダ',
'payment_details[given_name]': '太郎',
'payment_details[given_name_kana]': 'タロウ',
'payment_details[phone]': '080-1111-2222',
'payment_details[type]': 'bank_transfer'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
expiry_days: "14",
family_name: "山田",
family_name_kana: "ヤマダ",
given_name: "太郎",
given_name_kana: "タロウ",
phone: "080-1111-2222",
type: "bank_transfer"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'KRW',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[culture_id]': '11111111',
'payment_details[culture_password]': '11111111',
'payment_details[type]': 'culture_voucher'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "KRW",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
culture_id: "11111111",
culture_password: "11111111",
type: "culture_voucher"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[month]=01" \
-d "payment_details[name]=Taro Yamada" \
-d "payment_details[number]=4111111111111111" \
-d "payment_details[type]=credit_card" \
-d "payment_details[verification_value]=123" \
-d "payment_details[year]=2025"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[month]': '01',
'payment_details[name]': 'Taro Yamada',
'payment_details[number]': '4111111111111111',
'payment_details[type]': 'credit_card',
'payment_details[verification_value]': '123',
'payment_details[year]': '2025'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
month: "01",
name: "Taro Yamada",
number: "4111111111111111",
type: "credit_card",
verification_value: "123",
year: "2025"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[prepaid_number]=1111111111111111" \
-d "payment_details[type]=web_money"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'web_money'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "web_money"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-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[prepaid_number]=1111111111111111" \
-d "payment_details[type]=nanaco"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'external_order_num': '123',
'metadata[foobar]': 'hoge',
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'nanaco'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
external_order_num: "123",
metadata: {
foobar: "hoge"
},
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "nanaco"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=alipay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'alipay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "alipay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=bancontact" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'bancontact',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "bancontact"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=PLN" \
-d "payment_details[name]=name" \
-d "payment_details[type]=blik" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'PLN',
'payment_details[name]': 'name',
'payment_details[type]': 'blik',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "PLN",
payment_details: {
name: "name",
type: "blik"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=eps" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'eps',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "eps"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=giropay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'giropay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "giropay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=ideal" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'ideal',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "ideal"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=multibanco" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'multibanco',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "multibanco"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=mybank" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'mybank',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "mybank"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=paysafe_card" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'paysafe_card',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "paysafe_card"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[type]=paysafe_cash" \
-d "payment_details[email]=test@example.com" \
-d "" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[type]': 'paysafe_cash',
'payment_details[email]': 'test@example.com',
'': '',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
type: "paysafe_cash",
email: "test@example.com"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=payu" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'payu',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "payu"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=przelewy24" \
-d "payment_details[email]=name@example.com" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'przelewy24',
'payment_details[email]': 'name@example.com',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "przelewy24",
email: "name@example.com"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=sofortbanking" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'sofortbanking',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "sofortbanking"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=unionpay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'unionpay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "unionpay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=EUR" \
-d "payment_details[name]=name" \
-d "payment_details[type]=wechatpay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'EUR',
'payment_details[name]': 'name',
'payment_details[type]': 'wechatpay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "EUR",
payment_details: {
name: "name",
type: "wechatpay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=6000" \
-d "currency=PHP" \
-d "payment_details[name]=name" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[type]=dragonpay" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '6000',
'currency': 'PHP',
'payment_details[name]': 'name',
'payment_details[email]': 'test@example.com',
'payment_details[phone]': '01234567890',
'payment_details[type]': 'dragonpay',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "6000",
currency: "PHP",
payment_details: {
name: "name",
email: "test@example.com",
phone: "01234567890",
type: "dragonpay"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=SGD" \
-d "payment_details[name]=name" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[type]=enets" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'SGD',
'payment_details[name]': 'name',
'payment_details[email]': 'test@example.com',
'payment_details[phone]': '01234567890',
'payment_details[type]': 'enets',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "SGD",
payment_details: {
name: "name",
email: "test@example.com",
phone: "01234567890",
type: "enets"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=MYR" \
-d "payment_details[name]=name" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[type]=fpx" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'MYR',
'payment_details[name]': 'name',
'payment_details[email]': 'test@example.com',
'payment_details[phone]': '01234567890',
'payment_details[type]': 'fpx',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "MYR",
payment_details: {
name: "name",
email: "test@example.com",
phone: "01234567890",
type: "fpx"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=SGD" \
-d "payment_details[name]=name" \
-d "payment_details[type]=grabpayotp" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'SGD',
'payment_details[name]': 'name',
'payment_details[type]': 'grabpayotp',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "SGD",
payment_details: {
name: "name",
type: "grabpayotp"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=KRW" \
-d "payment_details[type]=payco" \
-d "return_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'KRW',
'payment_details[type]': 'payco',
'return_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "KRW",
payment_details: {
type: "payco"
},
return_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/payments \
-u sk_123456: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details[shipping_address_city]=武蔵野市" \
-d "payment_details[shipping_address_line1]=いちご吉祥寺ビル 4F" \
-d "payment_details[shipping_address_line2]=吉祥寺本町 2 丁目 5 番 10 号" \
-d "payment_details[shipping_address_state]=東京都" \
-d "payment_details[shipping_address_zip]=1800004" \
-d "payment_details[shipping_address_country]=JPY" \
-d "payment_details[customer_name]=山田太郎" \
-d "payment_details[type]=paidy" \
-d "return_url=https://example.com" \
-d "cancel_url=https://example.com"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'amount': '1000',
'currency': 'JPY',
'payment_details[shipping_address_city]': '武蔵野市',
'payment_details[shipping_address_line1]': 'いちご吉祥寺ビル 4F',
'payment_details[shipping_address_line2]': '吉祥寺本町 2 丁目 5 番 10 号',
'payment_details[shipping_address_state]': '東京都',
'payment_details[shipping_address_zip]': '1800004',
'payment_details[shipping_address_country]': 'JPY',
'payment_details[customer_name]': '山田太郎',
'payment_details[type]': 'paidy',
'return_url': 'https://example.com',
'cancel_url': 'https://example.com'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/payments',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
amount: "1000",
currency: "JPY",
payment_details: {
shipping_address_city: "武蔵野市",
shipping_address_line1: "いちご吉祥寺ビル 4F",
shipping_address_line2: "吉祥寺本町 2 丁目 5 番 10 号",
shipping_address_state: "東京都",
shipping_address_zip: "1800004",
shipping_address_country: "JPY",
customer_name: "山田太郎",
type: "paidy"
},
return_url: "https://example.com",
cancel_url: "https://example.com"
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
{
"id": "bncg5974hoii95erwy2gqx7vz",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "mobile",
"email": "foo@bar.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=bncg5974hoii95erwy2gqx7vz"
},
"payment_method_fee": 0,
"total": 1000,
"currency": "KRW",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:41:50Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "73cf3349ch47rdbqjjp2c8oyy",
"resource": "payment",
"status": "captured",
"amount": 100,
"tax": 10,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "bit_cash",
"email": "test@example.com"
},
"payment_method_fee": 0,
"total": 110,
"currency": "JPY",
"description": null,
"captured_at": "2020-06-09T07:41:51Z",
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:41:51Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "87rh791klpxxv4rgshn3yu2hf",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "linepay",
"email": "test@example.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=87rh791klpxxv4rgshn3yu2hf"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:41:59Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "5nnvwksll8q299v69i9jdpxzn",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "merpay",
"email": "test@example.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=5nnvwksll8q299v69i9jdpxzn"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:42:00Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "87rh791klpxxv4rgshn3yu2hf",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "paypay",
"email": "test@example.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=87rh791klpxxv4rgshn3yu2hf"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:41:59Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "5nnvwksll8q299v69i9jdpxzn",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "rakutenpay",
"email": "test@example.com",
"charge_key": "ch_5EUL0DB4RMB",
"redirect_url": "https://komoju.com/offsite/new?uuid=5nnvwksll8q299v69i9jdpxzn"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:42:00Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "9adne51m4l3fr498rd40o0xf9",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "japan_mobile",
"email": "test@example.com",
"provider": "docomo",
"redirect_url": "https://komoju.com/offsite/new?uuid=9adne51m4l3fr498rd40o0xf9"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:42:00Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "7h2ywj2xwzqm7g4e0s3ed9tmv",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-12T14:59:59Z",
"payment_details": {
"type": "konbini",
"email": "test@example.com",
"store": "lawson",
"confirmation_code": "2222",
"receipt": "90865708838",
"instructions_url": "https://komoju.com/ja/instructions/7h2ywj2xwzqm7g4e0s3ed9tmv"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:04Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "3pbcqcbd7m5b0ypy8c5lefczh",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-19T14: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/3pbcqcbd7m5b0ypy8c5lefczh"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:11Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "ena9brsze3ynkmhkfj5v2foig",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-16T07:42:12Z",
"payment_details": {
"type": "net_cash",
"email": "test@example.com",
"short_amount": 0,
"prepaid_cards": [
{
"last_four_digits": "1111",
"points": 1100
}
]
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": "2020-06-09T07:42:12Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:12Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "c6l9g4murft6tnvig6zxf4q53",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "happy_money",
"happy_money_id": "11111111"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "KRW",
"description": null,
"captured_at": "2020-06-09T07:42:12Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:12Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "36mwqk77p2znfjnwgqci69buc",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-16T14:59:59Z",
"payment_details": {
"type": "bank_transfer",
"email": "test@example.com",
"order_id": "K6685338853",
"bank_name": "三井住友銀行",
"account_branch_name": "ひなぎく",
"account_number": "85",
"account_type": "普通預金",
"account_name": "株式会社DEGICA(カブシキガイシャ デジカ)",
"instructions_url": "https://komoju.com/ja/instructions/36mwqk77p2znfjnwgqci69buc"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:12Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "c2dkawkf0wzg4zl0908n4vuc4",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "culture_voucher",
"culture_id": "11111111"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "KRW",
"description": null,
"captured_at": "2020-06-09T07:42:13Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:13Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "dofcje84ldv0j94wa06ldw71c",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-16T14:59:59Z",
"payment_details": {
"type": "credit_card",
"email": "test@example.com",
"brand": "visa",
"last_four_digits": "1111",
"month": 1,
"year": 2025
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": "2020-06-09T07:42:14Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:14Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "b2kjhznvxhu902067v2iu7rjg",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "web_money",
"email": "test@example.com",
"short_amount": 0,
"prepaid_cards": [
{
"last_four_digits": "1111",
"points": 1100
}
]
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": "2020-06-09T07:42:15Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:15Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2xo2org21jm66y4o51b18nirt",
"resource": "payment",
"status": "captured",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": "2020-06-16T07:42:16Z",
"payment_details": {
"type": "nanaco",
"email": "test@example.com",
"short_amount": 0,
"prepaid_cards": [
{
"last_four_digits": "1111",
"points": 1100
}
]
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": "2020-06-09T07:42:16Z",
"external_order_num": "123",
"metadata": {
"foobar": "hoge"
},
"created_at": "2020-06-09T07:42:16Z",
"amount_refunded": 0,
"locale": "ja",
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "alipay",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "bancontact",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "blik",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "PLN",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "eps",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "giropay",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "ideal",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "multibanco",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "mybank",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "paysafe_card",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "paysafe_cash",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "payu",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "przelewy24",
"email": "name@example.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "sofortbanking",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "unionpay",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "wechatpay",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "EUR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 6000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "dragonpay",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 6100,
"currency": "PHP",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "enets",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "SGD",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "fpx",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "MYR",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "grabpayotp",
"redirect_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "SGD",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "2qzbba5vvb7n8t4vubiapkkv5",
"resource": "payment",
"status": "pending",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "payco",
"order_sheet_url": "https://komoju.com/offsite/new?uuid=4cv3ovhe3hgzkh4wtwaktoqwe"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "KRW",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2021-08-04T00:56:11Z",
"amount_refunded": 0,
"locale": "ja",
"session": null,
"refunds": [
],
"refund_requests": [
]
}
{
"id": "09g4gqgy7r52aoun6y5jwjzs7",
"resource": "payment",
"status": "authorized",
"amount": 1000,
"tax": 100,
"customer": null,
"payment_deadline": null,
"payment_details": {
"type": "paidy",
"email": "test@example.com",
"redirect_url": "https://komoju.com/offsite/new?uuid=09g4gqgy7r52aoun6y5jwjzs7"
},
"payment_method_fee": 0,
"total": 1100,
"currency": "JPY",
"description": null,
"captured_at": null,
"external_order_num": null,
"metadata": {
},
"created_at": "2020-06-09T07:42:23Z",
"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 |
name |
string | Customer name |
The following additional parameters are for Korean credit card payments.
Request Parameter | Type | Description |
---|---|---|
social_id |
numeric | Customer's 6 digit birth date (YYMMDD) or 10 digit corporate number (for corporate cards) |
first_two_digits_of_pin |
numeric | First 2 digits of card PIN |
corporate_card |
boolean | (Optional) Whether the card is corporate. Defaults to false . |
Fraud Details
Credit card payment requests support an optional fraud_details
hash where information about the customer can be given
in order to combat fraudulent transactions. While fields other than customer_ip
are optional, additional information improves the accuracy of
fraud prevention measures.
Request Parameter | Type | Description |
---|---|---|
customer_ip |
string | The customer's IP address. Accepts ipv4 and ipv6 format addresses. |
customer_email |
string | The e-mail address provided by the customer during the payment process. |
customer_id |
string | A unique identifier associated with the customer. |
browser_language |
string | The language of the customer's browser session. |
browser_user_agent |
string | Information about the user's browser session. |
Response Parameter | Description |
---|---|
type |
Value of credit_card |
email |
(optional) 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
Note: These credit card numbers are only available in test mode. If you would like to run a live transaction, you will need to use a real credit card.
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. |
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 |
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 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 |
The account branch name |
account_number |
The account number |
account_type |
The account type. Allowed values are savings or checking |
account_name |
The account name |
instructions_url |
A URL for an instructions page |
Japan Mobile
docomo
, au
, and softbank
are supported for carrier billing.
Note, this payment method requires customers to be redirected to the mobile carrier to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of japan_mobile |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
brand |
string | The mobile carrier slug. Must be au , docomo , or softbank . |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of japan_mobile |
email |
(optional) The e-mail address used to send the payment receipt to. |
provider |
The mobile carrier slug. Must be au , docomo , or softbank . |
redirect_url |
The URL where customers must be redirected to complete payment. |
LINE Pay
LINE Pay is a popular smartphone app which enables QR-code based payment.
Note, this payment method requires customers to be redirected to the LINE Pay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of linepay |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
return_url |
string | URL where customers are redirected after a payment has been completed. |
cancel_url |
string | URL where customers are redirected after a payment has been cancelled. |
Response Parameter | Description |
---|---|
type |
Value of linepay |
email |
(optional) The e-mail address used to send the payment receipt to. |
redirect_url |
The URL where customers must be redirected to complete payment. |
Merpay
Merpay is a popular smartphone app which enables QR-code based payment.
Note, this payment method requires customers to be redirected to the Merpay website to pay.
Restrictions
- Merpay payments have a minimum of ¥1 and a maximum of ¥1,000,000.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of merpay |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
return_url |
string | URL where customers are redirected after a payment has been completed. |
cancel_url |
string | URL where customers are redirected after a payment has been cancelled. |
Response Parameter | Description |
---|---|
type |
Value of merpay |
email |
(optional) The e-mail address used to send the payment receipt to. |
redirect_url |
The URL where customers must be redirected to complete payment. |
PayPay
PayPay is a popular smartphone app which enables QR-code based payment.
Note, this payment method requires customers to be redirected to the PayPay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of paypay |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of paypay |
email |
(optional) The e-mail address used to send the payment receipt to. |
redirect_url |
The URL where customers must be redirected to complete payment. |
Rakuten Pay
Note, this payment method requires customers to be redirected to the Rakuten Pay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of rakutenpay |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of rakutenpay |
email |
(optional) The e-mail address used to send the payment receipt to. |
charge_key |
Charge Object ID |
redirect_url |
The URL where customers must be redirected to complete payment. |
Convenience Store (Konbini)
Restrictions
- Payment total has a minimum of 1 and a maximum of 300,000 JPY. The total is based on the amount + tax + transaction fee
- 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 |
---|---|---|---|
Daily Yamazaki | デイリーヤマザキ | daily-yamazaki |
|
Family Mart | ファミリーマート | family-mart |
|
Lawson | ローソン | lawson |
|
Ministop | ミニストップ | ministop |
|
Seicomart | セイコーマート | seicomart |
|
7-Eleven | セブンイレブン | seven-eleven |
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. |
store |
string | store slug |
phone |
string | Customers phone number (eg. 080-1111-1111). Note, this value is optional. |
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 |
(optional) 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 |
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 |
(optional) 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. |
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 |
Alipay
As the most popular online wallet in China, Alipay’s frictionless user experience unlocks a high conversion rate at checkout.
Note, this payment method requires customers to be redirected to the Alipay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of alipay |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of alipay |
redirect_url |
The URL where customers must be redirected to complete payment. |
Bancontact
Bancontact makes it possible to pay directly through the online payment systems of all major Belgian banks for customers with Bancontact payment cards.
Note, this payment method requires customers to be redirected to the Bancontact website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of bancontact |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of bancontact |
redirect_url |
The URL where customers must be redirected to complete payment. |
BLIK
Introduced in 2015, and created and developed in Poland, BLIK is a must-have local payment method for e-commerce sites in Poland.
Note, this payment method requires customers to be redirected to the BLIK website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of blik |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of blik |
redirect_url |
The URL where customers must be redirected to complete payment. |
EPS
The main bank transfer payment method in Austria is eps, developed jointly by Austrian banks and the government, enabling consumers to pay securely for online purchases using their own trusted online bank.
Note, this payment method requires customers to be redirected to the EPS website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of eps |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of eps |
redirect_url |
The URL where customers must be redirected to complete payment. |
Giropay
With giropay, consumers are using their bank's secure online banking: their bank account information and transaction details remain fully protected and secure. When consumers check out, they can use giropay directly without any additional registration.
Note, this payment method requires customers to be redirected to the Giropay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of giropay |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of giropay |
redirect_url |
The URL where customers must be redirected to complete payment. |
iDEAL
iDEAL, launched in 2005, provides a payment guarantee to merchants while enabling consumers to pay online through their mobile banking app or online bank account. iDEAL is based on the SEPA credit transfer and seamlessly integrates with the online banking systems offered by banks.
Note, this payment method requires customers to be redirected to the iDEAL website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of ideal |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of ideal |
redirect_url |
The URL where customers must be redirected to complete payment. |
Multibanco
Multibanco is a core payment method for Portuguese consumers, where they can use Multibanco to pay for a range of goods/services including e-commerce, licences and taxes.
Note, this payment method requires customers to be redirected to the Multibanco website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of multibanco |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of multibanco |
redirect_url |
The URL where customers must be redirected to complete payment. |
MyBank
MyBank enables consumers to pay directly from their online banking through an immediate bank transfer - with the highest security and transparency standards.
Note, this payment method requires customers to be redirected to the MyBank website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of mybank |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of mybank |
redirect_url |
The URL where customers must be redirected to complete payment. |
paysafecard
paysafecard is a prepaid, online payment method based on vouchers, which are independent of bank account, credit card, or other personal details. paysafecard operates a dense distribution network, with over 660,000 points of sale across 50 countries.
Note, this payment method requires customers to be redirected to the paysafecard website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of paysafe_card |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of paysafe_card |
redirect_url |
The URL where customers must be redirected to complete payment. |
paysafecash
Paysafecash ‘brings cash online’, enabling consumers who want to pay online easily and safely using cash.
Note, this payment method requires customers to be redirected to the paysafecash website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of paysafe_cash |
email |
string | The customer's email address |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of paysafe_cash |
redirect_url |
The URL where customers must be redirected to complete payment. |
Przelewy24
Founded in 2004, Przelewy24 is a Poland-based real-time online bank transfer payment method, often referred to as P24. Przelewy24 operates in partnership with all Polish banks.
Note, this payment method requires customers to be redirected to the paysafecash website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of przelewy24 |
name |
string | The customer's name |
email |
string | The customer's email address |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of przelewy24 |
email |
The customer's email address |
redirect_url |
The URL where customers must be redirected to complete payment. |
Sofort
With Sofort, security-conscious consumers use their own online banking details, entered through the secure payment page of Sofort. Once logged in, a one-time confirmation code is used by the consumer to authorise payment.
Note, this payment method requires customers to be redirected to the Sofort website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of sofortbanking |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of sofortbanking |
redirect_url |
The URL where customers must be redirected to complete payment. |
UnionPay
With more than 7.5 billion cards issued globally, UnionPay (also known as China UnionPay and its subsidiary, UnionPay International), is the largest card network in the world and the most commonly accepted payment method in mainland China.
Note, this payment method requires customers to be redirected to the SOFORT Banking website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of unionpay |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of unionpay |
redirect_url |
The URL where customers must be redirected to complete payment. |
WeChat Pay
One of China’s leading online wallets, WeChat Pay holds over 38% of mainland Chinese wallet share (iResearch Group) and counts over 800 million active users (Tencent).
Note, this payment method requires customers to be redirected to the SOFORT Banking website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of wechatpay |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of wechatpay |
redirect_url |
The URL where customers must be redirected to complete payment. |
Dragonpay
With Dragonpay, customers can purchase goods or services online, and pay for them using cash at physical, brick-and-mortar payment counters, ATM’s, mobile wallets or through online bank debit.
Note, this payment method requires customers to be redirected to the Dragonpay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of dragonpay |
name |
string | The customer's name |
email |
string | The RFC-compliant email address of the customer |
phone |
string | Valid international phone number of the customer |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of dragonpay |
redirect_url |
The URL where customers must be redirected to complete payment. |
eNETs
eNETS enables consumers to pay with all major credit cards and currencies as well as Direct Debit (internet banking payments) from the major banks in Singapore and China, including DBS (Singapore and Hong Kong), UOB, OCBC, Citibank and BNU.
Note, this payment method requires customers to be redirected to the eNETS website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of enets |
name |
string | The customer's name |
email |
string | The RFC-compliant email address of the customer |
phone |
string | Valid international phone number of the customer |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of enets |
redirect_url |
The URL where customers must be redirected to complete payment. |
FPX Online Banking
With FPX Online Banking, consumers need only their banking accounts to make payments whenever they shop at online stores or websites. During checkout, users select the FPX logo, log into their chosen banking environment, select the account from which they wish to pay, review the details and enter a one-time passcode sent via SMS to authorise the payment. Consumers are then re-directed back to the merchant page and receive confirmation of the payment and order.
Note, this payment method requires customers to be redirected to the FPX Online Banking website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of fpx |
name |
string | The customer's name |
email |
string | The customer's email address |
phone |
string | The customer's phone number |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of fpx |
redirect_url |
The URL where customers must be redirected to complete payment. |
GrabPay Singapore
With GrabPay, consumers can make money transfers and payments via QR code at more than 4,000 retail stores, food stalls, and e-commerce shops in Singapore.
Note, this payment method requires customers to be redirected to the GrabPay website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of grabpayotp |
name |
string | The customer's name |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of grabpayotp |
redirect_url |
The URL where customers must be redirected to complete payment. |
PAYCO
PAYCO connects a wide variety of payment methods, including bank accounts, credit cards, and gift cards.
Note, this payment method requires customers to be redirected to the PAYCO website to pay.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of payco |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of payco |
order_sheet_url |
The URL where customers must be redirected to complete payment. |
Happy Money
Happy Money is a similar type of payment method like Culture Voucher, where the customer purchases pre-paid vouchers which can then be used to make online purchases.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of happy_money |
happy_money_id |
string | Happy Money ID |
happy_money_password |
string | Happy Money Password |
Response Parameter | Description |
---|---|
type |
Value of happy_money |
happy_money_id |
Happy Money ID |
Culture Voucher
Culture Voucher is a popular online payment method for digital goods in Korea. It requires the user to register an account and recharge the card points before making a payment.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of culture_voucher |
culture_id |
string | Culture Land ID |
culture_password |
string | Culture Land Password |
Response Parameter | Description |
---|---|
type |
Value of culture_voucher |
culture_id |
Culture Land ID |
Carrier Billing
Carrier billing uses the customers mobile phone bill to complete a payment. Carrier billing can be used with the major Korean carriers and can be used as an alternative payment method.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of mobile |
email |
string | The customer's email |
return_url |
string | URL where customers are redirected after a payment has been completed. |
Response Parameter | Description |
---|---|
type |
Value of mobile |
email |
The customer's email |
redirect_url |
The URL where customers must be redirected to complete payment. |
Paidy
Paidy is a Japanese payment method which provides instant credit to consumers allowing them to buy now and pay later.
Payment Details
Request Parameter | Type | Description |
---|---|---|
type |
string | Value of paidy |
email |
string | (optional) The e-mail address used to send the payment receipt to. |
phone |
string | (optional) Consumer's phone number, e.g., 09011112222. This should be a Japanese mobile phone where the consumer can receive text messages. |
shipping_address_city |
string | Name of city, municipality, or village. |
shipping_address_line1 |
string | For Japanese addresses: building name, apartment number. |
shipping_address_line2 |
string | For Japanese addresses: district, land number, land number extension. |
shipping_address_state |
string | Prefecture |
shipping_address_zip |
string | Japanese postal code; format is NNN-NNNN |
shipping_address_country |
string | Country |
customer_name |
string | Customer's name in kanji. Family name and first name must be separated by a space. |
return_url |
string | URL where customers are redirected after a payment has been completed. |
cancel_url |
string | URL where customers are redirected after a payment has been cancelled. |
Response Parameter | Description |
---|---|
type |
Value of paidy |
email |
(optional) The e-mail address used to send the payment receipt to. |
redirect_url |
The URL where customers must be redirected to complete payment. |
Tokens
For security reasons you may want KOMOJU to handle sensitive customer information for you. Tokenization works by collecting your customers payment details and converting them into a token. This token can then be passed to your server and used to process payments ensuring no sensitive data ever touches your server.
KOMOJU exposes a tokens endpoint for this purpose which allows client-side applications to create one-time tokens directly through the KOMOJU API using your publishable key.
Note that tokens can only be used once and expire after 30 days. If you want to store payment details permenantly see the section on Permanent Storage.
Creating a Token
A token can be created using a client-side library like KOMOJU MultiPay using your publishable key. You can also create tokens directly using the tokens endpoint:
- Credit Card
- Konbini
- Bank transfer
- PayEasy
- WebMoney
- BitCash
- NET CASH
- Japan Mobile
- LINE Pay
- Merpay
- PayPay
- Paidy
- Rakuten Pay
- Alipay
- Bancontact
- BLIK
- EPS
- Giropay
- iDEAL
- Multibanco
- MyBank
- paysafecard
- paysafecash
- Przelewy24
- SOFORT Banking
- UnionPay
- Wechat Pay
- Dragonpay
- GrabPay Singapore
- eNETS
- FPX Online Banking
- PAYCO
- Happy Money
- Culture Voucher
- Carrier Billing
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'currency': 'KRW',
'payment_details[email]': 'foo@bar.com',
'payment_details[type]': 'mobile'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
currency: "KRW",
payment_details: {
email: "foo@bar.com",
type: "mobile"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[expiry_days]': '3',
'payment_details[phone]': '090-1111-2222',
'payment_details[store]': 'lawson',
'payment_details[type]': 'konbini'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
expiry_days: "3",
phone: "090-1111-2222",
store: "lawson",
type: "konbini"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[family_name]': '山田',
'payment_details[family_name_kana]': 'ヤマダ',
'payment_details[given_name]': '太郎',
'payment_details[given_name_kana]': 'タロウ',
'payment_details[phone]': '080-1111-2222',
'payment_details[type]': 'pay_easy'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
family_name: "山田",
family_name_kana: "ヤマダ",
given_name: "太郎",
given_name_kana: "タロウ",
phone: "080-1111-2222",
type: "pay_easy"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'bit_cash'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "bit_cash"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'net_cash'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "net_cash"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[expiry_days]': '14',
'payment_details[family_name]': '山田',
'payment_details[family_name_kana]': 'ヤマダ',
'payment_details[given_name]': '太郎',
'payment_details[given_name_kana]': 'タロウ',
'payment_details[phone]': '080-1111-2222',
'payment_details[type]': 'bank_transfer'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
expiry_days: "14",
family_name: "山田",
family_name_kana: "ヤマダ",
given_name: "太郎",
given_name_kana: "タロウ",
phone: "080-1111-2222",
type: "bank_transfer"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=foo@bar.com" \
-d "payment_details[type]=paysafe_cash"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'foo@bar.com',
'payment_details[type]': 'paysafe_cash'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "foo@bar.com",
type: "paysafe_cash"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[type]': 'dospara',
'payment_details[user_no]': '12345',
'payment_details[user_password]': 'password'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
type: "dospara",
user_no: "12345",
user_password: "password"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[brand]=au" \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=japan_mobile"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[brand]': 'au',
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'japan_mobile'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
brand: "au",
email: "test@example.com",
type: "japan_mobile"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'foo@bar.com',
'payment_details[return_url]': 'http://example.com',
'payment_details[type]': 'zgold'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "foo@bar.com",
return_url: "http://example.com",
type: "zgold"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'web_money'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "web_money"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'nanaco'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "nanaco"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=foo@bar.com" \
-d "payment_details[type]=paysafe_card"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'foo@bar.com',
'payment_details[type]': 'paysafe_card'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "foo@bar.com",
type: "paysafe_card"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=merpay"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'merpay'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "merpay"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=rakutenpay"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'rakutenpay'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "rakutenpay"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[culture_id]': '11111111',
'payment_details[culture_password]': '11111111',
'payment_details[type]': 'culture_voucher'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
culture_id: "11111111",
culture_password: "11111111",
type: "culture_voucher"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[birthday]=111111" \
-d "payment_details[type]=toss"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[birthday]': '111111',
'payment_details[type]': 'toss'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
birthday: "111111",
type: "toss"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[happy_money_id]': '11111111',
'payment_details[happy_money_password]': '11111111',
'payment_details[type]': 'happy_money'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
happy_money_id: "11111111",
happy_money_password: "11111111",
type: "happy_money"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[month]=01" \
-d "payment_details[name]=Taro Yamada" \
-d "payment_details[number]=4111111111111111" \
-d "payment_details[type]=credit_card" \
-d "payment_details[verification_value]=123" \
-d "payment_details[year]=2025"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[month]': '01',
'payment_details[name]': 'Taro Yamada',
'payment_details[number]': '4111111111111111',
'payment_details[type]': 'credit_card',
'payment_details[verification_value]': '123',
'payment_details[year]': '2025'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
month: "01",
name: "Taro Yamada",
number: "4111111111111111",
type: "credit_card",
verification_value: "123",
year: "2025"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=foo@bar.com" \
-d "payment_details[type]=cvs"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'foo@bar.com',
'payment_details[type]': 'cvs'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "foo@bar.com",
type: "cvs"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
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"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[prepaid_number]': '1111111111111111',
'payment_details[type]': 'steam_prepaid_card'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
prepaid_number: "1111111111111111",
type: "steam_prepaid_card"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=linepay"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'linepay'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "linepay"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[provider]=mega-shark" \
-d "payment_details[type]=nexus_transfer"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[provider]': 'mega-shark',
'payment_details[type]': 'nexus_transfer'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
provider: "mega-shark",
type: "nexus_transfer"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=paypay"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'paypay'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "paypay"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=paidy" \
-d "payment_details[customer_name]=山田太郎" \
-d "payment_details[shipping_address_city]=武蔵野市" \
-d "payment_details[shipping_address_line1]=いちご吉祥寺ビル 4F" \
-d "payment_details[shipping_address_line2]=吉祥寺本町 2 丁目 5 番 10 号" \
-d "payment_details[shipping_address_state]=東京都" \
-d "payment_details[shipping_address_zip]=1800004" \
-d "payment_details[shipping_address_country]=JPY"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'paidy',
'payment_details[customer_name]': '山田太郎',
'payment_details[shipping_address_city]': '武蔵野市',
'payment_details[shipping_address_line1]': 'いちご吉祥寺ビル 4F',
'payment_details[shipping_address_line2]': '吉祥寺本町 2 丁目 5 番 10 号',
'payment_details[shipping_address_state]': '東京都',
'payment_details[shipping_address_zip]': '1800004',
'payment_details[shipping_address_country]': 'JPY'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "paidy",
customer_name: "山田太郎",
shipping_address_city: "武蔵野市",
shipping_address_line1: "いちご吉祥寺ビル 4F",
shipping_address_line2: "吉祥寺本町 2 丁目 5 番 10 号",
shipping_address_state: "東京都",
shipping_address_zip: "1800004",
shipping_address_country: "JPY"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=alipay" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'alipay',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "alipay",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=bancontact" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'bancontact',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "bancontact",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=blik" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'blik',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "blik",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=eps" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'eps',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "eps",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=giropay" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'giropay',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "giropay",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=ideal" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'ideal',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "ideal",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=multibanco" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'multibanco',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "multibanco",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=mybank" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'mybank',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "mybank",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=przelewy24" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'przelewy24',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "przelewy24",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=sofortbanking" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'sofortbanking',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "sofortbanking",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=unionpay" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'unionpay',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "unionpay",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=wechatpay" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'wechatpay',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "wechatpay",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=dragonpay" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'dragonpay',
'payment_details[phone]': '01234567890',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "dragonpay",
phone: "01234567890",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=grabpayotp" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'grabpayotp',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "grabpayotp",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=enets" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'enets',
'payment_details[phone]': '01234567890',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "enets",
phone: "01234567890",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=fpx" \
-d "payment_details[phone]=01234567890" \
-d "payment_details[name]=name"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'fpx',
'payment_details[phone]': '01234567890',
'payment_details[name]': 'name'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "fpx",
phone: "01234567890",
name: "name"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
- cURL
- Node.js
- Ruby
curl -X POST https://komoju.com/api/v1/tokens \
-u sk_123456: \
-d "payment_details[email]=test@example.com" \
-d "payment_details[type]=payco"
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_data = querystring.stringify({
'payment_details[email]': 'test@example.com',
'payment_details[type]': 'payco'
});
var post_options = {
host: 'komoju.com',
port: '443',
path: '/api/v1/tokens',
method: 'POST',
headers: {
'Authorization': auth,
'Content-Length': Buffer.byteLength(post_data)
}
};
var post_req = https.request(post_options, function(res) {
res.setEncoding('utf8');
res.on('data', function (chunk) {
console.log(chunk);
});
});
post_req.write(post_data);
post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/tokens')
https = Net::HTTP.new(uri.host, uri.port)
https.use_ssl = true
secret_key = 'sk_123456'
auth = Base64.encode64("#{secret_key}:")
headers = {
'Content-Type' => 'application/json',
'Authorization' => "Basic #{auth}"
}
body = {
payment_details: {
email: "test@example.com",
type: "payco"
}
}
res = https.post(
uri.path,
body.to_json,
headers
)
puts res.body
{
"id": "tok_5r33l5ghtndrpm4gys7amg3e7",
"resource": "token",
"created_at": "2020-06-09T07:41:53Z",
"payment_details": {
"type": "mobile",
"email": "foo@bar.com"
}
}
{
"id": "tok_d88v4ikpu9rovtcmawbvm4c3o",
"resource": "token",
"created_at": "2020-06-09T07:41:53Z",
"payment_details": {
"type": "konbini",
"store": "lawson",
"email": "test@example.com",
"phone": "090-1111-2222"
}
}
{
"id": "tok_eyqjai9x8ev74cyjm45h78b14",
"resource": "token",
"created_at": "2020-06-09T07:41:54Z",
"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_ed0lhhez670qq99jotxf6o1bp",
"resource": "token",
"created_at": "2020-06-09T07:41:54Z",
"payment_details": {
"type": "bit_cash",
"email": "test@example.com"
}
}
{
"id": "tok_1zz7p1bvvyru4mjr6d51z5p9r",
"resource": "token",
"created_at": "2020-06-09T07:41:54Z",
"payment_details": {
"type": "net_cash",
"email": "test@example.com"
}
}
{
"id": "tok_9l670rtg9qn7m30e4e2ny8g8n",
"resource": "token",
"created_at": "2020-06-09T07:41: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_d7cwkj2of6as6h7vjc0wzqcah",
"resource": "token",
"created_at": "2020-06-09T07:41:55Z",
"payment_details": {
"type": "paysafe_cash",
"email": "foo@bar.com"
}
}
{
"id": "tok_ci48yrk7v9z390c7xlakdbm91",
"resource": "token",
"created_at": "2020-06-09T07:41:55Z",
"payment_details": {
"type": "dospara"
}
}
{
"id": "tok_djhm3kf4d9zsvs85cxh0suwoj",
"resource": "token",
"created_at": "2020-06-09T07:41:55Z",
"payment_details": {
"type": "japan_mobile",
"email": "test@example.com"
}
}
{
"id": "tok_2zfo99po34f8qjhdq826xhjec",
"resource": "token",
"created_at": "2020-06-09T07:41:55Z",
"payment_details": {
"type": "zgold",
"email": "foo@bar.com"
}
}
{
"id": "tok_4fgro2k86q3ppi30rb4edwmci",
"resource": "token",
"created_at": "2020-06-09T07:41:55Z",
"payment_details": {
"type": "web_money",
"email": "test@example.com"
}
}
{
"id": "tok_f45b5921cd21wc5anjk9t4uyd",
"resource": "token",
"created_at": "2020-06-09T07:41:56Z",
"payment_details": {
"type": "nanaco",
"email": "test@example.com"
}
}
{
"id": "tok_443oz6yruz1u92lxikbmcxi43",
"resource": "token",
"created_at": "2020-06-09T07:41:56Z",
"payment_details": {
"type": "paysafe_card",
"email": "foo@bar.com"
}
}
{
"id": "tok_2v5gzkkemvgpp58bymr51sreq",
"resource": "token",
"created_at": "2020-06-09T07:41:56Z",
"payment_details": {
"type": "merpay",
"email": "test@example.com"
}
}
{
"id": "tok_2v5gzkkemvgpp58bymr51sreq",
"resource": "token",
"created_at": "2020-06-09T07:41:56Z",
"payment_details": {
"type": "rakutenpay",
"email": "test@example.com"
}
}
{
"id": "tok_7ejp2dq8ei93j0ckbt4va82kb",
"resource": "token",
"created_at": "2020-06-09T07:41:56Z",
"payment_details": {
"type": "culture_voucher"
}
}
{
"id": "tok_6jtgptn0oyc0tfsos19o8wtn3",
"resource": "token",
"created_at": "2020-06-09T07:41:57Z",
"payment_details": {
"type": "toss"
}
}
{
"id": "tok_3swi993oq8w13ebxkz5yszsgv",
"resource": "token",
"created_at": "2020-06-09T07:41:57Z",
"payment_details": {
"type": "happy_money"
}
}
{
"id": "tok_donqjgn5pzgaeepqztogwdjdu",
"resource": "token",
"created_at": "2020-06-09T07:41:57Z",
"payment_details": {
"type": "credit_card",
"email": "test@example.com"
}
}
{
"id": "tok_632przb9tkxnlhfrqpk666wrr",
"resource": "token",
"created_at": "2020-06-09T07:41:57Z",
"payment_details": {
"type": "cvs",
"email": "foo@bar.com"
}
}
{
"id": "tok_dj2gfn1nrtd5apvglzrtz3zvk",
"resource": "token",
"created_at": "2020-06-09T07:41:57Z",
"payment_details": {
"type": "steam_prepaid_card",
"email": "test@example.com"
}
}
{
"id": "tok_0e2k3bbhjlcdg4q08bx2zns4r",
"resource": "token",
"created_at": "2020-06-09T07:41:58Z",
"payment_details": {
"type": "linepay",
"email": "test@example.com"
}
}
{
"id": "tok_6ivp5ygiqmyh136utf0mqaogg",
"resource": "token",
"created_at": "2020-06-09T07:41:58Z",
"payment_details": {
"type": "nexus_transfer"
}
}
{
"id": "tok_7dc82thzz1eeujm00nei4zb9f",
"resource": "token",
"created_at": "2022-12-21T02:36:39Z",
"payment_details": {
"email": "test@example.com",
"type": "paypay"
}
}
{
"id": "tok_0vfd872iptbdc3oakn3pqwdat",
"resource": "token",
"created_at": "2022-12-21T03:06:42Z",
"payment_details": {
"email": "test@example.com",
"type": "paidy"
}
}
{
"id": "tok_a8rypyjy4dsjpfa2be67i7ieu",
"resource": "token",
"created_at": "2022-12-21T03:15:43Z",
"payment_details": {
"email": "test@example.com",
"type": "alipay"
}
}
{
"id": "tok_bxvdc2707pwomd76cvrcf3338",
"resource": "token",
"created_at": "2022-12-21T03:31:04Z",
"payment_details": {
"email": "test@example.com",
"type": "bancontact"
}
}
{
"id": "tok_5re7oabc278yd9ow7ddbbyhar",
"resource": "token",
"created_at": "2022-12-21T03:34:28Z",
"payment_details": {
"email": "test@example.com",
"type": "blik"
}
}
{
"id": "tok_8lddcb23dbqqamf1wi6qbw2rg",
"resource": "token",
"created_at": "2022-12-21T03:43:34Z",
"payment_details": {
"email": "test@example.com",
"type": "eps"
}
}
{
"id": "tok_2fforzg9sz3ewnd8qdj0s2tfg",
"resource": "token",
"created_at": "2022-12-21T03:46:48Z",
"payment_details": {
"email": "test@example.com",
"type": "giropay"
}
}
{
"id": "tok_5klorzg9sz7eund9qdj0s2t69",
"resource": "token",
"created_at": "2022-12-21T03:47:48Z",
"payment_details": {
"email": "test@example.com",
"type": "ideal"
}
}
{
"id": "tok_asm0r0njfe9sylnq4lp1xx5kg",
"resource": "token",
"created_at": "2022-12-21T03:48:48Z",
"payment_details": {
"email": "test@example.com",
"type": "multibanco"
}
}
{
"id": "tok_8hxszonl9dk6fjoc1jpqqte4w",
"resource": "token",
"created_at": "2022-12-21T03:49:48Z",
"payment_details": {
"email": "test@example.com",
"type": "mybank"
}
}
{
"id": "tok_3ot3c5einkrdpa0rsekls4zyg",
"resource": "token",
"created_at": "2022-12-21T03:50:48Z",
"payment_details": {
"email": "test@example.com",
"type": "przelewy24"
}
}
{
"id": "tok_8y8ujz8ru56ggzw6r5njav8hs",
"resource": "token",
"created_at": "2022-12-21T03:51:48Z",
"payment_details": {
"email": "test@example.com",
"type": "sofortbanking"
}
}
{
"id": "tok_c44ofq5hid6a8kcte5tticqur",
"resource": "token",
"created_at": "2022-12-21T03:53:48Z",
"payment_details": {
"email": "test@example.com",
"type": "unionpay"
}
}
{
"id": "tok_2ujcfk6ev4mzntzq75d53qc8v",
"resource": "token",
"created_at": "2022-12-21T03:53:48Z",
"payment_details": {
"email": "test@example.com",
"type": "wechatpay"
}
}
{
"id": "tok_ekokewuqoigz7xn4cun92054e",
"resource": "token",
"created_at": "2022-12-21T04:07:54Z",
"payment_details": {
"email": "test@example.com",
"type": "dragonpay",
"phone": "01234567890"
}
}
{
"id": "tok_ajiljzq85ys8wf1zr582vmemz",
"resource": "token",
"created_at": "2022-12-21T04:13:03Z",
"payment_details": {
"email": "test@example.com",
"type": "grabpayotp"
}
}
{
"id": "tok_cygfm681qko1ro8h0dxwpt3cf",
"resource": "token",
"created_at": "2022-12-21T04:15:54Z",
"payment_details": {
"email": "test@example.com",
"type": "enets",
"phone": "01234567890"
}
}
{
"id": "tok_346ue5o2rtu97neodxlt4qt25",
"resource": "token",
"created_at": "2022-12-21T04:18:54Z",
"payment_details": {
"email": "test@example.com",
"type": "fpx",
"phone": "01234567890"
}
}
{
"id": "tok_caa8ivrmj9rk05hkwnxoy3rlw",
"resource": "token",
"created_at": "2022-12-21T04:23:03Z",
"payment_details": {
"email": "test@example.com",
"type": "payco"
}
}
Using a Token
Once you've created a token it can be used in any API resource that accepts the payment_details
parameter.
For example, when creating a payment instead of a providing a JSON for payment_details
you can simply pass a token:
curl -X POST https://komoju.com/api/v1/payments \
-u komoju-mart: \
-d "amount=1000" \
-d "currency=JPY" \
-d "payment_details=tok_d7d3b7ea7a6910f1076bf025ad3276dac9360c9b3307cb92d77c93b62556077f3ifq39h3wnrlgkttrjm8c6g2e"
Permanent Storage
Payment details can be stored permenantly in KOMOJU by creating a customer resource.
When creating a customer you can pass the token in place of the payment_details
parameter. For example,
curl -X POST https://komoju.com/api/v1/customers \
-u komoju-mart: \
-d "payment_details=tok_d7d3b7ea7a6910f1076bf025ad3276dac9360c9b3307cb92d77c93b62556077f3ifq39h3wnrlgkttrjm8c6g2e"
Once a customer resource is created you can use the customer
parameter in the payments endpoint.
This will use the stored payment details to create the payment. For example,
curl -X POST https://komoju.com/api/v1/payments \
-u komoju-mart: \
-d "amount=1000" \
-d "currency=JPY" \
-d "customer=3lz38k1d12sr5e4ggchnhxdgk" \
For more information on updating and deleting customers please see the customer resource.
3D Secure 2.0 Support
You need to use Secure Token API in order to support 3D Secure 2.0 on credit card payments. Secure Token API is similar to Token API, it has additional authentication logic.
Please see this page for more information.