Skip to content

Upload & Payment Flow

This guide walks through the current end-to-end Fangate backend flow from creator upload to buyer unlock.

It reflects the live backend as documented in:

  • upload sessions
  • product creation and update endpoints
  • consent flows
  • moderation jobs
  • purchase access routes

1. Create the upload session

Call:

  • POST /api/upload-sessions

The backend returns:

  • the upload session id
  • file metadata
  • an upload strategy
  • either single-part or multipart instructions

The current backend supports:

  • device_multipart
  • remote_import

The upload configuration currently uses:

  • multipart threshold: 100 MB
  • minimum part size: 8 MB
  • max upload size: 5 GB
  • presign TTL: 15 minutes

2. Upload bytes to staging storage

Depending on upload_strategy, the client either:

  • uploads once using the initial upload instruction, or
  • requests part instructions with POST /api/upload-sessions/{id}/parts and uploads each part

3. Complete the upload

Call:

  • POST /api/upload-sessions/{id}/complete

4. Poll session status

Call:

  • GET /api/upload-sessions/{id}

Continue polling until the session becomes:

  • ready
  • failed
  • expired
  • aborted

Important statuses used by the live backend:

  • created
  • uploading
  • uploaded
  • finalizing
  • ready
  • failed
  • aborted
  • expired

5. Create the product from the ready session

Call:

  • POST /api/products

with upload_session_id plus product metadata such as:

  • price
  • title
  • is_adult_content
  • is_verif_age
  • is_should_consent
  • public_description
  • private_description

Flow B: legacy direct upload

The backend still supports direct POST /api/products uploads with a media file for legacy clients.

Important live behavior:

  • large uploads may return 202 Accepted
  • some legacy chunk-upload flows can report upload_percentage
  • product creation may continue asynchronously in CreateProductJob

For new client work, prefer upload sessions.

Price rules

The backend stores product price in minor units.

Examples:

  • 500 = 5.00
  • 5500 = 55.00

Client guidance:

  • send prices in the backend's expected units
  • enforce no more than two decimal places in UI input before conversion
  • treat the backend response as the source of truth for stored price

Post-upload editing

Once a product exists, the creator can adjust:

  • title
  • public description
  • private description
  • adult-content flag
  • buyer age-check requirement
  • third-party consent requirement
  • downloadability
  • folder assignment
  • collection membership

Relevant endpoints:

  • PATCH /api/products/{product}
  • PATCH /api/products/{product}/folder
  • POST /api/products/{product}/collection

Moderation and post-processing

After upload, Fangate may:

  • generate previews / thumbnails
  • mirror assets across process and final disks where needed
  • run image moderation through SightEngine
  • mark video uploads for manual approval instead of automated SightEngine review

The current backend does not send video assets to SightEngine.

If a creator indicates that other people appear in the content, the current backend supports:

  • tagging Fangate creators
  • sending an email-based consent flow
  • uploading at least three supporting consent documents

Endpoint:

  • POST /api/consents/store-or-send

See Consent & Adult Content.

Buyer unlock flow

After a creator publishes and a buyer purchases:

  1. the buyer opens the Fangate sales link
  2. Fangate applies the adult-content / age-check rules if required
  3. payment is completed
  4. provider webhooks confirm the purchase
  5. Fangate grants access to the purchased media

Relevant access routes include:

  • /payment/view-only/{transaction}
  • /download/{media}
  • /view/{media}
  • /access-media/{transaction}/{media}

Important access detail

Buyers should access media through Fangate-controlled routes or backend-returned URLs, not through guessed raw object-storage paths.

That matters because:

  • some assets are private or signed
  • storage layout can change between environments
  • the backend may use generated or mirrored final-storage locations
  1. POST /api/upload-sessions
  2. upload bytes to storage
  3. POST /api/upload-sessions/{id}/complete
  4. GET /api/upload-sessions/{id} until ready
  5. POST /api/products with upload_session_id
  6. PATCH /api/products/{id} for descriptions / toggles if needed
  7. POST /api/consents/store-or-send if third-party consent is required
  8. buyer purchases the generated Fangate sales link
  9. buyer accesses content through Fangate access routes

Fangate backend developer documentation