"patron": {
"$ref": "definitions/patron.json"
},
+ "patron_account_credit": {
+ "$ref": "definitions/patron_account_credit.json"
+ },
"patron_balance": {
"$ref": "definitions/patron_balance.json"
},
--- /dev/null
+{
+ "type": "object",
+ "properties": {
+ "credit_type": {
+ "type": "string",
+ "description": "Type of credit ('credit', 'forgiven', 'lost_item_return', 'payment', 'writeoff' )"
+ },
+ "amount": {
+ "type": "number",
+ "minimum": 0,
+ "description": "Credit amount"
+ },
+ "account_lines_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "List of account line ids the credit goes against (optional)"
+ },
+ "payment_type": {
+ "type": "string",
+ "description": "Payment type (only applies when credit_type=payment)"
+ },
+ "date": {
+ "type": "string",
+ "format": "date",
+ "description": "Date the credit was recorded (optional)"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description"
+ },
+ "note": {
+ "type": "string",
+ "description": "Internal note"
+ }
+ },
+ "required": [ "amount" ]
+}
"/patrons/{patron_id}/account": {
"$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account"
},
+ "/patrons/{patron_id}/account/credits": {
+ "$ref": "paths/patrons_account.json#/~1patrons~1{patron_id}~1account~1credits"
+ },
"/illrequests": {
"$ref": "paths/illrequests.json#/~1illrequests"
}
}
}
}
+ },
+ "/patrons/{patron_id}/account/credits": {
+ "post": {
+ "x-mojo-to": "Patrons::Account#add_credit",
+ "operationId": "addPatronCredit",
+ "tags": [
+ "patron"
+ ],
+ "parameters": [
+ {
+ "$ref": "../parameters.json#/patron_id_pp"
+ },
+ {
+ "name": "body",
+ "in": "body",
+ "description": "A JSON object containing credit information",
+ "required": true,
+ "schema": {
+ "$ref": "../definitions.json#/patron_account_credit"
+ }
+ }
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "responses": {
+ "200": {
+ "description": "Credit added",
+ "schema": {
+ "type": "object"
+ }
+ },
+ "401": {
+ "description": "Authentication required",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "403": {
+ "description": "Access forbidden",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "404": {
+ "description": "Patron not found",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ },
+ "503": {
+ "description": "Under maintenance",
+ "schema": {
+ "$ref": "../definitions.json#/error"
+ }
+ }
+ },
+ "x-koha-authorization": {
+ "permissions": {
+ "updatecharges": "remaining_permissions"
+ }
+ }
+ }
}
}