Retrieve
curl --request GET \
--url https://{defaultHost}/v1/charges/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/charges/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/charges/{id}', 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://{defaultHost}/v1/charges/{id}",
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://{defaultHost}/v1/charges/{id}"
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://{defaultHost}/v1/charges/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/charges/{id}")
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{
"id": "d8956466-d697-4444-9734-c8ee7f37e485",
"object": "charge",
"amount": 2900,
"currency": "usd",
"disputed_amount": 0,
"external_charge_id": "l38k4nv4zpeath0",
"fully_refunded": false,
"live_mode": true,
"refunded_amount": 0,
"customer": "b1b51835-2912-4ff2-a9b3-29646e511e34",
"checkout": "f029a8f8-dc91-4e16-aa8a-8c0d53d60a52",
"payment_intent": "a723391d-1dd2-4471-8f88-6a9b00895362",
"payment_method": null,
"created_at": 1793796858,
"updated_at": 1793796858
}Charges
Retrieve
Retrieves details of a specific charge.
GET
/
v1
/
charges
/
{id}
Retrieve
curl --request GET \
--url https://{defaultHost}/v1/charges/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/charges/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/charges/{id}', 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://{defaultHost}/v1/charges/{id}",
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://{defaultHost}/v1/charges/{id}"
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://{defaultHost}/v1/charges/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/charges/{id}")
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{
"id": "d8956466-d697-4444-9734-c8ee7f37e485",
"object": "charge",
"amount": 2900,
"currency": "usd",
"disputed_amount": 0,
"external_charge_id": "l38k4nv4zpeath0",
"fully_refunded": false,
"live_mode": true,
"refunded_amount": 0,
"customer": "b1b51835-2912-4ff2-a9b3-29646e511e34",
"checkout": "f029a8f8-dc91-4e16-aa8a-8c0d53d60a52",
"payment_intent": "a723391d-1dd2-4471-8f88-6a9b00895362",
"payment_method": null,
"created_at": 1793796858,
"updated_at": 1793796858
}Authorizations
Response
200 - application/json
Success
Expandable – The associated customer ID.
Expandable – The associated checkout ID.
Expandable – Property not returned unless expanded.
Expandable – The associated payment intent ID.
Expandable – The associated payment method ID.
Expandable – Property not returned unless expanded.
Was this page helpful?