> ## Documentation Index
> Fetch the complete documentation index at: https://docs.s15x.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert Purchase

> **WARNING: this api will insert and fulfill / complete purchases**

Inserts new purchases for user

<Warning>
  **WARNING: this api will insert and fulfill / complete purchases**
</Warning>


## OpenAPI

````yaml POST /database/upset-purchase
openapi: 3.0.3
info:
  title: APIFiddle Sample Definition
  version: 0.0.0
  description: Example workspace
servers:
  - url: https://api.s15x.dev
    description: s15x api url
security: []
tags:
  - name: purchase-api
  - name: account links
  - name: users
  - name: public
paths:
  /database/upset-purchase:
    post:
      tags:
        - purchase-api
      summary: Inserts new purchase
      description: |-
        **WARNING: this api will insert and fulfill / complete purchases**

        Inserts new purchases for user
      operationId: insertsNewPurchase
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - robloxId
                - productId
                - fulfill
              properties:
                robloxId:
                  type: string
                productId:
                  type: string
                fulfill:
                  type: boolean
      responses:
        '200':
          description: >-
            The request was successful, and the server has returned the
            requested resource in the response body.
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                properties:
                  message:
                    type: string
                    example: Purchase upserted successfully
        '400':
          description: >-
            The server could not understand the request due to invalid syntax.
            The client should modify the request and try again.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
                    example: 'Bad Request: Missing robloxId or productId in request body'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          description: >-
            The server encountered an unexpected condition that prevented it
            from fulfilling the request. Report the issue to the support team if
            it persists.
          content:
            application/json:
              schema:
                type: object
                required:
                  - error
                properties:
                  error:
                    type: string
      security:
        - API-Authorization: []
components:
  responses:
    Forbidden:
      description: >-
        The server understood the request, but refuses to authorize it. Ensure
        the client has appropriate permissions.
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                example: 'Forbidden: Invalid API Key'
  securitySchemes:
    API-Authorization:
      type: apiKey
      name: API-Authorization
      in: header
      description: 'Required: API key to access'

````