Skip to main content
GET
/
v1
/
charges
List charges
curl --request GET \
  --url https://api.plane.com/v1/charges \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.plane.com/v1/charges"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.plane.com/v1/charges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.plane.com/v1/charges",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.plane.com/v1/charges"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.plane.com/v1/charges")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.plane.com/v1/charges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "charges": [
    {
      "id": "ch_hsb6rfQVReo6Mq1M2jEXrD1m",
      "source": "src_HKoSZYDa7DQhnBH2XKTJBGEe",
      "date": "2023-11-06",
      "amount": "1000.0",
      "currency": "USD",
      "status": "pending",
      "reference": null
    },
    {...},
    {...}
  ]
}

Parameters

limit
number
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
starting_after
string
A cursor for use in pagination. starting_after is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.
ending_before
string
A cursor for use in pagination. ending_before is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.

Returns

A dictionaty with a charges property that contains an array fo up to limit charges, starting after charge starting_after. Each entry in the array is a separate charge object. If no more charges are available, the resulting array will be empty.
{
  "charges": [
    {
      "id": "ch_hsb6rfQVReo6Mq1M2jEXrD1m",
      "source": "src_HKoSZYDa7DQhnBH2XKTJBGEe",
      "date": "2023-11-06",
      "amount": "1000.0",
      "currency": "USD",
      "status": "pending",
      "reference": null
    },
    {...},
    {...}
  ]
}