openapi: 3.0.0
info:
  version: 1.0.0
  title: ows-payment API Specifications
servers:
  - url: "https://qa-ows-payment.theorchard.io"
    description: QA server
  - url: "http://0.0.0.0:5000/"
    description: Local server
paths:
  /payment-group-payment/{payment_group_payment_id}/payment-batches/:
    get:
      summary: Get payment batches for a payment group payment.
      description: Returns all payment batches for a given payment_group_payment_id
        regardless of status.
      tags:
        - Payment Group Payment
      parameters:
        - name: payment_group_payment_id
          in: path
          required: true
          schema:
            type: integer
            format: int32
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentGroupPaymentBatchStatus"

  /payment-group-payment/{payment_group_payment_id}/payment-batches/{payment_batch_status}:
    get:
      summary: Get payment batches for a payment group payment filtered by status.
      tags:
        - Payment Group Payment
      parameters:
        - name: payment_group_payment_id
          in: path
          required: true
          schema:
            type: integer
            format: int32
        - name: payment_batch_status
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PaymentGroupPaymentBatchStatus"

components:
  schemas:
    PaymentGroupPaymentBatchStatus:
      type: object
      additionalProperties: false
      properties:
        abacus_state_id:
          type: integer
          minimum: 0
        action_status:
          type: string
        batch_num:
          type: integer
          minimum: 0
        error_message:
          type: string
        payment_group_payment_batch_id:
          type: integer
          minimum: 0
        payment_group_payment_id:
          type: integer
          minimum: 0
        payoneer_program_id:
          type: integer
          minimum: 0
      required:
        - abacus_state_id
        - action_status
        - batch_num
        - payment_group_payment_batch_id
        - payment_group_payment_id
        - payoneer_program_id
