GET /api/v1/events/:id
Show Events

View an event given an id. Event ids can be saved from a webhook or found by querying all events.

Examples

  • cURL
  • Node.js
  • Ruby
curl -X GET https://komoju.com/api/v1/events/3c9ks6xl2pyuvbxv26pa3zmfe \
  -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/events/3c9ks6xl2pyuvbxv26pa3zmfe',
  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/events/3c9ks6xl2pyuvbxv26pa3zmfe')
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": "3c9ks6xl2pyuvbxv26pa3zmfe",
  "type": "payment.captured",
  "resource": "event",
  "data": {
    "id": "0i4ispqaqz4l13heuqge5uvf0",
    "resource": "payment",
    "status": "captured",
    "amount": 300,
    "tax": 30,
    "customer": null,
    "payment_deadline": "2020-06-16T14:59:59Z",
    "payment_details": {
      "type": "credit_card",
      "email": "gordon@example.com",
      "brand": "visa",
      "last_four_digits": "1111",
      "month": 3,
      "year": 2021
    },
    "payment_method_fee": 0,
    "total": 330,
    "currency": "JPY",
    "description": null,
    "captured_at": "2020-06-07T14:59:59Z",
    "external_order_num": "ORDER11",
    "metadata": {
    },
    "created_at": "2020-06-09T07:42:01Z",
    "amount_refunded": 0,
    "locale": "en",
    "refunds": [

    ],
    "refund_requests": [

    ]
  },
  "created_at": "2020-06-09T07:42:01Z",
  "reason": null
}