GET /api/v1/payments
List 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.