FirstPromoter Affiliate Contract Documents API

FirstPromoter Affiliate Contract Documents API - 4 operation(s) on the promoter-facing (api/v2/affiliate) surface, from FirstPromoter's own published OpenAPI definition (3.0.1) indexed in https://docs.firstpromoter.com/llms.txt.

OpenAPI Specification

firstpromoter-v2-affiliate-contract-documents-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: FirstPromoter Contract Documents API
  version: '1.0'
  description: API for managing affiliate contract documents
servers:
- url: https://api.firstpromoter.com/api/v2/affiliate
security:
- BearerAuth: []
paths:
  /contract_documents:
    get:
      summary: Get current version contract documents
      description: "Returns the current contract document  \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/contract_documents`</Tip>"
      tags:
      - Contract Documents
      parameters:
      - $ref: '#/components/parameters/AccountId'
      responses:
        '200':
          description: List of contract documents
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ContractDocument'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /contract_documents/{id}:
    get:
      summary: Get contract documents by id (html/pdf)
      description: "Gets contract document and returns it in the selected format  \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/contract_documents/{id}`</Tip>"
      tags:
      - Contract Documents
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Contract document ID
      - name: content_type
        in: query
        required: true
        schema:
          type: string
          enum:
          - html
          - pdf
        description: Format of the document content
      responses:
        '200':
          description: Document content
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      content:
                        type: string
            application/pdf:
              schema:
                type: string
                format: binary
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /contract_documents/{id}/sign:
    post:
      summary: Sign a document with id
      description: "Signs a contract document with id \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/contract_documents/{id}/sign`</Tip>"
      tags:
      - Contract Documents
      parameters:
      - $ref: '#/components/parameters/AccountId'
      - name: id
        in: path
        required: true
        schema:
          type: integer
        description: Contract document ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                ip:
                  type: string
                  description: IP address of the signer
      responses:
        '200':
          description: Signed document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContractDocument'
        '400':
          description: Invalid IP format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
  /contract_documents/draft:
    post:
      parameters:
      - $ref: '#/components/parameters/AccountId'
      summary: Get the draft content of the contract
      description: "Returns the draft content of the contract with user details \n <Tip>**HTTP Request** <br/>` GET  https://api.firstpromoter.com/api/v2/affiliate/contract_documents/draft`</Tip>"
      tags:
      - Contract Documents
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contract_id:
                  type: integer
                  description: ID of the contract
                details:
                  type: object
                  description: User details to parse
                  properties:
                    email:
                      type: string
                    profile:
                      type: object
                      properties:
                        first_name:
                          type: string
      responses:
        '200':
          description: Draft content
          content:
            application/json:
              schema:
                type: object
                properties:
                  content:
                    type: string
        '404':
          description: Contract not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    AccountId:
      name: Account-ID
      in: header
      required: true
      description: Account identifier that specifies which account is making the request
      schema:
        type: string
        example: acc_123456
  schemas:
    ContractDocument:
      type: object
      properties:
        id:
          type: integer
        status:
          type: string
          enum:
          - signed
        signed_ip:
          type: string
        contract_version_id:
          type: integer
        signed_at:
          type: string
          format: date-time
        promoter:
          $ref: '#/components/schemas/Promoter'
        contract_version:
          $ref: '#/components/schemas/ContractVersion'
        contract:
          $ref: '#/components/schemas/Contract'
    Promoter:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
        name:
          type: string
        profile:
          type: object
          properties:
            avatar:
              type: string
    ContractVersion:
      type: object
      properties:
        added_at:
          type: string
          format: date-time
        changes_made:
          type: string
          nullable: true
        external_link:
          type: string
          nullable: true
        content_hosted:
          type: boolean
    Contract:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
    Error:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
    ValidationError:
      type: object
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
        code:
          type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Access token passed as a Bearer token in the Authorization header
    accountId:
      type: apiKey
      in: header
      name: ACCOUNT-ID
      description: Account ID required with bearer token