> For the complete documentation index, see [llms.txt](https://docs.paywithflash.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paywithflash.com/api-documentation/subscriptions/editor.md).

# Endpoints

## Get user subscription details

> Retrieves subscription details and transaction history for a user

```json
{"openapi":"3.0.0","info":{"title":"NostrEggs Subscription API for Platforms","version":"1.0.0"},"servers":[{"url":"https://api.paywithflash.com/v1","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token signed with the Flash secret key"}}},"paths":{"/get_user_subscription_details":{"post":{"summary":"Get user subscription details","description":"Retrieves subscription details and transaction history for a user","operationId":"getUserSubscriptionDetails","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["flash_id"],"properties":{"flash_id":{"type":"string","description":"The Flash ID for the platform"},"email":{"type":"string","description":"User's email address (one of email, npub, or external_uuid required)"},"npub":{"type":"string","description":"User's Nostr public key in npub format (one of email, npub, or external_uuid required)"},"external_uuid":{"type":"string","description":"External UUID for the user (one of email, npub, or external_uuid required)"}}}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"user_public_key":{"type":"string"},"is_paid":{"type":"boolean"},"membership_start_date":{"type":"string"},"next_payment_date":{"type":"string"},"status":{"type":"string"},"external_uuid":{"type":"string"}}},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"from_public_key":{"type":"string"},"to_public_key":{"type":"string"},"transaction_date":{"type":"string"},"amount_in_sats":{"type":"integer"},"amount_in_currency":{"type":"number"},"currency":{"type":"string"},"bitcoin_price":{"type":"number"},"flash_id":{"type":"string"},"flash_name":{"type":"string"},"flash_type":{"type":"string"},"to_wallet_id":{"type":"integer"},"to_user_wallet_name":{"type":"string"},"from_wallet_id":{"type":"integer"},"from_user_wallet_name":{"type":"string"},"lnurl":{"type":"string"}}}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```

## Cancel user subscription

> Cancels a user's active subscription

```json
{"openapi":"3.0.0","info":{"title":"NostrEggs Subscription API for Platforms","version":"1.0.0"},"servers":[{"url":"https://api.paywithflash.com/v1","description":"Production server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"JWT token signed with the Flash secret key"}}},"paths":{"/cancel_user_subscription":{"post":{"summary":"Cancel user subscription","description":"Cancels a user's active subscription","operationId":"cancelUserSubscription","requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["flash_id"],"properties":{"flash_id":{"type":"string","description":"The Flash ID for the platform"},"email":{"type":"string","description":"User's email address (one of email, npub, or external_uuid required)"},"npub":{"type":"string","description":"User's Nostr public key in npub format (one of email, npub, or external_uuid required)"},"external_uuid":{"type":"string","description":"External UUID for the user (one of email, npub, or external_uuid required)"}}}}}},"responses":{"200":{"description":"Successful cancellation","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"msg":{"type":"string"}}}}}}}}}}}
```
