Get a payment
curl --request GET \
--url https://dash.getopenrails.com/api/gateway/payments/{paymentId}import requests
url = "https://dash.getopenrails.com/api/gateway/payments/{paymentId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://dash.getopenrails.com/api/gateway/payments/{paymentId}', 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://dash.getopenrails.com/api/gateway/payments/{paymentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://dash.getopenrails.com/api/gateway/payments/{paymentId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dash.getopenrails.com/api/gateway/payments/{paymentId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.getopenrails.com/api/gateway/payments/{paymentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "payment",
"amount": 123,
"currency": "<string>",
"created": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"invoiceId": "<string>",
"sessionId": "<string>",
"route": {
"id": "<string>",
"label": "<string>"
},
"fees": {
"buyer_fee": 123,
"gateway_fee": 123,
"merchant_net": 123,
"total": 123
},
"metadata": {}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"suggestion": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Reference
Get a payment
Fetches a single payment. Accepts a pay_* payment ID or a chk_* checkout session ID.
GET
/
api
/
gateway
/
payments
/
{paymentId}
Get a payment
curl --request GET \
--url https://dash.getopenrails.com/api/gateway/payments/{paymentId}import requests
url = "https://dash.getopenrails.com/api/gateway/payments/{paymentId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://dash.getopenrails.com/api/gateway/payments/{paymentId}', 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://dash.getopenrails.com/api/gateway/payments/{paymentId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://dash.getopenrails.com/api/gateway/payments/{paymentId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://dash.getopenrails.com/api/gateway/payments/{paymentId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dash.getopenrails.com/api/gateway/payments/{paymentId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "payment",
"amount": 123,
"currency": "<string>",
"created": "2023-11-07T05:31:56Z",
"customerId": "<string>",
"invoiceId": "<string>",
"sessionId": "<string>",
"route": {
"id": "<string>",
"label": "<string>"
},
"fees": {
"buyer_fee": 123,
"gateway_fee": 123,
"merchant_net": 123,
"total": 123
},
"metadata": {}
}{
"ok": false,
"error": {
"code": "<string>",
"message": "<string>",
"field": "<string>",
"suggestion": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Path Parameters
A pay_* payment ID or chk_* checkout session ID.
Response
Payment record
Payment ID with pay_* prefix.
Available options:
payment Available options:
pending, paid, failed Available options:
pending, settled, refunded Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I