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: Bearer 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,
  "metadata": { "campaign_id": "winter-2024" },
  "return_url": "https://yoursite.com/payment-complete",
  "charity": {
    "name": "Example Charity",
    "slug": "example-charity",
    "website": "https://example-charity.org",
    "logo": {
      "color": "https://cdn.givepay.co/logos/example-color.png",
      "white": "https://cdn.givepay.co/logos/example-white.png",
      "favicon": "https://cdn.givepay.co/logos/example-favicon.ico"
    },
    "theme": {
      "primary": "#0066cc",
      "secondary": "#FFFFFF"
    }
  },
  "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 smallest currency unit (including tip)
currencystringCurrency code
tipintegerPlatform fee/tip amount in smallest currency unit
providerstring | nullPayment provider ("Stripe" or "Ryft")
payerobjectPayer details
line_itemsarrayArray of line items. Each contains id, amount, quantity, total, currency, country_iso, project, intention
one_time_itemsarrayAdditional one-time items (empty if none)
subscriptionobject | nullSubscription details (null for one-time payments). When set, contains name, interval, interval_count
metadataobject (optional)Arbitrary key/value pairs supplied at checkout creation
return_urlstring (optional)Redirect URL after payment
charityobjectCharity organisation details (name, slug, website, logo, theme)
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp
expires_atstring | nullISO 8601 expiration timestamp; null for Stripe-backed sessions (Stripe manages expiry)

Error Responses

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