Zest Subscription Fundings API

Upload wire-transfer receipts plus funding metadata. Strict order: a signed form must already be on record before fundings can be uploaded.

OpenAPI Specification

zest-subscription-fundings-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Zest equity public api Authentication Subscription Fundings API
  version: 0.1.0
  description: OAuth 2.0 JWT-Bearer assertion grant. Exchange a partner-signed JWT for a short-lived bearer access token, then send that token in the Authorization header on every partner API call.
servers:
- url: https://sandbox-api.zestequity.com
  description: Staging
tags:
- name: Subscription Fundings
  description: 'Upload wire-transfer receipts plus funding metadata. Strict order: a signed form must already be on record before fundings can be uploaded.'
paths:
  /v1/spvs/{spv_slug}/subscription/{person_id}/fundings:
    post:
      tags:
      - Subscription Fundings
      summary: Upload funding receipt
      description: 'Uploads a wire-transfer receipt + funding metadata (amount / currency / wire_reference) for a partner-managed subscription. Q6c strict order: the signed subscription form must already be on record, otherwise this endpoint returns 409. Emits `funding_receipt.uploaded` webhook on success.'
      operationId: uploadFundingReceipt
      parameters:
      - required: true
        schema:
          type: string
          title: Spv Slug
        name: spv_slug
        in: path
      - required: true
        schema:
          type: string
          title: Person Id
        name: person_id
        in: path
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_uploadFundingReceipt'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FundingUploadResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '401':
          description: Invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '403':
          description: Service not provisioned for partner API
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '404':
          description: SPV or person not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '409':
          description: Form not on record yet, or terminal status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '413':
          description: File too large (>10 MB)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '415':
          description: Unsupported media type
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PartnerErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - HTTPBearer: []
components:
  schemas:
    PartnerValidationError:
      properties:
        attribute:
          type: string
          title: Attribute
          description: Attribute path (e.g. 'deal_name', 'share_class.name').
        code:
          type: string
          title: Code
          description: Stable validation error code (see ValidationErrorCode enum).
        message:
          type: string
          title: Message
          description: Human-readable message.
      type: object
      required:
      - attribute
      - code
      - message
      title: PartnerValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PartnerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          default: 'ex: Something went wrong'
          examples:
          - Something went wrong
        errorId:
          type: string
          title: Errorid
        code:
          type: string
          title: Code
          description: Stable top-level error code (see PartnerErrorCode enum).
        validationErrors:
          items:
            $ref: '#/components/schemas/PartnerValidationError'
          type: array
          title: Validationerrors
          description: Populated only when code='validation_error'.
      type: object
      required:
      - code
      title: PartnerErrorResponse
    FundingUploadResponse:
      properties:
        subscriptionSlug:
          type: string
          title: Subscriptionslug
        spvSlug:
          type: string
          title: Spvslug
        personId:
          type: string
          title: Personid
        fundingReceiptUrl:
          type: string
          title: Fundingreceipturl
        amount:
          type: string
          title: Amount
        currency:
          type: string
          title: Currency
        wireReference:
          type: string
          title: Wirereference
        uploadedAt:
          type: string
          format: date-time
          title: Uploadedat
      type: object
      required:
      - subscriptionSlug
      - spvSlug
      - personId
      - fundingReceiptUrl
      - amount
      - currency
      - wireReference
      - uploadedAt
      title: FundingUploadResponse
    Body_uploadFundingReceipt:
      properties:
        amount:
          type: string
          title: Amount
        currency:
          type: string
          title: Currency
        wireReference:
          type: string
          title: Wirereference
        file:
          type: string
          format: binary
          title: File
      type: object
      required:
      - amount
      - currency
      - wireReference
      - file
      title: Body_uploadFundingReceipt
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer