Give Pay Documentation
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

ParameterTypeDescription
slugstringPayment 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

FieldTypeDescription
idstringUnique payment session UUID
slugstringPayment session slug identifier
statusstringCurrent status (e.g., pending_payment, succeeded, failed)
amountintegerTotal amount in pence (including tip)
currencystringCurrency code
tipintegerPlatform fee/tip amount in pence
providerstringPayment provider (e.g., "Stripe")
payerobjectPayer details
line_itemsarrayArray of line items
one_time_itemsarrayAdditional one-time items (empty if none)
subscriptionobject or nullSubscription details (null for one-time payments)
return_urlstringRedirect URL after payment
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp
expires_atstringISO 8601 expiration timestamp

Error Responses

StatusDescription
400Invalid slug format
404Payment session not found
500Internal server error