Payments

>>>

Retrieves a paginated list of payments. Pagination can be configured with page and per_page parameters.

Payments can be filtered by currency, external_order_num, and status.

A time range can be specified with start_time, and end_time.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/payments?per_page=1 \
  -u sk_123456:
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var get_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments?per_page=1',
  method: 'GET',
  headers: {
    'Authorization': auth
  }
};

var get_req = https.request(get_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

get_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments?per_page=1')
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}"
}

res = https.get(uri.path, headers)
puts res.body
{
  "resource": "list",
  "total": 2993,
  "page": 1,
  "per_page": 1,
  "last_page": 2993,
  "data": [
    {
      "id": "3p8pqbiyaprd7nvghr272z7yy",
      "resource": "payment",
      "status": "captured",
      "amount": 2780,
      "tax": 0,
      "customer": null,
      "payment_deadline": "2018-06-25T14:59:59Z",
      "payment_details": {
        "type": "credit_card",
        "email": "test@example.com",
        "brand": "visa",
        "last_four_digits": "1111",
        "month": 1,
        "year": 2019
      },
      "payment_method_fee": 0,
      "total": 2780,
      "currency": "JPY",
      "description": null,
      "captured_at": "2018-06-18T03:56:11Z",
      "external_order_num": "4573761470540-1bbf1e3247aa3258",
      "metadata": {
      },
      "created_at": "2018-06-18T03:56:06Z",
      "amount_refunded": 0,
      "locale": "ja",
      "session": null,
      "refunds": [

      ],
      "refund_requests": [

      ]
    }
  ]
}

パラメータ

名前 説明
start_time
任意

Query for records created after this time.

end_time
任意

Query for records created before this time.

per_page
任意

How many complete objects per page.

page
任意

Page number to query for.

currency
任意

3 letter ISO currency code used to pay.

external_order_num
任意

A unique ID from your application used to track this payment.

status
任意

The status of the payment.

>>>

Retrieves a single payment object by its id.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/payments/dp6f5pozrrh0nypa62joe09sd \
  -u sk_123456:
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var get_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/dp6f5pozrrh0nypa62joe09sd',
  method: 'GET',
  headers: {
    'Authorization': auth
  }
};

var get_req = https.request(get_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

get_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments/dp6f5pozrrh0nypa62joe09sd')
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}"
}

res = https.get(uri.path, headers)
puts res.body
{
  "id": "dp6f5pozrrh0nypa62joe09sd",
  "resource": "payment",
  "status": "pending",
  "amount": 300,
  "tax": 30,
  "customer": null,
  "payment_deadline": "2020-06-12T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "gordon@example.com",
    "store": "lawson",
    "confirmation_code": "1111",
    "receipt": "12345",
    "instructions_url": "https://komoju.com/en/instructions/dp6f5pozrrh0nypa62joe09sd"
  },
  "payment_method_fee": 0,
  "total": 330,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "ORDER14",
  "metadata": {
  },
  "created_at": "2020-06-09T07:42:03Z",
  "amount_refunded": 0,
  "locale": "en",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
>>>

POST /api/v1/payments
Create Payments

Creates a payment for a given amount and currency.

*Must specify exactly one of payment_details or customer.

サンプル

  • クレジットカード
  • コンビニ
  • 銀行振込
  • PayEasy
  • WebMoney
  • ビットキャッシュ
  • NET CASH
  • キャリア決済(日本)
  • LINE Pay
  • メルペイ
  • PayPay
  • Alipay
  • Bancontact
  • BLIK
  • EPS
  • Giropay
  • iDEAL
  • Multibanco
  • MyBank
  • paysafecard
  • paysafecash
  • Przelewy24
  • SOFORT Banking
  • UnionPay
  • Wechat Pay
  • PAYCO
  • Happy Money
  • Culture Voucher
  • キャリア決済

  • 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[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=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
            {
  "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": "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": 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": [

  ]
}
          

パラメータ

名前 説明
amount
必須

The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator.

currency
必須

3 letter ISO currency code used to pay.

payment_details
必須*

A hash or token describing the payment method used to make the payment. This or customer must be present when creating a payment.

customer
必須*

The ID of an existing customer in which to provide payment details for the payment. This or payment_details must be present.

platform_amount
任意

The amount that will be routed to the platform merchant. Required when the payment is split. See also Introduction to the Platform API.

platform_merchant
任意

The ID identifying the paltform merchant to which the fund is routed. Required when the payment is split. See also Introduction to the Platform API.

capture
任意

If false, the payment will be authorized but not be captured. This option is ignored if a payment type is not credit_card.

description
任意

Plaintext description for annotating a resource.

tax
任意

The amount of tax to be charged. Defaults to the highest consumption tax rate in Japan if omitted or set to 'auto'. Use a ‘.’ as a decimal separator, and no thousands separator. If the tax is more precise than the currency allows, it will be rounded using a round half up algorithm.

external_order_num
任意

A unique ID from your application used to track this payment.

locale
任意

Sets language of instruction page for supported payment methods. Valid options are 'en', 'ja', and 'ko'.

metadata
任意

A set of key-value pairs.

>>>

Updates a payment. Only a payment's description and metadata can be changed.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X PATCH https://komoju.com/api/v1/payments/ef4ptr6nxrb1kxcw5opvp0uk9 \
  -u sk_123456: \
  -d "description=updated description" \
  -d "metadata[updated]=metadata" 
var querystring = require('querystring');
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var patch_data = querystring.stringify({
  'description': 'updated description',
  'metadata[updated]': 'metadata'
});

var patch_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/ef4ptr6nxrb1kxcw5opvp0uk9',
  method: 'PATCH',
  headers: {
    'Authorization': auth,
    'Content-Length': Buffer.byteLength(patch_data)
  }
};

var patch_req = https.request(patch_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

patch_req.write(patch_data);
patch_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments/ef4ptr6nxrb1kxcw5opvp0uk9')
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 = {
  description: "updated description",
  metadata: {
    updated: "metadata"
  }
}

res = https.patch(
  uri.path,
  body.to_json,
  headers
)

puts res.body
{
  "id": "ef4ptr6nxrb1kxcw5opvp0uk9",
  "resource": "payment",
  "status": "pending",
  "amount": 300,
  "tax": 30,
  "customer": null,
  "payment_deadline": "2020-06-12T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "gordon@example.com",
    "store": "family-mart",
    "confirmation_code": "1111",
    "receipt": "12345",
    "instructions_url": "https://komoju.com/en/instructions/ef4ptr6nxrb1kxcw5opvp0uk9"
  },
  "payment_method_fee": 0,
  "total": 330,
  "currency": "JPY",
  "description": "updated description",
  "captured_at": null,
  "external_order_num": "ORDER17",
  "metadata": {
    "updated": "metadata"
  },
  "created_at": "2020-06-09T07:42:23Z",
  "amount_refunded": 0,
  "locale": "en",
  "refunds": [

  ],
  "refund_requests": [

  ]
}

パラメータ

名前 説明
description
任意

Plaintext description for annotating a resource.

metadata
任意

A set of key-value pairs.

>>>

Captures a payment. Only works on payments with a payment_type of "credit_card".

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/an707r5zejhfzp9y58ctqn2um/capture \
  -u sk_123456:
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/an707r5zejhfzp9y58ctqn2um/capture',
  method: 'POST',
  headers: {
    'Authorization': auth
  }
};

var post_req = https.request(post_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments/an707r5zejhfzp9y58ctqn2um/capture')
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}"
}

res = https.post(uri.path, '{}', headers)
puts res.body
{
  "id": "an707r5zejhfzp9y58ctqn2um",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 100,
  "customer": null,
  "payment_deadline": "2020-06-24T14: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:04Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2020-06-09T07:42:03Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
>>>

Refunds an arbitrary amount of money from an existing payment. If no amount is specified, the whole payment is refunded. When the payment has been fully refunded KOMOJU will send payment.refunded webhook.

For cash-based payment methods, Japanese customers must be redirected to redirect_url on the refund object to complete their refund. Upon navigating to redirect_url customers can select a convenience store where they can receive a receipt code for a cash refund. KOMOJU will send payment.refunded webhook once the customer has received their refund.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/b63kr222rtkvn3z6hhw7i4j3x/refund \
  -u sk_123456: \
  -d "amount=500" 
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': '500'
});

var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/b63kr222rtkvn3z6hhw7i4j3x/refund',
  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/b63kr222rtkvn3z6hhw7i4j3x/refund')
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: "500"
}

res = https.post(
  uri.path,
  body.to_json,
  headers
)

puts res.body
{
  "id": "b63kr222rtkvn3z6hhw7i4j3x",
  "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:20Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2020-06-09T07:42:19Z",
  "amount_refunded": 500,
  "locale": "ja",
  "refunds": [
    {
      "id": "3iytpjriy703rjjd50jco87nm",
      "resource": "refund",
      "status": "completed",
      "redirect_url": null,
      "amount": 500,
      "currency": "JPY",
      "payment": "b63kr222rtkvn3z6hhw7i4j3x",
      "description": null,
      "created_at": "2020-06-09T07:42:20Z",
      "chargeback": false
    }
  ],
  "refund_requests": [

  ]
}

パラメータ

名前 説明
amount
任意

The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator.

description
任意

Plaintext description for annotating a resource.

name
任意

The name of the customer.

email
任意

The e-mail address of the customer.

phone
任意

The phone number of the customer.

>>>

Refund requests can be used for payment methods that do not support refunds e.g. cash-based payment methods like Convenience Store, Bank Transfer, etc.

This provides an alternative refund option for cash based payments through a bank transfer.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/7czbdbavjdbl3jjkrd7c65wi5/refund_request \
  -u sk_123456: \
  -d "account_number=1234567" \
  -d "account_type=normal" \
  -d "amount=1000" \
  -d "bank_code=1234" \
  -d "bank_name=KOMOJU BANK" \
  -d "branch_number=123" \
  -d "branch_name=KOMOJU BRANCH" \
  -d "customer_name=John Doe" \
  -d "include_payment_method_fee=true" 
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({
  'account_number': '1234567',
  'account_type': 'normal',
  'amount': '1000',
  'bank_code': '1234',
  'bank_name': 'KOMOJU BANK',
  'branch_number': '123',
  'branch_name': 'KOMOJU BRANCH',
  'customer_name': 'John Doe',
  'include_payment_method_fee': 'true'
});

var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/7czbdbavjdbl3jjkrd7c65wi5/refund_request',
  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/7czbdbavjdbl3jjkrd7c65wi5/refund_request')
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 = {
  account_number: "1234567",
  account_type: "normal",
  amount: "1000",
  bank_code: "1234",
  bank_name: "KOMOJU BANK",
  branch_number: "123",
  branch_name: "KOMOJU BRANCH",
  customer_name: "John Doe",
  include_payment_method_fee: "true"
}

res = https.post(
  uri.path,
  body.to_json,
  headers
)

puts res.body
{
  "id": "7czbdbavjdbl3jjkrd7c65wi5",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 0,
  "customer": null,
  "payment_deadline": "2020-06-12T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "gordon@example.com",
    "store": "circle-k",
    "confirmation_code": null,
    "receipt": "12345",
    "instructions_url": "https://komoju.com/en/instructions/7czbdbavjdbl3jjkrd7c65wi5"
  },
  "payment_method_fee": 0,
  "total": 1000,
  "currency": "JPY",
  "description": null,
  "captured_at": "2020-06-07T14:59:59Z",
  "external_order_num": "ORDER4",
  "metadata": {
  },
  "created_at": "2020-06-09T07:41:58Z",
  "amount_refunded": 0,
  "locale": "en",
  "refunds": [

  ],
  "refund_requests": [
    {
      "id": "4f1jtn1rafgrrg9t23waobawp",
      "payment": "7czbdbavjdbl3jjkrd7c65wi5",
      "customer_name": "John Doe",
      "bank_code": "1234",
      "bank_name": "KOMOJU BANK",
      "branch_number": "123",
      "branch_name": "KOMOJU BRANCH",
      "account_number": "1234567",
      "status": "pending",
      "created_at": "2020-06-09T07:41:58Z"
    }
  ]
}

パラメータ

名前 説明
amount
必須

The amount to be charged before tax. Must be equal or greater than 0. Use a ‘.’ as a decimal separator, and no thousands separator.

customer_name
必須

The name of the customer.

bank_code
必須

The bank number.

bank_name
必須

The name of the bank.

branch_number
必須

The bank branch number.

branch_name
必須

The name of the bank branch.

account_type
必須

Bank account type normal or checking

account_number
必須

Bank account number.

include_payment_method_fee
必須

Whether or not to refund the payment's paymentmethodfee (also known as customer fee or kiosk fee). This fee is charged to customers for some payment methods e.g. Konbini, PayEasy, Bank Transfer, etc. Please note that when true the paymentmethodfee will be charged to your account.

description
任意

Plaintext description for annotating a resource.

>>>

Cancels a payment. The given payment must have a state of pending or authorized in order to be canceled.

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/551p58bphju7vj657gcbc9iq8/cancel \
  -u sk_123456:
var https = require('https');
var secret_key = 'sk_123456'
var auth = 'Basic ' + Buffer.from(secret_key + ':').toString('base64');
var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/payments/551p58bphju7vj657gcbc9iq8/cancel',
  method: 'POST',
  headers: {
    'Authorization': auth
  }
};

var post_req = https.request(post_options, function(res) {
    res.setEncoding('utf8');
    res.on('data', function (chunk) {
        console.log(chunk);
    });
});

post_req.end();
require 'uri'
require 'net/https'
require 'json'
require 'base64'
require 'pp'
uri = URI.parse('https://komoju.com/api/v1/payments/551p58bphju7vj657gcbc9iq8/cancel')
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}"
}

res = https.post(uri.path, '{}', headers)
puts res.body
{
  "id": "551p58bphju7vj657gcbc9iq8",
  "resource": "payment",
  "status": "cancelled",
  "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": "ek9e2",
    "receipt": "a8y03rvi8k",
    "instructions_url": "https://komoju.com/ja/instructions/551p58bphju7vj657gcbc9iq8"
  },
  "payment_method_fee": 0,
  "total": 1100,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2020-06-09T07:42:18Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}