Payments

>>>
List payments

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/payments \
  -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',
  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')
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": 0,
  "page": 1,
  "per_page": 10,
  "last_page": 0,
  "data": [

  ]
}
>>>
Show a payment

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/payments/807nhquor2u027yn30ssx008m \
  -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/807nhquor2u027yn30ssx008m',
  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/807nhquor2u027yn30ssx008m')
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": "807nhquor2u027yn30ssx008m",
  "resource": "payment",
  "status": "pending",
  "amount": 300,
  "tax": 30,
  "customer": null,
  "payment_deadline": "2018-11-16T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "gordon@example.com",
    "store": "seicomart",
    "confirmation_code": null,
    "receipt": "12345",
    "instructions_url": "https://komoju.com/en/instructions/807nhquor2u027yn30ssx008m"
  },
  "payment_method_fee": 0,
  "total": 330,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "ORDER1",
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "en",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
>>>

POST /api/v1/payments
Create a payment

Create a payment

サンプル

  • クレジットカード
  • コンビニ
  • 銀行振込
  • PayEasy
  • WebMoney
  • ビットキャッシュ
  • NET CASH

  • 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[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[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=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[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[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=JPY" \
  -d "external_order_num=123" \
  -d "metadata[foobar]=hoge" \
  -d "payment_details[email]=test@example.com" \
  -d "payment_details[family_name]=Yamada" \
  -d "payment_details[given_name]=Taro" \
  -d "payment_details[month]=01" \
  -d "payment_details[number]=4111111111111111" \
  -d "payment_details[type]=credit_card" \
  -d "payment_details[verification_value]=123" \
  -d "payment_details[year]=2023" 
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]': 'Yamada',
  'payment_details[given_name]': 'Taro',
  'payment_details[month]': '01',
  'payment_details[number]': '4111111111111111',
  'payment_details[type]': 'credit_card',
  'payment_details[verification_value]': '123',
  'payment_details[year]': '2023'
});

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: "Yamada",
    given_name: "Taro",
    month: "01",
    number: "4111111111111111",
    type: "credit_card",
    verification_value: "123",
    year: "2023"
  }
}

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=100" \
  -d "currency=JPY" \
  -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',
  '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",
  payment_details: {
    email: "test@example.com",
    prepaid_number: "1111111111111111",
    type: "bit_cash"
  }
}

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

puts res.body
            {
  "id": "07iedcgxay065ezhumssrw2by",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2014-11-29T14:59:59Z",
  "payment_details": {
    "type": "pay_easy",
    "email": "test@example.com",
    "bank_id": "58021",
    "customer_id": "WNT51720341",
    "confirmation_id": "3769",
    "instructions_url": "https://komoju.com/ja/instructions/07iedcgxay065ezhumssrw2by"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "8iq2urnegmrtezzx5qa3zy90w",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-16T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "test@example.com",
    "store": "lawson",
    "confirmation_code": "3769",
    "receipt": "WNT51790451",
    "instructions_url": "https://komoju.com/ja/instructions/8iq2urnegmrtezzx5qa3zy90w"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "6nokevt8phsi8u17061tjgk92",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "payment_details": {
    "type": "net_cash",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "c0gfz659e3qlk3i49x6taors4",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "web_money",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "0qqctds6w846ac22s1yyc4gdl",
  "resource": "payment",
  "status": "authorized",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14:59:59Z",
  "payment_details": {
    "type": "bank_transfer",
    "email": "test@example.com",
    "order_id": "D9555822685",
    "bank_name": "三井住友銀行",
    "account_branch_name": "ひなぎく",
    "account_number": "33",
    "account_type": "普通預金",
    "account_name": "株式会社DEGICA(カブシキガイシャ デジカ)",
    "instructions_url": "https://komoju.com/ja/instructions/0qqctds6w846ac22s1yyc4gdl"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "9y41gy3yffuk8qyamqir5z7bn",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "culture_voucher",
    "email": null,
    "culture_id": "11111111"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "KRW",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "b5jteviiy38ng7js5uebqprhn",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "payment_details": {
    "type": "nanaco",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "1111",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "1i3rilegwpnei2ef99mdcn303",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14:59:59Z",
  "payment_details": {
    "type": "credit_card",
    "email": "test@example.com",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "538rl207weidii7c2oa9ictxw",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "happy_money",
    "email": null,
    "happy_money_id": "11111111"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "KRW",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "8iweaxszvquslnrzwtrpwa8ew",
  "resource": "payment",
  "status": "captured",
  "amount": 100,
  "tax": 8,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "bit_cash",
    "email": "test@example.com"
  },
  "payment_method_fee": 0,
  "total": 108,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "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 of the transaction
capture
任意
If true, the payment will be immediately 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, or ‘auto’ to use the current consumption tax rate in Japan. Use a ‘.’ as a decimal separator, and no thousands separator. If the tax is more precise than the currency allows, it will be rounded using a round half up algorithm.
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
payment_details
任意
A hash or token describing the payment method used to make the payment.
customer
任意
The ID of an existing customer in which to provide payment details for the payment.
>>>
Update a payment

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X PATCH https://komoju.com/api/v1/payments/0jukv29k8px7fuykd6z89321k \
  -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/0jukv29k8px7fuykd6z89321k',
  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/0jukv29k8px7fuykd6z89321k')
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": "0jukv29k8px7fuykd6z89321k",
  "resource": "payment",
  "status": "pending",
  "amount": 300,
  "tax": 30,
  "customer": null,
  "payment_deadline": "2018-11-16T14: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/0jukv29k8px7fuykd6z89321k"
  },
  "payment_method_fee": 0,
  "total": 330,
  "currency": "JPY",
  "description": "updated description",
  "captured_at": null,
  "external_order_num": "ORDER2",
  "metadata": {
    "updated": "metadata"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "en",
  "refunds": [

  ],
  "refund_requests": [

  ]
}

パラメータ

名前 説明
description
任意
Plaintext description for annotating a resource.
metadata
任意
A set of key-value pairs
>>>
Capture a payment

サンプル

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/dznt1azx3fxvwyq9sftdy43ec/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/dznt1azx3fxvwyq9sftdy43ec/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/dznt1azx3fxvwyq9sftdy43ec/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": "dznt1azx3fxvwyq9sftdy43ec",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14:59:59Z",
  "payment_details": {
    "type": "credit_card",
    "email": "test@example.com",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": "123",
  "metadata": {
    "foobar": "hoge"
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
>>>
Refund a payment

サンプル

  • クレジットカード
  • ビットキャッシュ
  • NET CASH

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/85lca44d2iegy6r8tb90r71qi/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/85lca44d2iegy6r8tb90r71qi/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/85lca44d2iegy6r8tb90r71qi/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
  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/7cjp5m5sq0poy4iyqtimlo5mj/refund \
  -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/7cjp5m5sq0poy4iyqtimlo5mj/refund',
  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/7cjp5m5sq0poy4iyqtimlo5mj/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}"
}

res = https.post(uri.path, '{}', headers)
puts res.body
  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/10laoeawfjglc1r776cvl4ywa/refund \
  -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/10laoeawfjglc1r776cvl4ywa/refund',
  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/10laoeawfjglc1r776cvl4ywa/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}"
}

res = https.post(uri.path, '{}', headers)
puts res.body
  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/2txito8vzl1jtlac2h9v3d6ut/refund \
  -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/2txito8vzl1jtlac2h9v3d6ut/refund',
  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/2txito8vzl1jtlac2h9v3d6ut/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}"
}

res = https.post(uri.path, '{}', headers)
puts res.body
            {
  "id": "85lca44d2iegy6r8tb90r71qi",
  "resource": "payment",
  "status": "captured",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14:59:59Z",
  "payment_details": {
    "type": "credit_card",
    "email": "test@example.com",
    "brand": "visa",
    "last_four_digits": "1111",
    "month": 1,
    "year": 2023
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 500,
  "locale": "ja",
  "refunds": [
    {
      "id": "4vjammok0g5u4t25h1d6he3cg",
      "resource": "refund",
      "amount": 500,
      "currency": "JPY",
      "payment": "85lca44d2iegy6r8tb90r71qi",
      "description": null,
      "created_at": "2018-11-13T06:20:21Z",
      "chargeback": null
    }
  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "7cjp5m5sq0poy4iyqtimlo5mj",
  "resource": "payment",
  "status": "refunded",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "payment_details": {
    "type": "net_cash",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "cdef",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 1080,
  "locale": "ja",
  "refunds": [
    {
      "id": "5hacawhgwld7jpcd80ex6qomv",
      "resource": "refund",
      "amount": 1080,
      "currency": "JPY",
      "payment": "7cjp5m5sq0poy4iyqtimlo5mj",
      "description": null,
      "created_at": "2018-11-13T06:20:21Z",
      "chargeback": null
    }
  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "10laoeawfjglc1r776cvl4ywa",
  "resource": "payment",
  "status": "refunded",
  "amount": 100,
  "tax": 8,
  "customer": null,
  "payment_deadline": null,
  "payment_details": {
    "type": "bit_cash",
    "email": "test@example.com"
  },
  "payment_method_fee": 0,
  "total": 108,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 108,
  "locale": "ja",
  "refunds": [
    {
      "id": "c2ucnd4u3sp4221tyghlwa8zz",
      "resource": "refund",
      "amount": 108,
      "currency": "JPY",
      "payment": "10laoeawfjglc1r776cvl4ywa",
      "description": null,
      "created_at": "2018-11-13T06:20:21Z",
      "chargeback": null
    }
  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "2txito8vzl1jtlac2h9v3d6ut",
  "resource": "payment",
  "status": "refunded",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T06:20:21Z",
  "payment_details": {
    "type": "nanaco",
    "email": "test@example.com",
    "short_amount": 0,
    "prepaid_cards": [
      {
        "last_four_digits": "cdef",
        "points": 1080
      }
    ]
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": "2018-11-13T06:20:21Z",
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 1080,
  "locale": "ja",
  "refunds": [
    {
      "id": "bxi52kh19h1hxjgzx1nyo52j4",
      "resource": "refund",
      "amount": 1080,
      "currency": "JPY",
      "payment": "2txito8vzl1jtlac2h9v3d6ut",
      "description": null,
      "created_at": "2018-11-13T06:20:21Z",
      "chargeback": null
    }
  ],
  "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.
>>>
Cancel a payment

サンプル

  • コンビニ
  • 銀行振込
  • PayEasy

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/ah2vo1v9k91s24pswcyc1kf1f/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/ah2vo1v9k91s24pswcyc1kf1f/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/ah2vo1v9k91s24pswcyc1kf1f/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
  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/cmpdo1w7j49y5z9o0fftyfsqt/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/cmpdo1w7j49y5z9o0fftyfsqt/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/cmpdo1w7j49y5z9o0fftyfsqt/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
  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/payments/2tfr6s3esn8699u7vidaqjs1e/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/2tfr6s3esn8699u7vidaqjs1e/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/2tfr6s3esn8699u7vidaqjs1e/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": "ah2vo1v9k91s24pswcyc1kf1f",
  "resource": "payment",
  "status": "cancelled",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-16T14:59:59Z",
  "payment_details": {
    "type": "konbini",
    "email": "test@example.com",
    "store": "lawson",
    "confirmation_code": "2222",
    "receipt": "90865881197",
    "instructions_url": "https://komoju.com/ja/instructions/ah2vo1v9k91s24pswcyc1kf1f"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "cmpdo1w7j49y5z9o0fftyfsqt",
  "resource": "payment",
  "status": "cancelled",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-23T14:59:59Z",
  "payment_details": {
    "type": "pay_easy",
    "email": "test@example.com",
    "bank_id": "7qg5m",
    "customer_id": "7559i8fdkl",
    "confirmation_id": "p2z38e6a1q",
    "instructions_url": "https://komoju.com/ja/instructions/cmpdo1w7j49y5z9o0fftyfsqt"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}
          
            {
  "id": "2tfr6s3esn8699u7vidaqjs1e",
  "resource": "payment",
  "status": "cancelled",
  "amount": 1000,
  "tax": 80,
  "customer": null,
  "payment_deadline": "2018-11-20T14:59:59Z",
  "payment_details": {
    "type": "bank_transfer",
    "email": "test@example.com",
    "order_id": "Y8888264543",
    "bank_name": "三井住友銀行",
    "account_branch_name": "ひなぎく",
    "account_number": "12",
    "account_type": "普通預金",
    "account_name": "株式会社DEGICA(カブシキガイシャ デジカ)",
    "instructions_url": "https://komoju.com/ja/instructions/2tfr6s3esn8699u7vidaqjs1e"
  },
  "payment_method_fee": 0,
  "total": 1080,
  "currency": "JPY",
  "description": null,
  "captured_at": null,
  "external_order_num": null,
  "metadata": {
  },
  "created_at": "2018-11-13T06:20:21Z",
  "amount_refunded": 0,
  "locale": "ja",
  "refunds": [

  ],
  "refund_requests": [

  ]
}