API Reference
Get Payment Session
Retrieve payment session details by slug
GET /payment-session/:slug
Retrieves payment session details by slug.
Request
curl -X GET https://api.givepay.co/api/v1/payment-session/ps_01HGW5N8J9K7M2Q4R6S8T1V3W5 \
-H "Authorization: YOUR_API_KEY"Path Parameters
| Parameter | Type | Description |
|---|---|---|
slug | string | Payment session slug (e.g., ps_01HGW5N8J9K7M2Q4R6S8T1V3W5) |
Response
{
"id": "0383d477-cb22-4d88-8987-7eaee5bc89d9",
"slug": "ps_01HGW5N8J9K7M2Q4R6S8T1V3W5",
"status": "pending_payment",
"amount": 5500,
"currency": "GBP",
"tip": 500,
"provider": "Stripe",
"payer": {
"id": "6c93dd55-9207-4a7a-8eeb-798c1436eb2e",
"email": "john.doe@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+447700900000",
"billing_address": {
"country": "GB",
"city": "London",
"line1": "123 Main Street",
"postcode": "SW1A 1AA"
}
},
"line_items": [
{
"id": "49ba6867-ef7b-4d65-84d9-1447c5262d33",
"quantity": 1,
"amount": 5000,
"total": 5000,
"currency": "GBP",
"country_iso": "GB",
"intention": "General Donation",
"project": "Winter Appeal 2024"
}
],
"one_time_items": [],
"subscription": null,
"return_url": "https://yoursite.com/payment-complete",
"created_at": "2024-11-02T23:00:00Z",
"updated_at": "2024-11-02T23:00:00Z",
"expires_at": "2025-11-15T12:30:00Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique payment session UUID |
slug | string | Payment session slug identifier |
status | string | Current status (e.g., pending_payment, succeeded, failed) |
amount | integer | Total amount in pence (including tip) |
currency | string | Currency code |
tip | integer | Platform fee/tip amount in pence |
provider | string | Payment provider (e.g., "Stripe") |
payer | object | Payer details |
line_items | array | Array of line items |
one_time_items | array | Additional one-time items (empty if none) |
subscription | object or null | Subscription details (null for one-time payments) |
return_url | string | Redirect URL after payment |
created_at | string | ISO 8601 creation timestamp |
updated_at | string | ISO 8601 last update timestamp |
expires_at | string | ISO 8601 expiration timestamp |
Error Responses
| Status | Description |
|---|---|
400 | Invalid slug format |
404 | Payment session not found |
500 | Internal server error |