# PDS API

Version: 1.0.0
License: UNLICENSED

## Servers

Staging Strapi (default)
```
https://staging.strapi.personaldevelopmentschool.com
```

Production
```
https://strapi.personaldevelopmentschool.com
```

## Download OpenAPI description

[PDS API](https://docs.personaldevelopmentschool.com/_bundle/openapi.yaml)

## Checkout

Stripe checkout

### Get checkout pricing and product data

 - [GET /api/checkout](https://docs.personaldevelopmentschool.com/openapi/checkout/getcheckoutpricedata.md): Returns pricing, product, discount, and subscription schedule information for a Thinkific product/Stripe price.
Exactly one of these inputs must be provided (at least one, but typically choose one): - price: Stripe price lookup key - product: Stripe product ID

### Start Stripe checkout and create order

 - [POST /api/checkout](https://docs.personaldevelopmentschool.com/openapi/checkout/postcheckoutstripe.md): Final checkout process when a user is paying using Stripe. Returns a client secret (PaymentIntent or SetupIntent) and metadata to complete the payment on the client. This endpoint also drafts a Strapi order.

### Get Stripe account id for checkout

 - [GET /api/checkout/stripe-account](https://docs.personaldevelopmentschool.com/openapi/checkout/getcheckoutstripeaccount.md): Returns a Stripe account id either for a specific email (if a Strapi user exists) or the default account for the current locale.

### Set Thinkific user password

 - [POST /api/checkout/set-password](https://docs.personaldevelopmentschool.com/openapi/checkout/postcheckoutsetpassword.md): Sets the Thinkific password for the user stored in the signed password-token cookie. Request body must include password and passwordConfirmation.

### Check enrollment availability for a product/user

 - [GET /api/checkout/is-enrollment-possible](https://docs.personaldevelopmentschool.com/openapi/checkout/getcheckoutisenrollmentpossible.md): Returns whether a Thinkific user is able to enroll for a given product.

## PayPal

PayPal orders and subscriptions

### Create PayPal order (one-time)

 - [POST /api/paypal-order](https://docs.personaldevelopmentschool.com/openapi/paypal/postpaypalordercreate.md): Creates a PayPal order and a draft Strapi order + order-paypal-detail. The published pricing plan is resolved by query lookup_key and optional body currency (defaults to USD).

### Capture PayPal order

 - [POST /api/capture-paypal-order/{id}](https://docs.personaldevelopmentschool.com/openapi/paypal/postpaypalordercapture.md): Captures payment for the given PayPal order id; updates order-paypal-detail with capture transaction id.

### Fulfill after PayPal one-time order approved

 - [POST /api/paypal-order-approved](https://docs.personaldevelopmentschool.com/openapi/paypal/postpaypalorderapproved.md): Runs after client-side PayPal approval + capture. Middleware creates/loads Thinkific user and Strapi user. Expects PayPal order status COMPLETED. Enrolls user, marks order paid, sets password-token cookie flow. No extra params via strapi.requestContext in this handler or in fulfillOrder.

### Create PayPal subscription

 - [POST /api/paypal-subscription](https://docs.personaldevelopmentschool.com/openapi/paypal/postpaypalsubscriptioncreate.md): Creates PayPal subscription and draft Strapi order + billing-agreement. Coupons with duration: once or durationInMonths are rejected for subscriptions.

### Fulfill after PayPal subscription approved

 - [POST /api/paypal-subscription-approved](https://docs.personaldevelopmentschool.com/openapi/paypal/postpaypalsubscriptionapproved.md): Post–first-payment fulfillment. Same Thinkific + Strapi user middleware as POST /api/paypal-order-approved. No strapi.requestContext reads for extra query/body in this handler.

## MyAccount

Billing, memberships, and account management

### Cancel a scheduled payment/order

 - [DELETE /api/my-account/cancel-payment/{id}](https://docs.personaldevelopmentschool.com/openapi/myaccount/deletemyaccountcancelpayment.md)

### Cancel a Stripe-managed subscription

 - [PUT /api/my-account/cancel-subscription](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountcancelsubscription.md)

### Create billing portal session (manage-subscription)

 - [POST /api/my-account/manage-subscription](https://docs.personaldevelopmentschool.com/openapi/myaccount/postmyaccountmanagesubscription.md)

### Create billing portal session (manage-billing)

 - [POST /api/my-account/manage-billing](https://docs.personaldevelopmentschool.com/openapi/myaccount/postmyaccountmanagebilling.md)

### Get membership/subscriptions summary

 - [GET /api/my-account/membership](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountmembership.md)

### Update Stripe subscription

 - [PUT /api/my-account/membership](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountupdatemembership.md)

### Get membership usage data

 - [GET /api/my-account/membership/usage](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountmembershipusage.md)

### Change subscription plan by updating upcoming phases

 - [PUT /api/my-account/membership/change-plan](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountchangeplan.md)

### Release a subscription from its schedule

 - [POST /api/my-account/membership/release-schedule](https://docs.personaldevelopmentschool.com/openapi/myaccount/postmyaccountreleaseschedule.md)

### Get contact lists for a user (by email)

 - [GET /api/my-account/notifications](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountnotifications.md)

### Update ActiveCampaign contact list status

 - [PUT /api/my-account/notifications](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountupdatenotifications.md)

### Get upcoming one-time payments

 - [GET /api/my-account/upcoming-one-time-payments](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountupcomingonetimepayments.md)

### Get orders for a user

 - [GET /api/my-account/orders/{thinkificId}](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountorders.md)

### View a Stripe invoice for the current user

 - [GET /api/my-account/invoice/{id}](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountviewstripeinvoice.md)

### List saved card payment methods for the current user

 - [GET /api/my-account/payment-methods](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountpaymentmethods.md)

### Pause a PayPal membership agreement

 - [PUT /api/my-account/paypal-membership/pause](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountpausepaypalmembership.md)

### Cancel a PayPal membership agreement

 - [PUT /api/my-account/paypal-membership/cancel](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountcancelpaypalmembership.md)

### Resume a PayPal membership agreement

 - [PUT /api/my-account/paypal-membership/resume](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountresumepaypalmembership.md)

### List current Stripe + PayPal subscriptions

 - [GET /api/my-account/subscriptions](https://docs.personaldevelopmentschool.com/openapi/myaccount/getmyaccountsubscriptions.md)

### Thinkific OIDC connect (returns Strapi JWT)

 - [GET /api/auth/thinkific/connect](https://docs.personaldevelopmentschool.com/openapi/myaccount/getthinkificauthconnect.md)

### Schedule a reminder email job

 - [POST /api/my-account/membership/remind-me-later](https://docs.personaldevelopmentschool.com/openapi/myaccount/postmyaccountremindmelater.md)

### Redeem an offer after subscription becomes past due

 - [PUT /api/my-account/membership/redeem-offer](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountredeemoffer.md)

### Set default payment method for a subscription

 - [PUT /api/my-account/membership/default-payment-method](https://docs.personaldevelopmentschool.com/openapi/myaccount/putmyaccountupdatedefaultpaymentmethod.md)

## ContactUs

Contact forms and CRM/CS integrations

### Submit contact form

 - [POST /api/contact-us](https://docs.personaldevelopmentschool.com/openapi/contactus/postcontactus.md)

### Submit harassment report

 - [POST /api/contact-us/harassment](https://docs.personaldevelopmentschool.com/openapi/contactus/postcontactusharassment.md)

### Schedule delayed registration

 - [POST /api/contact-us/schedule-registration](https://docs.personaldevelopmentschool.com/openapi/contactus/postcontactusscheduleregistration.md): Stores a scheduled task with resourceType=activecampaign-registration so the registration  payload can be processed at a later date. Scheduled registration does not run ZeroBounce validation,  Mixpanel tracking, or Facebook CAPI event.

### Register user (ActiveCampaign integration)

 - [POST /api/register](https://docs.personaldevelopmentschool.com/openapi/contactus/postregister.md): Registers a user with ActiveCampaign. Requires a Google reCAPTCHA v3 token (g-recaptcha-response). The server validates the token's success flag, requires score > 0.3, and checks that hostname includes .personaldevelopmentschool.com. Requests where error-codes contains browser-error bypass the score/hostname check.

### Sync ActiveCampaign contact + list

 - [POST /api/activecampaign-user-list](https://docs.personaldevelopmentschool.com/openapi/contactus/postactivecampaignuserlist.md)

### Sync ActiveCampaign contact + tags

 - [POST /api/activecampaign-user-tag](https://docs.personaldevelopmentschool.com/openapi/contactus/postactivecampaignusertag.md)

### Add an Intercom user tag

 - [POST /api/intercom-user-tag](https://docs.personaldevelopmentschool.com/openapi/contactus/postintercomusertag.md)

### Get checkout lifecycle tag name for pricing plan

 - [GET /api/checkout-lifecycle-tag](https://docs.personaldevelopmentschool.com/openapi/contactus/getcheckoutlifecycletagname.md)

## AttachmentQuiz

Attachment quiz results

### Save attachment quiz result

 - [POST /api/save-attachment-quiz-result](https://docs.personaldevelopmentschool.com/openapi/attachmentquiz/postattachmentquizsave.md)

### Save attachment quiz result (alias route)

 - [POST /api/attachment-quiz-result](https://docs.personaldevelopmentschool.com/openapi/attachmentquiz/postattachmentquizsavealt.md)

### Get the latest attachment quiz result for a user

 - [GET /api/attachment-quiz-result/my-result](https://docs.personaldevelopmentschool.com/openapi/attachmentquiz/getattachmentquizmyresult.md)

## OnboardingQuiz

Onboarding quiz results and webinar recommendations

### Save onboarding quiz result

 - [POST /api/save-onboarding-quiz-result](https://docs.personaldevelopmentschool.com/openapi/onboardingquiz/postonboardingquizsave.md)

### Get latest onboarding quiz result and webinar recommendations

 - [GET /api/my-onboarding-quiz-result](https://docs.personaldevelopmentschool.com/openapi/onboardingquiz/getonboardingquizmyresult.md): Provide either thinkificId or resultId (both optional in the schema, but at least one is required).

## StudentDashboard

Student dashboard endpoints (course paths + daily feelings)

### Submit/update course path progress

 - [POST /api/student-dashboard/my-course-path](https://docs.personaldevelopmentschool.com/openapi/studentdashboard/poststudentdashboardmycoursepath.md): Thinkific dashboard course card completion payload for a user. Updates/creates the user’s dashboard-course-path and returns next-course progress.

### Submit daily feelings

 - [POST /api/student-dashboard/daily-feelings](https://docs.personaldevelopmentschool.com/openapi/studentdashboard/poststudentdashboarddailyfeelings.md): Saves today’s feelings submission for a Thinkific user, updating an existing submission for the day.

### Get daily feelings history

 - [GET /api/student-dashboard/daily-feelings](https://docs.personaldevelopmentschool.com/openapi/studentdashboard/getstudentdashboarddailyfeelings.md): Returns the last 30 feelings submissions with timestamps for a Thinkific user.

## SplitTestAssignment

Split test variant assignment

### Assign split test variant

 - [POST /api/split-test-assignment](https://docs.personaldevelopmentschool.com/openapi/splittestassignment/postsplittestassignment.md): Creates/returns an assigned variant for a user based on splitTestKey. Uses HMAC signature validation for user_id query param.

## SkillsAssessmentResult

Skills assessment quiz results

### Submit six pillars quiz results

 - [POST /api/submit-six-pillars-quiz](https://docs.personaldevelopmentschool.com/openapi/skillsassessmentresult/postsubmitsixpillarsquiz.md): Middleware get-or-create-user requires body.user.id to create/load a Thinkific/Strapi user. Controller requires body.data containing score fields.

## LoveLanguageQuizResult

Love language quiz results

### Save Love Language quiz result

 - [POST /api/save-love-language-quiz-result](https://docs.personaldevelopmentschool.com/openapi/lovelanguagequizresult/postlovelanguagequizsave.md): Saves the Love Language quiz result and triggers Facebook CAPI event. Requires fields consumed by the attachment-quiz middleware and facebookcapi.loveLanguageQuizResultEvent (via strapi.requestContext.get()).

### Save Love Language quiz result (alias)

 - [POST /api/love-language-quiz-result](https://docs.personaldevelopmentschool.com/openapi/lovelanguagequizresult/postsavelovelanguagequizresult.md): Same payload as POST /api/love-language-quiz-result.

## FacebookCapi

Facebook CAPI event endpoints

### Send Facebook CAPI event for attachment quiz result

 - [POST /api/facebook-capi/attachment-quiz-result](https://docs.personaldevelopmentschool.com/openapi/facebookcapi/postfacebookcapiattachmentquizresult.md): Controller calls facebookcapi.attachmentQuizResultEvent() which reads request body from strapi.requestContext.get() (must include all fields below).

### Send Facebook CAPI event for dating quiz result

 - [POST /api/facebook-capi/dating-quiz-result](https://docs.personaldevelopmentschool.com/openapi/facebookcapi/postfacebookcapidatingquizresult.md): Controller calls facebookcapi.datingQuizResultEvent() which reads request body from strapi.requestContext.get().

### Send Facebook CAPI event for love language quiz result

 - [POST /api/facebook-capi/love-language-quiz-result](https://docs.personaldevelopmentschool.com/openapi/facebookcapi/postfacebookcapilovelanguagequizresult.md): Controller calls facebookcapi.loveLanguageQuizResultEvent() which reads request body from strapi.requestContext.get().

### Send Facebook CAPI "Lead" event

 - [POST /api/facebook-capi/lead](https://docs.personaldevelopmentschool.com/openapi/facebookcapi/postfacebookcapinewlead.md): Controller calls facebookcapi.newLeadEvent() which reads request body from strapi.requestContext.get(). At least one of eventId or insertId should be provided.

### Send Facebook CAPI purchase event

 - [POST /api/facebook-capi-purchase](https://docs.personaldevelopmentschool.com/openapi/facebookcapi/postfacebookcapipurchase.md): purchaseHandler passes request body to facebookcapi.purchaseEvent and returns true on success.

