Skip to main content
GET
/
api
/
v1
/
payments
/
stripe
/
my-payments
Get My Payment History
curl --request GET \
  --url https://api.devkit4ai.com/api/v1/payments/stripe/my-payments \
  --header 'Authorization: Bearer <token>'
{
  "payments": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "is_test_mode": true,
      "payment_intent_id": "<string>",
      "status": "<string>",
      "amount_cents": 123,
      "currency": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "description": "<string>",
      "refunded_amount_cents": 0
    }
  ],
  "total": 123,
  "page": 123,
  "page_size": 123
}
Retrieve a paginated list of payment transactions for the authenticated user within their project. Useful for displaying billing history and invoice records.

Authentication

This endpoint requires end user authentication via HTTP Bearer Token with project scope.

Query Parameters

test_mode
boolean
default:"true"
Use test mode data. Set to false for production payments.
page
integer
default:"1"
Page number for pagination (minimum: 1)
page_size
integer
default:"50"
Number of payments per page (1-100)

Response

payments
array
List of payment records
total
integer
Total number of payments
page
integer
Current page number
page_size
integer
Number of items per page

Example Request

curl -X GET "https://api.devkit4ai.com/api/v1/payments/stripe/my-payments?test_mode=true&page=1&page_size=10" \
  -H "Authorization: Bearer {end_user_jwt}"

Example Response

{
  "payments": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "660e8400-e29b-41d4-a716-446655440000",
      "subscription_id": "770e8400-e29b-41d4-a716-446655440000",
      "user_id": "880e8400-e29b-41d4-a716-446655440000",
      "is_test_mode": true,
      "payment_intent_id": "pi_1ABC123def456",
      "status": "succeeded",
      "amount_cents": 2999,
      "currency": "usd",
      "description": "Pro Plan - Monthly",
      "refunded_amount_cents": 0,
      "created_at": "2026-01-15T10:30:00Z"
    },
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "project_id": "660e8400-e29b-41d4-a716-446655440000",
      "subscription_id": "770e8400-e29b-41d4-a716-446655440000",
      "user_id": "880e8400-e29b-41d4-a716-446655440000",
      "is_test_mode": true,
      "payment_intent_id": "pi_1DEF456ghi789",
      "status": "succeeded",
      "amount_cents": 2999,
      "currency": "usd",
      "description": "Pro Plan - Monthly",
      "refunded_amount_cents": 0,
      "created_at": "2025-12-15T10:30:00Z"
    }
  ],
  "total": 2,
  "page": 1,
  "page_size": 10
}

Formatting Amounts

Amounts are stored in cents. Convert to display format:
function formatAmount(cents: number, currency: string): string {
  return new Intl.NumberFormat('en-US', {
    style: 'currency',
    currency: currency.toUpperCase()
  }).format(cents / 100);
}

// formatAmount(2999, 'usd') → "$29.99"

Integration Example

// Billing history component
function BillingHistory() {
  const [payments, setPayments] = useState([]);
  const [page, setPage] = useState(1);
  
  useEffect(() => {
    fetch(`/api/my-payments?page=${page}`)
      .then(res => res.json())
      .then(data => setPayments(data.payments));
  }, [page]);

  return (
    <table>
      <thead>
        <tr>
          <th>Date</th>
          <th>Description</th>
          <th>Amount</th>
          <th>Status</th>
        </tr>
      </thead>
      <tbody>
        {payments.map(payment => (
          <tr key={payment.id}>
            <td>{formatDate(payment.created_at)}</td>
            <td>{payment.description}</td>
            <td>{formatAmount(payment.amount_cents, payment.currency)}</td>
            <td><Badge>{payment.status}</Badge></td>
          </tr>
        ))}
      </tbody>
    </table>
  );
}

Payment Statuses

StatusDescription
succeededPayment completed successfully
pendingPayment processing in progress
failedPayment attempt failed

Error Responses

StatusDescription
401Unauthorized - Invalid or missing authentication
404Project not found or Stripe not configured
422Validation error - Invalid pagination parameters

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

test_mode
boolean
default:true

Use test mode

page
integer
default:1
Required range: x >= 1
page_size
integer
default:50
Required range: 1 <= x <= 100

Response

Successful Response

Paginated list of Stripe payments.

payments
StripePaymentResponse · object[]
required
total
integer
required
page
integer
required
page_size
integer
required