Give Pay Documentation
API Reference

Create Checkout

Create a payment session and initiate checkout

POST /payment-session/checkout

Creates a payment session and initiates checkout, returning a URL to redirect the payer.

Request

curl -X POST https://api.givepay.co/api/v1/payment-session/checkout \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "payment_type": "one_time",
    "currency": "GBP",
    "line_items": [
      {
        "quantity": 1,
        "amount": 5000,
        "country_iso": "GB",
        "intention": "General Donation",
        "project": "Winter Appeal 2024"
      }
    ],
    "payer": {
      "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"
      }
    },
    "return_url": "https://yoursite.com/payment-complete"
  }'

Request Body

FieldTypeRequiredDescription
payment_typestringYes"one_time" or "subscription"
currencystringYesThree-letter ISO currency code (currently only "GBP")
line_itemsarrayYesArray of line items (minimum 1)
payerobjectYesPayer information
return_urlstringNoHTTPS URL for redirect after payment
subscriptionobjectConditionalRequired if payment_type is "subscription"
one_time_itemsarrayNoAdditional one-time items (subscription only)

Line Item Object

FieldTypeRequiredDescription
quantityintegerYesQuantity (must be > 0)
amountintegerYesAmount in pence (e.g., 5000 = £50.00)
country_isostringNoISO 3166-1 alpha-2 country code (e.g., "GB")
intentionstringNoPurpose of payment (e.g., "General Donation")
projectstringNoProject name (e.g., "Winter Appeal 2024")

Payer Object

FieldTypeRequiredDescription
emailstringYesValid email address
first_namestringNoFirst name
last_namestringNoLast name
phonestringNoPhone number
billing_addressobjectNoBilling address details

Billing Address Object

FieldTypeRequiredDescription
countrystringYes*ISO 3166-1 alpha-2 code - *Required when billing_address is provided
citystringNoCity name
line1stringNoAddress line 1
line2stringNoAddress line 2
postcodestringNoPostal code
statestringNoState or province

Subscription Object (for recurring payments)

FieldTypeRequiredDescription
intervalstringYesBilling frequency: "day", "week", "month", or "year"
interval_countintegerYesNumber of intervals between billings
namestringYesProduct name displayed to customer

Response

One-Time Payment

{
  "checkout_url": "https://checkout.givepay.com/checkout?p=cHNfMDFIR1c1TjhKOUs3...",
  "expires_at": "2026-02-17T10:30:00Z",
  "slug": "ps_01HGW5N8J9K7M2Q4R6S8T1V3W5",
  "type": "one_time"
}

You can retrieve the payment session details using the Get Payment Session endpoint with the returned slug.

Subscription

{
  "checkout_url": "https://checkout.givepay.com/checkout?p=c3ViXzAxSEdXNU44Sjl...",
  "expires_at": null,
  "slug": "sub_01HGW5N8J9K7M2Q4R6S8T1V3W5",
  "type": "subscription"
}

You can retrieve the subscription details using the Get Subscription endpoint with the returned slug.

Response Fields

FieldTypeDescription
checkout_urlstringURL to redirect the payer to complete payment
expires_atstring or nullISO 8601 expiration timestamp (may be null for some providers)
slugstringPayment session or subscription slug identifier
typestringPayment type: "one_time" or "subscription"

Error Responses

StatusDescription
400Invalid request body or validation error
401Unauthorized - invalid or missing API key
500Internal server error

See Checkout Examples for complete code examples including one-off, daily, monthly, and mixed payments.