swagger: '2.0'
info:
  version: 1.0-20170623
  title: MSB Pay API
  description: >-
    API specification for payment processing via the MySchoolBucks.com cart checkout.

host: test.www.myschoolbucks.com
basePath: /msbpay/1.0
schemes:
  - https

consumes:
 - application/json
produces:
 - application/json


definitions:
#BEGIN ENUM DEFINITIONS
  MsbPayResult:
    type: string
    description: MSB Pay API method outcome
    enum: &MSBPAYRESULT
      - unknown
      - success
      - error
  CartStatus:
    type: string
    description: Status for the cart
    enum: &CARTSTATUS
      - pending
      - canceled
      - authorized
      - closed
  PaymentTxnType:
    type: string
    description: Type of payment activity
    enum: &PAYMENTTXNTYPE
      - sale
      - credit
      - refund
      - reversal
      - preauth
      - postauth
  PaymentType:
    type: string
    description: Class of payment activity
    enum: &PAYMENTTYPE
      - sale
      - credit
  OrderStatus:
    type: string
    description: Status for the order
    enum: &ORDERSTATUS
      - active
      - canceled
      - closed
      - declined
      - pending
      - review
      - void
#END ENUM DEFINITIONS

#BEGIN REQUEST/RESPONSE DEFINITIONS
  MsbPayResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string

  GetCartResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      cart:
        $ref: '#/definitions/Cart'
        
  GetCartsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      carts:
        type: array
        description: List of Carts and details 
        items:
          $ref: '#/definitions/Cart'
      meta:
        $ref: '#/definitions/ListPaging'
        description: >-
          List handling and paging cues

  GetCartOrdersResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      carts:
        type: array
        description: List of Orders associated to the Cart processing 
        items:
          $ref: '#/definitions/CartOrder'

  GetCartPaymentsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      carts:
        type: array
        description: List of Payments associated to the Cart processing 
        items:
          $ref: '#/definitions/CartPayment'

  CreateUpdateCartRequest:
    type: object
    required: [cartItems]
    properties:
      cartItems:
        type: array
        description: Array of cart items to be paid for with through Pay API
        items:
          $ref: '#/definitions/CartItem'
      redirectUrl:
        type: string
        description: >-
          Return URL for handoff of browser page after user enters payment
          information on MySchoolBucks
      allowDuplicatePayments:
        type: string
        description: >-
          Provide the string value "true" in this field to suppress the 
          duplicate payment detection feature
      returnToSiteUrl:
        type: string
        description: >-
          Supply a URL in this field to display a button at checkout for users to
          return to your site to modify their cart
      loginPolicy:
        type: string
        description: >-
          When set to "optional", allows the user to use guest checkout. If set to "required", user must log into an account. If set to "none", user is not prompted to log in and immediately starts checkout. If set to null, use district defaults.
  CreateUpdateCartResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      cartId:
        type: string
        description: Identifier of the cart created by the request
        
  ProcessCartResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      resultCodes:
        type: array
        description: Messages for the orders created from cart request
        items:
          type: string
      cartId:
        type: string
        description: Identifier of the cart created by the request

  CartPaymentRefundRequest:
    type: object
    properties:
      refundItems:
        type: array
        description: Array of payment items to be refunded through Pay API
        items:
          $ref: '#/definitions/CartRefundItem'
      refundFullAmount:
        type: boolean
        description: If set to true, refund entire remaining order value, ignoring the request item array
      refundReason:
        type: string
        description: >-
          Reason to log for the refund action
  CartPaymentRefundResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      paymentId:
        type: string
        description: Identifier of the payment that received refund request
      cartId:
        type: string
        description: Identifier of the cart containing the payment
        
  SearchPaymentMethodsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      paymentMethods:
        type: array
        description: Valid payment method names and IDs for the given client
        items:
          $ref: '#/definitions/ClientProperty'
      meta:
        $ref: '#/definitions/ListPaging'
        description: >-
          List handling and paging cues
        
  SearchStoresResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      stores:
        type: array
        description: Valid store names and IDs for the given client
        items:
          $ref: '#/definitions/ClientProperty'
      meta:
        $ref: '#/definitions/ListPaging'
        description: >-
          List handling and paging cues
        
  SearchDepartmentsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      departments:
        type: array
        description: Valid department names and IDs for the given client
        items:
          $ref: '#/definitions/ClientProperty'
      meta:
        $ref: '#/definitions/ListPaging'
        description: >-
          List handling and paging cues
        
  SearchGLAccountsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      glaccounts:
        type: array
        description: Valid G/L Account names and IDs for the given client
        items:
          $ref: '#/definitions/ClientProperty'
      meta:
        $ref: '#/definitions/ListPaging'
        description: >-
          List handling and paging cues

  SearchPaymentsResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      carts:
        type: array
        description: List payments for the Cart 
        items:
          $ref: '#/definitions/CartPayment'

  BooleanResponse:
    type: object
    properties:
      result:
        type: string
        description: MSB Pay API method outcome
        enum: *MSBPAYRESULT
      errors:
        type: array
        description: Error messages supplied if there are issues with method.
        items:
          type: string
      responseBoolean:
        type: boolean
        description: True/False value for the outcome of the method
#END REQUEST/RESPONSE DEFINITIONS


#BEGIN DATA MODEL DEFINITIONS
  MsbPayUser:
    type: object
    properties:
      name:
        type: string
        description: Name of model
      id:
        type: string
        description: Developer account ID
      firstName:
        type: string
        description: First name for the developer account holder
      lastName:
        type: string
        description: Last name for the developer account holder
      email:
        type: string
        description: Email address for the developer account holder
      defaultClientId:
        type: string
        description: >-
          ID for MySchoolBucks top level organizational unit this developer account is assigned as a default (if null, no default is set)
      clients:
        type: array
        description: MSB clients and default settings for each
        items:
           $ref: '#/definitions/MsbPayUserClient'

  MsbPayUserClient:
    type: object
    description: >-
      Describes client settings assigned to the developer account
    properties:
      isEnabled:
        type: boolean
        description: >-
          Indicates if the client is currently enabled for the developer account
      clientId:
        type: string
        description: >-
          ID for MySchoolBucks top level organizational unit
      departmentId:
        type: string
        description: >-
          Default ID for MySchoolBucks department that the sale for this client will be recorded (if null, no default is set)
      storeId:
        type: string
        description: >-
          Default store that the sale for this client will be recorded with (if null, no default is set)
      paymentMethodId:
        type: string
        description: >-
          Default payment method that sales for this client will be processed by (if null, no default is set)


  Cart:
    type: object
    properties:
      id:
        type: string
        description: Identifier of the cart created by the request
      status:
        type: string
        description: Status for the cart
        enum: *CARTSTATUS
      createdDate:
        type: string
        format: date-time
        description: Date the cart was created and ID returned
      lastUpdated:
        type: string
        format: date-time
        description: Date the cart was last updated
      redirectUrl:
        type: string
        description: Url to navigate to after checkout is complete
      returnToSiteUrl:
        type: string
        description: Url that will be used at checkout to provide a back button to users
      checkoutUrl:
        type: string
        description: Send the customer here to complete checkout
      allowDuplicatePayments: 
        type: string
        description: Will be "true" if set, "false" otherwise
      loginPolicy:
        type: string
        description: Login policy for the cart. Either "optional" or null
      cartItems:
        $ref: '#/definitions/CartItem'
  CartItem:
    type: object
    required: 
      - itemId
      - itemName
      - quantity
      - unitPrice
    properties:
      clientId:
        type: string
        description: >-
          ID for MySchoolBucks store that the sale should be recorded with for
          reporting [Required if no default for dev account]
      departmentId:
        type: string
        description: >-
          ID for MySchoolBucks department that the sale should be recorded with for reporting
      storeId:
        type: string
        description: >-
          ID for MySchoolBucks store that the sale should be recorded with for reporting <i>[required if no default for dev account]</i>
      itemId:
        type: string
        description: >-
          ID for the MySchoolBucks item that the sale should be recorded with
          for reporting
      itemName:
        type: string
        description: >-
          Name of item that the line items should display to user at checkout
          and any receipts
      paymentMethodId:
        type: string
        description: >-
          ID for the MySchoolBucks payment method configuration that this
          cart should process through <i>[required if no default for dev account]</i>
      quantity:
        type: string
        description: Number of the items to purchase
      unitPrice:
        type: string
        description: Dollar amount price for each item in purchase
      studentName:
        type: string
        description: Student name to be included in the checkout display and on receipts
      reference:
        type: string
        description: Recorded for reporting
      properties:
        type: array
        description: >-
          Array of additional properties to be recorded with the order and
          payment line items
        items:
          $ref: '#/definitions/ItemProperty'
      glAccountId:
        type: string
        description: GL Account to which the payments for this item will be applied

  CartOrder:
    type: object
    description: >-
      Orders for the supplied cart
    properties:
      clientId:
        type: string
        description: >-
          ID for MySchoolBucks store that the order was recorded with
      orderId:
        type: string
        description: Identifier of the order object
      date:
        type: string
        format: date-time
        description: Date the order was created
      status:
        type: string
        description: Status for the order
        enum: *ORDERSTATUS
      recipientName:
        type: string
        description: >-
          Customer name tied to the order by the user account or input from a
          guest checkout
      recipientEmail:
        type: string
        description: >-
          Customer email tied to the order by the user account or input from a
          guest checkout
      billingAcctDesc:
        type: string
        description: >-
          Short string reference for the type of account and last 4 of account
          number submitted to pay order
      tag:
        type: object
        description: TODO - get description
      storeId:
        type: string
        description: ID for MySchoolBucks store that the order has been recorded to
      cartOrderItems:
        type: array
        description: >-
          Orders associated with this cart - MySchoolBucks may break a
          cart into multiple orders based on gateway and store settings
        items:
          $ref: '#/definitions/CartOrderItem'
  CartOrderItem:
    type: object
    description: >-
      Order item details
    properties:
      productName:
        type: string
        description: >-
          Identifies the name of item sold - maps to the CartItem name from
          the request
      productId:
        type: string
        description: >-
          Identifies the ID of item sold - maps to the CartItem ID from the
          request
      unitPrice:
        type: number
        format: decimal
        description: Price for each product in this line item
      quantity:
        type: integer
        description: Number of products allocated to this line item
      price:
        type: number
        format: decimal
        description: Total price for this line item
      userTxnFee:
        type: number
        format: decimal
        description: MySchoolBucks fees assigned to the user for this line item
      clientTxnFee:
        type: number
        format: decimal
        description: >-
          MySchoolBucks fees assigned to the sales district for this line item
      salesTax:
        type: number
        format: decimal
        description: Sales tax allocated to this line item
      properties:
        type: array
        description: >-
          Line item properties - maps to the CartItem properties from the
          request
        items:
          $ref: '#/definitions/ItemProperty'
      paymentMethodId:
        type: string
        description: >-
          ID for the MySchoolBucks payment method configuration that this order
          has processed through

  CartPayment:
    type: object
    description: >-
      Payment for the an API initiated checkout
    properties:
      id:
        type: string
        description: Identifier of the payment object
      clientId:
        type: string
        description: Identifier of the client where payment was recorded
      cartId:
        type: string
        description: Identifier of the cart created by the request
      orderId:
        type: string
        description: Identifier of the order object
      orderStatus:
        status:
        type: string
        description: Status for the order
        enum: *ORDERSTATUS
      payerName:
        type: string
        description: >-
          Name of the account holder from stored billing account or guest
          checkout
      date:
        type: string
        format: date-time
        description: Date and time of payment
      txnType:
        type: string
        description: Type of payment activity
        enum: *PAYMENTTXNTYPE
      paymentMethodId:
        type: string
        description: >-
          ID for the MySchoolBucks payment method configuration that this
          payment has processed through
      billingAcctDesc:
        type: string
        description: >-
          Short string reference for the type of account and last 4 of account
          number submitted to pay order
      amount:
        type: number
        format: decimal
        description: Amount of payment
      salesTax:
        type: number
        format: decimal
        description: Amount of sales tax for payment
      userTxnFee:
        type: number
        format: decimal
        description: Amount of fees paid by user
      clientTxnFee:
        type: number
        format: decimal
        description: Amount of fees paid by district
      confirmation:
        type: string
        description: Merchant confirmation status of payment
      batchDate:
        type: string
        format: date-time
        description: >-
          TODO - is this needed Date and time of payment gateway batch
          settlement
      batchNumber:
        type: string
        description: >-
          TODO - is this needed Payment gateway batch settlement  reference
          number
      depositAmount:
        type: number
        format: decimal
        description: >-
          TODO - is this needed Amount settled to funding account with this
          batch
      settled:
        type: boolean
        description: >-
          Status of card/bank settlement - if true, the account holder has had funds applied to their account balance
      cartPaymentItems:
        type: array
        description: >-
          Payment items associated with this cart
        items:
          $ref: '#/definitions/CartPaymentItem'
  CartPaymentItem:
    type: object
    description: >-
      Payment item details
    properties:
      itemName:
        type: string
        description: >-
          Identifies the name of item sold - maps to the CartItem name from
          the request
      itemId:
        type: string
        description: >-
          Identifies the ID of item sold - maps to the CartItem ID from the
          request
      unitPrice:
        type: number
        format: decimal
        description: Price for each product in this line item
      quantity:
        type: integer
        description: Number of products allocated to this line item
      price:
        type: number
        format: decimal
        description: Total price for this line item
      userTxnFee:
        type: number
        format: decimal
        description: MySchoolBucks fees assigned to the user for this line item
      clientTxnFee:
        type: number
        format: decimal
        description: >-
          MySchoolBucks fees assigned to the sales district for this line item
      salesTax:
        type: number
        format: decimal
        description: Sales tax allocated to this line item
      reference:
        type: string
        description: TODO - get a description for what this is on MSB
      properties:
        type: array
        description: >-
          Line item properties - maps to the CartItem properties from the
          request
        items:
          $ref: '#/definitions/ItemProperty'
      studentName:
        type: string
        description: >-
          Optional student name passed with the cart item

  CartRefundItem:
    type: object
    required: 
      - itemId
      - itemName
      - quantity
      - unitPrice
    properties:
      departmentId:
        type: string
        description: >-
          ID for MySchoolBucks department that the refund should be recorded with for reporting
      itemId:
        type: string
        description: >-
          ID for the MySchoolBucks item that the refund should be recorded with for reporting
      itemName:
        type: string
        description: >-
          Name of item that the line items should display to user at checkout
          and any receipts
      quantity:
        type: string
        description: Number of the items to refund
      unitPrice:
        type: string
        description: Dollar amount price for each unit refunded
      studentName:
        type: string
        description: Student name to be included in the reporting
      reference:
        type: string
        description: Recorded for reporting
      properties:
        type: array
        description: >-
          Array of additional properties to be recorded with the order and
          payment line items
        items:
          $ref: '#/definitions/ItemProperty'

  ItemProperty:
    type: object
    description: >-
      Optional item property name and value
    required: 
      - name
      - value
    properties:
      name:
        type: string
        description: >-
          Name of item property - this will be included in the order and payment
          item description on MySchoolBucks
      value:
        type: string
        description: >-
          Value of named item property - this will be included in the order and
          payment item description on MySchoolBucks
      displayResponse:
        type: string
        description: >-
          Specifies whether or not to display the property to the user. Valid values are
          "visible", "hidden", or empty/null 
          
  ClientProperty:
    type: object
    description: A Name/Value pair, used when getting a list of properties for a client
    required: 
      - id
      - name
    properties:
      id:
        type: string
        description: >-
          Identifier for the property. Used for API calls.
      name:
        type: string
        description: >-
          Friendly name of the property.

  ListPaging:
    type: object
    description: >-
      List item stats for navigating result sets
    properties:
      page:
        type: integer
        description: >-
          Current page number of result set when split by rowCount
      prev:
        type: string
        description: >-
          URL of previous results from set.  Will be empty for first page in set.
      self:
        type: string
        description: >-
          URL of current results from set.
      next:
        type: string
        description: >-
          URL of next results from set.  Will be empty for final page in set.
      total:
        type: integer
        description: >-
          Total number of records that are available with current search filter options
#END DATA MODEL DEFINITIONS


#BEGIN PATHS
paths:
  /:
    get:
      tags:
        - Utility
      description: Returns details of API version , server node, and application version.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
      responses:
        '200':
          description: Developer account information
          schema:
            $ref: '#/definitions/MsbPayResponse'
        '401':
          description: Invalid login
        '500':
          description: Server error

  /whoAmI:
    get:
      tags:
        - Utility
      description: Returns details of developer key's account holder and configuration.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
      responses:
        '200':
          description: Developer account information
          schema:
            $ref: '#/definitions/MsbPayUserResponse'
        '401':
          description: Invalid login
        '500':
          description: Server error

  /testExceptions:
    get:
      tags:
        - Utility
      description: Returns details of developer key's account holder and configuration.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: NotAuthorizedException
          in: query
          type: string
          format: string
        - name: ForbiddenException
          in: query
          type: string
          format: string
        - name: NotFoundException
          in: query
          type: string
          format: string
        - name: NotAllowedException
          in: query
          type: string
          format: string
        - name: NotAcceptableException
          in: query
          type: string
          format: string
        - name: NotSupportedException
          in: query
          type: string
          format: string
        - name: ClientErrorException
          in: query
          type: string
          format: string
        - name: InternalServerErrorException
          in: query
          type: string
          format: string
        - name: ServiceUnavailableException
          in: query
          type: string
          format: string
        - name: ServerErrorException
          in: query
          type: string
          format: string
        - name: WebApplicationException
          in: query
          type: string
          format: string
        - name: RuntimeException
          in: query
          type: string
          format: string
        - name: BadRequestException
          in: query
          type: string
          format: string
        - name: NullPointerException
          in: query
          type: string
          format: string
      responses:
        '200':
          description: Developer account information
          schema:
            $ref: '#/definitions/MsbPayResponse'
        '401':
          description: Invalid login
        '500':
          description: Server error

  /carts:
    get:
      tags:
        - Cart
      description: Returns list of carts created via this developer key.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: status
          in: query
          type: string
          format: string
          description: Status of API cart
          required: false
          enum: *CARTSTATUS
        - name: createdDateStart
          in: query
          type: string
          format: date-time
          description: Returns carts created on or after this date
          required: false
        - name: createdDateEnd
          in: query
          type: string
          format: date-time
          description: Returns carts created on or before this date
          required: false
        - name: updatedDateStart
          in: query
          type: string
          format: date-time
          description: Returns carts updated on or after this date
          required: false
        - name: updatedDateEnd
          in: query
          type: string
          format: date-time
          description: Returns carts updated on or before this date
          required: false
        - name: clientId
          in: query
          type: string
          format: string
          description: ID for MySchoolBucks district where the sale was recorded 
          required: false
        - name: storeId
          in: query
          type: string
          format: string
          description: ID for the district-level store where the sale was recorded
          required: false
        - name: paymentMethodId
          in: query
          type: string
          format: string
          description: ID for the district-level payment method where the sale was recorded
          required: false
        - name: departmentId
          in: query
          type: string
          format: string
          description: ID for the optional district-level department where the sale was recorded 
          required: false
        - name: itemId
          in: query
          type: string
          format: string
          description: ID for the cart item as configured when cart was created. <i>note - this is an exact match, no wildcard or partials will work</i>
          required: false
        - name: itemName
          in: query
          type: string
          format: string
          description: Name for the cart item as configured when cart was created. <i>note - this is an exact match, no wildcard or partials will work</i>
          required: false
        - name: studentName
          in: query
          type: string
          format: string
          description: Student name for the cart item if configured when cart was created. <i>note - this is an exact match, no wildcard or partials will work</i>
          required: false
        - name: reference
          in: query
          type: string
          format: string
          description: Reference string created by your system for the cart item if configured when the cart was created. <i>note - this is an exact match, no wildcard or partials will work</i>
          required: false
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
        - name: rowCount
          in: query
          type: integer
          default: 10
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: List of Carts
          schema:
            type: array
            items:
              $ref: '#/definitions/GetCartsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '500':
          description: Server error

    post:
      tags:
        - Cart
      description: Prepares a cart to be processed in MySchoolBucks.  Returns a new cart ID for the requested items.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: body
          in: body
          required: false
          description: 
                        Redirect URL must be fewer than or equal to 255 characters
                        </br></br>Item ID must be fewer than or equal to 60 characters, and may contain
                        only letters, numbers, underscores, dashes, periods, or at signs.
                        </br></br>Item name must be fewer than or equal to 80 characters.
                        </br></br>Unit price is required and must be a positive number.
                        </br></br>Quantity must be greater than 0.
                        </br></br>Student name must fewer than or equal to 60 characters.
                        </br></br>Reference must be fewer than or equal to 80 characters.
                        </br></br>Property names must not be empty or null.
                        </br></br>Property Display Response must be "visible", "hidden", or null/empty.
          schema:
            $ref: '#/definitions/CreateUpdateCartRequest'
      responses:
        '201':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/CreateUpdateCartResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '500':
          description: Server error

  '/carts/{cartId}':
    get:
      tags:
        - Cart
      description: Returns a cart created via this developer key.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/GetCartResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error
    put:
      tags:
        - Cart
      description: Replace the cart request with the supplied details.  This does not patch the request, you will need to send the entire snapshot of the cart to update.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
        - name: body
          in: body
          required: true
          description: 
                        Redirect URL must be fewer than or equal to 255 characters
                        </br></br>Item ID must be fewer than or equal to 60 characters, and may contain
                        only letters, numbers, underscores, dashes, periods, or at signs.
                        </br></br>Item name must be fewer than or equal to 80 characters.
                        </br></br>Unit price is required and must be a positive number.
                        </br></br>Quantity must be greater than 0.
                        </br></br>Student name must fewer than or equal to 60 characters.
                        </br></br>Reference must be fewer than or equal to 80 characters.
                        </br></br>Property names must not be empty or null.
                        </br></br>Property Display Response must be "visible", "hidden", or null/empty.
          schema:
            $ref: '#/definitions/CreateUpdateCartRequest'
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/CreateUpdateCartResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error
    delete:
      tags:
        - Cart
      description: >-
        Cancels cart with supplied ID.  Returns true if the cart
        was canceled, false otherwise.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Result of the business cart (true = cancel successful)
          schema:
            $ref: '#/definitions/BooleanResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/carts/{cartId}/addItems':
    post:
      tags:
        - Cart
      description: Add a new cart item to the request.  This appends to the request, you will need to send an update to the cart to change or remove the current contents.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
        - name: body
          in: body
          required: true
          description: 
                        Redirect URL must be fewer than or equal to 255 characters
                        </br></br>Item ID must be fewer than or equal to 60 characters, and may contain
                        only letters, numbers, underscores, dashes, periods, or at signs.
                        </br></br>Item name must be fewer than or equal to 80 characters.
                        </br></br>Unit price is required and must be a positive number.
                        </br></br>Quantity must be greater than 0.
                        </br></br>Student name must fewer than or equal to 60 characters.
                        </br></br>Reference must be fewer than or equal to 80 characters.
                        </br></br>Property names must not be empty or null.
                        </br></br>Property Display Response must be "visible", "hidden", or null/empty.
          schema:
            $ref: '#/definitions/CreateUpdateCartRequest'
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/CreateUpdateCartResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/carts/{cartId}/process':
    post:
      tags:
        - Cart
      description: Process authorized cart created via this developer key and previously approved by customer.  Process method only works on carts in Approved status.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/ProcessCartResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/carts/{cartId}/orders':
    get:
      tags:
        - Payment
      description: Return list of orders for supplied cart.  Orders are in intermediate structure between cart requests and payments. 
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/GetCartOrdersResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/carts/{cartId}/payments':
    get:
      tags:
        - Payment
      description: Return list of payments for supplied cart.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: id
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/GetCartPaymentsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/carts/{cartId}/payments/{paymentId}/refund':
    post:
      tags:
        - Refund
      description: Refunds partial or whole payments created by the Cart processing.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: cartId
          in: path
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
          required: true
        - name: paymentId
          in: path
          type: string
          format: string
          description: Payment identifier assigned by MySchoolBucks.
          required: true
        - name: body
          in: body
          required: true
          description: 
                        Redirect URL must be fewer than or equal to 255 characters
                        </br></br>Item ID must be fewer than or equal to 60 characters, and may contain
                        only letters, numbers, underscores, dashes, periods, or at signs.
                        </br></br>Item name must be fewer than or equal to 80 characters.
                        </br></br>Unit price is required and must be a positive number.
                        </br></br>Quantity must be greater than 0.
                        </br></br>Student name must fewer than or equal to 60 characters.
                        </br></br>Reference must be fewer than or equal to 80 characters.
                        </br></br>Property names must not be empty or null.
                        </br></br>Property Display Response must be "visible", "hidden", or null/empty.
          schema:
            $ref: '#/definitions/CartPaymentRefundRequest'
      responses:
        '200':
          description: Details of requested cart
          schema:
            $ref: '#/definitions/CartPaymentRefundResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error
         
  '/clients/{clientId}/payments':
    get:
      tags:
        - Reconciliation
      description: Returns payments created by this developer key at indicated client.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: cartId
          in: query
          type: string
          format: string
          description: Cart identifier assigned by MySchoolBucks.
        - name: transferConfirmed
          in: query
          type: boolean
          description: Specify to filter for transfers with confirmed (true) or unconfirmed (false) status.  Default is to return all both types unfiltered.
          required: false
        - name: paymentType
          in: query
          type: string
          description: Specify to filter for only sale or credit (refund, reversal, etc.) records.  Default is to return all types unfiltered.
          enum: *PAYMENTTYPE
          required: false
        - name: startDate
          in: query
          type: string
          format: date-time
          description: Returns carts created on or after this date
          required: false
        - name: endDate
          in: query
          type: string
          format: date-time
          description: Returns carts created on or before this date
          required: false
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
          minimum: 1
        - name: rowCount
          in: query
          type: integer
          default: 20
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
      responses:
        '200':
          description: List of payments meeting filter criteria.
          schema:
            $ref: '#/definitions/SearchPaymentsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error

  '/clients/{clientId}/payments/{paymentId}/confirmtransfer':
    post:
      tags:
        - Reconciliation
      description: Records payment as confirmed by the sales agent application.  Used to acknowledge payment status.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: paymentId
          in: path
          type: string
          format: string
          description: Payment identifier assigned by MySchoolBucks.
          required: true
      responses:
        '200':
          description: Success marker of business process.  Returns true if the payment was confirmed, false otherwise.
          schema:
            $ref: '#/definitions/BooleanResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error
          
  '/clients/{clientId}/paymentMethods':
    get:
      tags:
        - Payment Methods
      description: Returns IDs for payment methods associated with the client.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
        - name: rowCount
          in: query
          type: integer
          default: 10
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
        - name: searchText
          in: query
          type: string
          description: Text to use to filter the items
          required: false
      responses:
        '200':
          description: List of IDs for payment methods
          schema:
            $ref: '#/definitions/SearchPaymentMethodsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error 
          
  '/clients/{clientId}/stores':
    get:
      tags:
        - Stores
      description: Returns IDs for stores associated with the client.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
        - name: rowCount
          in: query
          type: integer
          default: 10
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
        - name: searchText
          in: query
          type: string
          description: Text to use to filter the items
          required: false
      responses:
        '200':
          description: List of IDs for stores
          schema:
            $ref: '#/definitions/SearchStoresResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error 
          
  '/clients/{clientId}/departments':
    get:
      tags:
        - Departments
      description: Returns IDs for departments associated with the client.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
        - name: rowCount
          in: query
          type: integer
          default: 10
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
        - name: searchText
          in: query
          type: string
          description: Text to use to filter the items
          required: false
      responses:
        '200':
          description: List of IDs for departments
          schema:
            $ref: '#/definitions/SearchDepartmentsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error 
          
  '/clients/{clientId}/glAccounts':
    get:
      tags:
        - G/L Accounts
      description: Returns IDs for G/L Accounts associated with the client.
      parameters:
        - name: Authorization
          in: header
          type: string
          format: string
          description: Login details to authenticate call.
          required: true
          default: demoaccount:EBNF-JNEC-HKHL-EALD-JMFJ-BKOM-PHNA-CKLP
        - name: clientId
          in: path
          type: string
          format: string
          description: Client identifier assigned by MySchoolBucks.
          required: true
        - name: page
          in: query
          type: integer
          default: 1
          description: Requests page number for query results returning more than (rowCount) items
          required: false
        - name: rowCount
          in: query
          type: integer
          default: 10
          description: Requests results to be returned in groups of no more than (rowCount) items
          required: false
          minimum: 1
          maximum: 100
        - name: searchText
          in: query
          type: string
          description: Text to use to filter the items
          required: false
      responses:
        '200':
          description: List of IDs for G/L Accounts
          schema:
            $ref: '#/definitions/SearchGLAccountsResponse'
        '400':
          description: Input data/structure error
        '401':
          description: Invalid login
        '403':
          description: Not allowed
        '404':
          description: Resource not found
        '500':
          description: Server error 

#END PATHS

