Payments
Get Payment Attempt
One payment attempt as an addressable object, resolved with the invoice, currency, customer, and subscription it belongs to.
GET
/
v1
/
payment-attempts
/
{id}
Get a payment attempt by id
curl --request GET \
--url https://billing.example.com/v1/payment-attempts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/payment-attempts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/payment-attempts/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"currency": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gateway": "<string>",
"method": "<string>",
"gateway_payment_intent_id": "<string>",
"status": "initiated",
"failure_code": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z"
}
}Fetches one payment attempt as an addressable object, resolved with the
invoice-level context it belongs to: invoice number, currency, customer, and
— for recurring invoices — the subscription.
customer_id and
subscription_id are read-time joins off the attempt’s invoice, not stored on
the attempt itself.
Example Request
curl "https://api.recurso.dev/v1/payment-attempts/c2d4e6f8-1a3b-4c5d-9e7f-8a9b0c1d2e3f" \
-H "Authorization: Bearer $API_KEY"
Response
{
"data": {
"id": "c2d4e6f8-1a3b-4c5d-9e7f-8a9b0c1d2e3f",
"invoice_id": "06c151de-8d3a-4b21-9c77-2f0e5a9b4d12",
"invoice_number": "REC/2026/0042",
"currency": "USD",
"customer_id": "0b7a3f7e-4a2b-4c1d-9e8f-1a2b3c4d5e6f",
"subscription_id": "b9071c55-0e14-4720-80f3-665613ceb7de",
"gateway": "stripe",
"method": "card",
"gateway_payment_intent_id": "pi_3PqR7sK2eZvKYlo2C0Xy1AbC",
"status": "succeeded",
"failure_code": "",
"amount": 118000,
"created_at": "2026-07-03T14:22:00Z",
"updated_at": "2026-07-03T14:22:10Z",
"settled_at": "2026-07-03T14:22:10Z"
}
}
Fields
| Field | Type | Description |
|---|---|---|
id | string (uuid) | The attempt’s id |
invoice_id / invoice_number | uuid / string | The invoice the attempt tried to settle |
currency | string | The invoice’s currency |
customer_id | string (uuid) | The invoice’s customer (read-time join) |
subscription_id | string (uuid), nullable | The invoice’s subscription for recurring invoices; null for one-offs (read-time join) |
gateway | string | The gateway that processed the attempt |
method | string | The payment method used |
gateway_payment_intent_id | string | The gateway’s reference for the attempt |
status | string | initiated, processing, succeeded, failed, or returned |
failure_code | string | Gateway failure or return code; empty when the attempt succeeded |
amount | integer (int64) | Minor units |
created_at / updated_at | string (date-time) | When the attempt was made and last changed status |
settled_at | string (date-time), nullable | When funds settled; null until then |
Read-only. A missing or cross-tenant
id returns 404. For the full retry
history of one invoice, use
Invoice Payment Attempts; for the
tenant-wide log, List Payment Attempts.⌘I
Get a payment attempt by id
curl --request GET \
--url https://billing.example.com/v1/payment-attempts/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/payment-attempts/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{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://billing.example.com/v1/payment-attempts/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/payment-attempts/{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{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invoice_number": "<string>",
"currency": "<string>",
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"gateway": "<string>",
"method": "<string>",
"gateway_payment_intent_id": "<string>",
"status": "initiated",
"failure_code": "<string>",
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"settled_at": "2023-11-07T05:31:56Z"
}
}