consumes: - application/json info: title: A payments API version: 1.0.0 paths: {} produces: - application/json schemes: - http swagger: "2.0" definitions: payment: $ref: "payment.yml" payments: type: object required: - data - links properties: data: type: array items: $ref: "#/definitions/payment" links: type: object required: - self properties: self: type: string empty: type: object properties: # this property is just a trick to force swagger generated code to generate a struct for Empty _: type: string error: type: object properties: code: type: integer message: type: string paths: /payments: get: summary: Lists all the payments parameters: - in: query name: organisation-id type: string description: ID of the organisation the payment belongs to. - in: query name: min-amount type: number description: Min amount of the payment - in: query name: max-amount type: number description: Max amount of the payment responses: 200: description: Success schema: $ref: "#/definitions/payments" post: summary: Creates a new payment produces: - application/json parameters: - in: body name: body required: true schema: $ref: '#/definitions/payment' responses: 201: description: Created schema: $ref: "#/definitions/payment" 422: description: Malformed request schema: $ref: "#/definitions/error" /payment/{paymentID}: get: summary: Gets a payment by its ID parameters: - in: path name: paymentID type: string required: true description: ID of the payment to retrieve responses: 200: description: Success schema: $ref: "#/definitions/payment" 404: description: Payment not found schema: $ref: "#/definitions/error" put: summary: Updates a payment by its ID parameters: - in: path name: paymentID type: string required: true description: ID of the payment to update - in: body name: body required: true schema: $ref: '#/definitions/payment' responses: 200: description: a payment schema: $ref: "#/definitions/empty" 404: description: Payment not found schema: $ref: "#/definitions/error" delete: summary: Deletes a payment by its ID parameters: - in: path name: paymentID type: string required: true description: ID of the payment to delete responses: 200: description: a payment schema: $ref: "#/definitions/empty" 404: description: Payment not found schema: $ref: "#/definitions/error"