Give Pay Documentation
API Reference

Get Subscription

Retrieve subscription details by slug

GET /subscription/:slug

Retrieves subscription details including payer information, line items, and billing cycle details.

Request

curl -X GET https://api.givepay.co/api/v1/subscription/sub_01HGW5N8J9K7M2Q4R6S8T1V3W5 \
  -H "Authorization: YOUR_API_KEY"

Path Parameters

ParameterTypeDescription
slugstringSubscription slug (e.g., sub_01HGW5N8J9K7M2Q4R6S8T1V3W5)

Response

{
  "id": "0383d477-cb22-4d88-8987-7eaee5bc89d9",
  "slug": "sub_01HGW5N8J9K7M2Q4R6S8T1V3W5",
  "status": "active",
  "amount": 5500,
  "currency": "GBP",
  "tip": 500,
  "interval": "month",
  "interval_count": 1,
  "cancel_at_period_end": false,
  "current_period_start": "2024-11-01T00:00:00Z",
  "current_period_end": "2024-12-01T00:00:00Z",
  "charity": {
    "slug": "example-charity",
    "name": "Example Charity",
    "website": "https://example-charity.org",
    "logo": {
      "url": "https://cdn.givepay.co/logos/example.png"
    },
    "theme": {
      "primary_color": "#0066cc"
    }
  },
  "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",
      "line2": "Apt 4B",
      "postcode": "SW1A 1AA",
      "state": ""
    }
  },
  "line_items": [
    {
      "id": "49ba6867-ef7b-4d65-84d9-1447c5262d33",
      "type": "recurring",
      "quantity": 1,
      "amount": 5000,
      "total": 5000,
      "currency": "GBP",
      "country_iso": "GB",
      "intention": "General Donation",
      "project": "Winter Appeal 2024"
    }
  ],
  "return_url": "https://yoursite.com/subscription-complete",
  "created_at": "2024-11-01T00:00:00Z",
  "updated_at": "2024-11-01T00:00:00Z"
}

Response Fields

FieldTypeDescription
idstringUnique subscription UUID
slugstringSubscription slug identifier
statusstringCurrent status (e.g., active, canceled, past_due)
amountintegerTotal amount in pence (including tip)
currencystringCurrency code (e.g., GBP, USD)
tipintegerPlatform fee/tip amount in pence
intervalstringBilling interval (e.g., month, year)
interval_countintegerNumber of intervals between billings (e.g., 1 for monthly, 3 for quarterly)
cancel_at_period_endbooleanWhether the subscription will cancel at the end of the current period
current_period_startstringISO 8601 timestamp of current billing period start
current_period_endstringISO 8601 timestamp of current billing period end
charityobjectCharity organization details
payerobjectPayer details
line_itemsarrayArray of line items (includes both recurring and one-time items)
return_urlstringRedirect URL after payment management actions
created_atstringISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp

Line Item Fields

Each item in the line_items array contains:

FieldTypeDescription
idstringUnique line item UUID
typestringItem type: "recurring" or "one_time"
quantityintegerQuantity of items
amountintegerUnit amount in pence
totalintegerTotal amount (quantity × amount) in pence
currencystringCurrency code
country_isostringISO country code
intentionstringDonation intention/purpose
projectstringProject name or campaign

Error Responses

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