Skip to content

Commit

Permalink
PISHPS-282: added openapi v3 documentation for store-api and admin-api (
Browse files Browse the repository at this point in the history
  • Loading branch information
m-muxfeld-diw authored Jun 20, 2024
1 parent a7fcc78 commit 1b3c4ce
Show file tree
Hide file tree
Showing 39 changed files with 3,636 additions and 0 deletions.
104 changes: 104 additions & 0 deletions src/Resources/Schema/admin-api/create-support-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"openapi": "3.0.3",
"info": {
"title": "Mollie Support Request API",
"description": "API for submitting support requests to Mollie.",
"version": "1.0.0"
},
"paths": {
"/api/_action/mollie/support/request": {
"post": {
"summary": "Submit Support Request to Mollie",
"description": "Submits a support request to Mollie.",
"operationId": "submitSupportRequest",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the person submitting the request."
},
"email": {
"type": "string",
"format": "email",
"description": "The email address of the person submitting the request."
},
"recipientLocale": {
"type": "string",
"description": "The locale of the recipient for the support request."
},
"subject": {
"type": "string",
"description": "The subject of the support request."
},
"message": {
"type": "string",
"description": "The message content of the support request."
}
},
"required": ["name", "email", "recipientLocale", "subject", "message"],
"example": {
"name": "John Doe",
"email": "[email protected]",
"recipientLocale": "en_US",
"subject": "Issue with payment processing",
"message": "I'm encountering issues with processing payments."
}
}
}
}
},
"responses": {
"200": {
"description": "Support request submitted successfully.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
}
},
"required": ["success"]
},
"example": {
"success": true
}
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": false
},
"error": {
"type": "string"
}
},
"required": ["success", "error"]
},
"example": {
"success": false,
"error": "Internal server error occurred."
}
}
}
}
}
}
}
}
}
59 changes: 59 additions & 0 deletions src/Resources/Schema/admin-api/order-payment-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"openapi": "3.0.3",
"info": {
"title": "Mollie Order Payment URL API",
"description": "API for generating a payment URL for a Mollie order.",
"version": "1.0.0"
},
"paths": {
"/api/_action/mollie/order/payment-url": {
"post": {
"summary": "Generate Mollie Order Payment URL",
"description": "Creates a payment URL for a Mollie order.",
"operationId": "paymentUrl",
"responses": {
"201": {
"description": "Payment URL successfully created.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri",
"example": "https://example.com"
}
}
},
"example": {
"url": "https://example.com"
}
}
}
},
"404": {
"description": "Resource not found.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {}
},
"example": []
}
}
}
}
}
}
},
"components": {
"schemas": {
"EmptyArray": {
"type": "array",
"items": {}
}
}
}
}
62 changes: 62 additions & 0 deletions src/Resources/Schema/admin-api/payment-method-update.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"openapi": "3.0.3",
"info": {
"title": "Mollie Payment Method Update API",
"description": "API for updating payment methods for Mollie.",
"version": "1.0.0"
},
"paths": {
"/api/_action/mollie/payment-method/update-methods": {
"get": {
"summary": "Update Mollie Payment Methods",
"description": "Updates the payment methods for Mollie.",
"operationId": "paymentMethodUpdate",
"responses": {
"200": {
"description": "Payment methods successfully updated.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": true
}
}
},
"example": {
"success": true
}
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Error message"
},
"success": {
"type": "string",
"example": "false"
}
}
},
"example": {
"message": "Error message",
"success": "false"
}
}
}
}
}
}
}
}
}
121 changes: 121 additions & 0 deletions src/Resources/Schema/admin-api/refund-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"openapi": "3.0.3",
"info": {
"title": "Mollie Refund List API",
"description": "API for listing refund items for a Mollie order.",
"version": "1.0.0"
},
"paths": {
"/api/_action/mollie/refund/list": {
"post": {
"summary": "List Refund Items for Mollie Order",
"description": "Retrieves a list of refund items for a Mollie order.",
"operationId": "listRefundItems",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"orderId": {
"type": "string",
"format": "uuid",
"description": "The UUID of the order."
}
},
"required": ["orderId"]
},
"example": {
"orderId": "123e4567-e89b-12d3-a456-426614174000"
}
}
}
},
"responses": {
"200": {
"description": "List of refund items successfully retrieved.",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"swLineId": {
"type": "string",
"example": "line_123456"
},
"swLineVersionId": {
"type": "string",
"example": "version_123456"
},
"mollieLineId": {
"type": "string",
"example": "mollie_line_123456"
},
"swReference": {
"type": "string",
"example": "Product ABC"
},
"quantity": {
"type": "integer",
"example": 1
},
"amount": {
"type": "number",
"format": "float",
"example": 50.00
}
}
}
},
"example": [
{
"swLineId": "line_123456",
"swLineVersionId": "version_123456",
"mollieLineId": "mollie_line_123456",
"swReference": "Product ABC",
"quantity": 1,
"amount": 50.00
}
]
}
}
},
"500": {
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean",
"example": false
},
"errors": {
"type": "array",
"items": {
"type": "string"
},
"example": [
"Error message"
]
}
}
},
"example": {
"success": false,
"errors": [
"Error message"
]
}
}
}
}
}
}
}
}
}
Loading

0 comments on commit 1b3c4ce

Please sign in to comment.