Accounts

>>>

POST /api/v1/accounts
Create Accounts

Creates a new account.

betaThis API is a pre-release. Please contact KOMOJU to obtain more usage instructions before using it.

샘플

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/accounts \
  -u sk_123456: \
  -d "name=Submerchant" \
  -d "default_currency=TWD" \
  -d "time_zone=Europe/London" 
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({
  'name': 'Submerchant',
  'default_currency': 'TWD',
  'time_zone': 'Europe/London'
});

var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/accounts',
  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/accounts')
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 = {
  name: "Submerchant",
  default_currency: "TWD",
  time_zone: "Europe/London"
}

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

puts res.body
{
  "id": "0sf3wwxqv0vbuvxhur81yyw51",
  "resource": "account",
  "name": "Submerchant",
  "default_currency": "TWD",
  "time_zone": "Europe/London",
  "live_merchant": "4nmn1oy49gllocv86ixgfqwvx",
  "test_merchant": "1ugmg5i09mifg6zlyn2mzh3p7",
  "accepted_service_agreement_at": null,
  "accepted_service_agreement_ip": null,
  "created_at": "2021-02-17T03:01:31Z",
  "updated_at": "2021-02-17T03:01:31Z"
}

파라미터

성명 설명
name
필수

The unique name of the account.

default_currency
필수

The three-letter ISO currency code serving as the default currency of the account.

It must be one of the following values
  • JPY
  • USD
  • TWD
  • EUR
  • KRW
  • PLN

time_zone
필수

The time zone of the account.

It must be one of the following values
  • Africa/Algiers
  • Africa/Cairo
  • Africa/Casablanca
  • Africa/Harare
  • Africa/Johannesburg
  • Africa/Monrovia
  • Africa/Nairobi
  • America/Argentina/Buenos_Aires
  • America/Bogota
  • America/Caracas
  • America/Chicago
  • America/Chihuahua
  • America/Denver
  • America/Godthab
  • America/Guatemala
  • America/Guyana
  • America/Halifax
  • America/Indiana/Indianapolis
  • America/Juneau
  • America/La_Paz
  • America/Lima
  • America/Los_Angeles
  • America/Mazatlan
  • America/Mexico_City
  • America/Monterrey
  • America/Montevideo
  • America/New_York
  • America/Phoenix
  • America/Puerto_Rico
  • America/Regina
  • America/Santiago
  • America/Sao_Paulo
  • America/St_Johns
  • America/Tijuana
  • Asia/Almaty
  • Asia/Baghdad
  • Asia/Baku
  • Asia/Bangkok
  • Asia/Chongqing
  • Asia/Colombo
  • Asia/Dhaka
  • Asia/Hong_Kong
  • Asia/Irkutsk
  • Asia/Jakarta
  • Asia/Jerusalem
  • Asia/Kabul
  • Asia/Kamchatka
  • Asia/Karachi
  • Asia/Kathmandu
  • Asia/Kolkata
  • Asia/Krasnoyarsk
  • Asia/Kuala_Lumpur
  • Asia/Kuwait
  • Asia/Magadan
  • Asia/Muscat
  • Asia/Novosibirsk
  • Asia/Rangoon
  • Asia/Riyadh
  • Asia/Seoul
  • Asia/Shanghai
  • Asia/Singapore
  • Asia/Srednekolymsk
  • Asia/Taipei
  • Asia/Tashkent
  • Asia/Tbilisi
  • Asia/Tehran
  • Asia/Tokyo
  • Asia/Ulaanbaatar
  • Asia/Urumqi
  • Asia/Vladivostok
  • Asia/Yakutsk
  • Asia/Yekaterinburg
  • Asia/Yerevan
  • Atlantic/Azores
  • Atlantic/Cape_Verde
  • Atlantic/South_Georgia
  • Australia/Adelaide
  • Australia/Brisbane
  • Australia/Darwin
  • Australia/Hobart
  • Australia/Melbourne
  • Australia/Perth
  • Australia/Sydney
  • Etc/GMT+12
  • Etc/UTC
  • Europe/Amsterdam
  • Europe/Athens
  • Europe/Belgrade
  • Europe/Berlin
  • Europe/Bratislava
  • Europe/Brussels
  • Europe/Bucharest
  • Europe/Budapest
  • Europe/Copenhagen
  • Europe/Dublin
  • Europe/Helsinki
  • Europe/Istanbul
  • Europe/Kaliningrad
  • Europe/Kiev
  • Europe/Lisbon
  • Europe/Ljubljana
  • Europe/London
  • Europe/Madrid
  • Europe/Minsk
  • Europe/Moscow
  • Europe/Paris
  • Europe/Prague
  • Europe/Riga
  • Europe/Rome
  • Europe/Samara
  • Europe/Sarajevo
  • Europe/Skopje
  • Europe/Sofia
  • Europe/Stockholm
  • Europe/Tallinn
  • Europe/Vienna
  • Europe/Vilnius
  • Europe/Volgograd
  • Europe/Warsaw
  • Europe/Zagreb
  • Europe/Zurich
  • Pacific/Apia
  • Pacific/Auckland
  • Pacific/Chatham
  • Pacific/Fakaofo
  • Pacific/Fiji
  • Pacific/Guadalcanal
  • Pacific/Guam
  • Pacific/Honolulu
  • Pacific/Majuro
  • Pacific/Midway
  • Pacific/Noumea
  • Pacific/Pago_Pago
  • Pacific/Port_Moresby
  • Pacific/Tongatapu

>>>

Show the information of an existing account.

betaThis API is a pre-release. Please contact KOMOJU to obtain more usage instructions before using it.

샘플

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/accounts/0sf3wwxqv0vbuvxhur81yyw51 \
  -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/accounts/0sf3wwxqv0vbuvxhur81yyw51',
  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/accounts/0sf3wwxqv0vbuvxhur81yyw51')
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": "0sf3wwxqv0vbuvxhur81yyw51",
  "resource": "account",
  "name": "Submerchant",
  "default_currency": "TWD",
  "time_zone": "Europe/London",
  "live_merchant": "4nmn1oy49gllocv86ixgfqwvx",
  "test_merchant": "1ugmg5i09mifg6zlyn2mzh3p7",
  "accepted_service_agreement_at": null,
  "accepted_service_agreement_ip": null,
  "created_at": "2021-02-17T03:01:31Z",
  "updated_at": "2021-02-17T03:01:31Z"
}
>>>

Update the information of an existing account.

betaThis API is a pre-release. Please contact KOMOJU to obtain more usage instructions before using it.

샘플

  • cURL
  • Node.js
  • Ruby
curl -X PATCH https://komoju.com/api/v1/accounts/0sf3wwxqv0vbuvxhur81yyw51 \
  -u sk_123456: \
  -d "time_zone=Asia/Tokyo" 
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({
  'time_zone': 'Asia/Tokyo'
});

var patch_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/accounts/0sf3wwxqv0vbuvxhur81yyw51',
  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/accounts/0sf3wwxqv0vbuvxhur81yyw51')
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 = {
  time_zone: "Asia/Tokyo"
}

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

puts res.body
{
  "id": "0sf3wwxqv0vbuvxhur81yyw51",
  "resource": "account",
  "name": "Submerchant",
  "default_currency": "TWD",
  "time_zone": "Asia/Tokyo",
  "live_merchant": "4nmn1oy49gllocv86ixgfqwvx",
  "test_merchant": "1ugmg5i09mifg6zlyn2mzh3p7",
  "accepted_service_agreement_at": null,
  "accepted_service_agreement_ip": null,
  "created_at": "2021-02-17T03:01:31Z",
  "updated_at": "2021-02-17T03:01:31Z"
}

파라미터

성명 설명
default_currency
임의

The three-letter ISO currency code serving as the default currency of the account.

It must be one of the following values
  • JPY
  • USD
  • TWD
  • EUR
  • KRW
  • PLN

time_zone
임의

The time zone of the account.

It must be one of the following values
  • Africa/Algiers
  • Africa/Cairo
  • Africa/Casablanca
  • Africa/Harare
  • Africa/Johannesburg
  • Africa/Monrovia
  • Africa/Nairobi
  • America/Argentina/Buenos_Aires
  • America/Bogota
  • America/Caracas
  • America/Chicago
  • America/Chihuahua
  • America/Denver
  • America/Godthab
  • America/Guatemala
  • America/Guyana
  • America/Halifax
  • America/Indiana/Indianapolis
  • America/Juneau
  • America/La_Paz
  • America/Lima
  • America/Los_Angeles
  • America/Mazatlan
  • America/Mexico_City
  • America/Monterrey
  • America/Montevideo
  • America/New_York
  • America/Phoenix
  • America/Puerto_Rico
  • America/Regina
  • America/Santiago
  • America/Sao_Paulo
  • America/St_Johns
  • America/Tijuana
  • Asia/Almaty
  • Asia/Baghdad
  • Asia/Baku
  • Asia/Bangkok
  • Asia/Chongqing
  • Asia/Colombo
  • Asia/Dhaka
  • Asia/Hong_Kong
  • Asia/Irkutsk
  • Asia/Jakarta
  • Asia/Jerusalem
  • Asia/Kabul
  • Asia/Kamchatka
  • Asia/Karachi
  • Asia/Kathmandu
  • Asia/Kolkata
  • Asia/Krasnoyarsk
  • Asia/Kuala_Lumpur
  • Asia/Kuwait
  • Asia/Magadan
  • Asia/Muscat
  • Asia/Novosibirsk
  • Asia/Rangoon
  • Asia/Riyadh
  • Asia/Seoul
  • Asia/Shanghai
  • Asia/Singapore
  • Asia/Srednekolymsk
  • Asia/Taipei
  • Asia/Tashkent
  • Asia/Tbilisi
  • Asia/Tehran
  • Asia/Tokyo
  • Asia/Ulaanbaatar
  • Asia/Urumqi
  • Asia/Vladivostok
  • Asia/Yakutsk
  • Asia/Yekaterinburg
  • Asia/Yerevan
  • Atlantic/Azores
  • Atlantic/Cape_Verde
  • Atlantic/South_Georgia
  • Australia/Adelaide
  • Australia/Brisbane
  • Australia/Darwin
  • Australia/Hobart
  • Australia/Melbourne
  • Australia/Perth
  • Australia/Sydney
  • Etc/GMT+12
  • Etc/UTC
  • Europe/Amsterdam
  • Europe/Athens
  • Europe/Belgrade
  • Europe/Berlin
  • Europe/Bratislava
  • Europe/Brussels
  • Europe/Bucharest
  • Europe/Budapest
  • Europe/Copenhagen
  • Europe/Dublin
  • Europe/Helsinki
  • Europe/Istanbul
  • Europe/Kaliningrad
  • Europe/Kiev
  • Europe/Lisbon
  • Europe/Ljubljana
  • Europe/London
  • Europe/Madrid
  • Europe/Minsk
  • Europe/Moscow
  • Europe/Paris
  • Europe/Prague
  • Europe/Riga
  • Europe/Rome
  • Europe/Samara
  • Europe/Sarajevo
  • Europe/Skopje
  • Europe/Sofia
  • Europe/Stockholm
  • Europe/Tallinn
  • Europe/Vienna
  • Europe/Vilnius
  • Europe/Volgograd
  • Europe/Warsaw
  • Europe/Zagreb
  • Europe/Zurich
  • Pacific/Apia
  • Pacific/Auckland
  • Pacific/Chatham
  • Pacific/Fakaofo
  • Pacific/Fiji
  • Pacific/Guadalcanal
  • Pacific/Guam
  • Pacific/Honolulu
  • Pacific/Majuro
  • Pacific/Midway
  • Pacific/Noumea
  • Pacific/Pago_Pago
  • Pacific/Port_Moresby
  • Pacific/Tongatapu

>>>

Accept the service agreement on behalf of an existing account. It is the API caller's responsibility to ensure that the account owner has reviewed the Payment Processing Service Terms of Use or 代金収納代行サービス利用規約.

betaThis API is a pre-release. Please contact KOMOJU to obtain more usage instructions before using it.

샘플

  • cURL
  • Node.js
  • Ruby
curl -X POST https://komoju.com/api/v1/accounts/0sf3wwxqv0vbuvxhur81yyw51/accept_service_agreement \
  -u sk_123456: \
  -d "accepted_service_agreement_at=2021-02-25T07:45:25Z" \
  -d "accepted_service_agreement_ip=2001:0db8:85a3:0000:0000:8a2e:0370:7334" 
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({
  'accepted_service_agreement_at': '2021-02-25T07:45:25Z',
  'accepted_service_agreement_ip': '2001:0db8:85a3:0000:0000:8a2e:0370:7334'
});

var post_options = {
  host: 'komoju.com',
  port: '443',
  path: '/api/v1/accounts/0sf3wwxqv0vbuvxhur81yyw51/accept_service_agreement',
  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/accounts/0sf3wwxqv0vbuvxhur81yyw51/accept_service_agreement')
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 = {
  accepted_service_agreement_at: "2021-02-25T07:45:25Z",
  accepted_service_agreement_ip: "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
}

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

puts res.body
{
  "id": "0sf3wwxqv0vbuvxhur81yyw51",
  "resource": "account",
  "name": "Submerchant",
  "default_currency": "TWD",
  "time_zone": "Asia/Tokyo",
  "live_merchant": "4nmn1oy49gllocv86ixgfqwvx",
  "test_merchant": "1ugmg5i09mifg6zlyn2mzh3p7",
  "accepted_service_agreement_at": "2021-02-25T07:45:25Z",
  "accepted_service_agreement_ip": "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
  "created_at": "2021-02-17T03:01:31Z",
  "updated_at": "2021-02-17T03:01:31Z"
}

파라미터

성명 설명
accepted_service_agreement_at
필수

The date and time when the agreement was accepted. Must be represented in the ISO 8601 format.

accepted_service_agreement_ip
필수

The IP address used when the agreement was accepted.