{
    "openapi": "3.0.2",
    "info": {
        "title": "RCUR",
        "description": "Manage customers, subscriptions, payment links and payments in RCUR. Guides: https://docs.rcur.app",
        "version": "2.0.0"
    },
    "servers": [
        {
            "url": "https://rcur.app"
        }
    ],
    "paths": {
        "/api/v2/customers": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "List customers",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of customers",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Customer"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/customers?page=1"
                                                },
                                                "last": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/customers?page=3"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "https://rcur.app/api/v2/customers?page=2"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "from": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "path": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/customers"
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "to": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 42
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Customers"
                ],
                "summary": "Create customer",
                "requestBody": {
                    "description": "Customer data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "first_name",
                                    "last_name",
                                    "email"
                                ],
                                "properties": {
                                    "number": {
                                        "description": "Customer number",
                                        "type": "string",
                                        "example": "CUST-001"
                                    },
                                    "first_name": {
                                        "description": "First name",
                                        "type": "string",
                                        "example": "John"
                                    },
                                    "last_name": {
                                        "description": "Last name",
                                        "type": "string",
                                        "example": "Doe"
                                    },
                                    "email": {
                                        "description": "Email address",
                                        "type": "string",
                                        "example": "john@example.com"
                                    },
                                    "organization_name": {
                                        "description": "Organization name",
                                        "type": "string",
                                        "example": "Acme B.V."
                                    },
                                    "phone": {
                                        "description": "Phone number",
                                        "type": "string",
                                        "example": "+31612345678"
                                    },
                                    "address": {
                                        "description": "Street address",
                                        "type": "string",
                                        "example": "Keizersgracht 1"
                                    },
                                    "postal_code": {
                                        "description": "Postal code",
                                        "type": "string",
                                        "example": "1015AA"
                                    },
                                    "city": {
                                        "description": "City",
                                        "type": "string",
                                        "example": "Amsterdam"
                                    },
                                    "country": {
                                        "description": "ISO 3166-1 alpha-2 country code",
                                        "type": "string",
                                        "example": "NL"
                                    },
                                    "vat_number": {
                                        "description": "VAT number",
                                        "type": "string",
                                        "example": "NL123456789B01"
                                    },
                                    "locale": {
                                        "enum": [
                                            "nl",
                                            "en",
                                            "fr",
                                            "de",
                                            "es"
                                        ],
                                        "type": "string",
                                        "example": "nl"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Customer created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Customer"
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Customer details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Customer"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/customers/{id}": {
            "get": {
                "tags": [
                    "Customers"
                ],
                "summary": "Show customer",
                "responses": {
                    "200": {
                        "description": "Customer details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Customer"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Customers"
                ],
                "summary": "Update customer",
                "requestBody": {
                    "description": "Customer data to update",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "number": {
                                        "description": "Customer number",
                                        "type": "string",
                                        "example": "CUST-001"
                                    },
                                    "first_name": {
                                        "description": "First name",
                                        "type": "string",
                                        "example": "John"
                                    },
                                    "last_name": {
                                        "description": "Last name",
                                        "type": "string",
                                        "example": "Doe"
                                    },
                                    "email": {
                                        "description": "Email address",
                                        "type": "string",
                                        "example": "john@example.com"
                                    },
                                    "organization_name": {
                                        "description": "Organization name",
                                        "type": "string",
                                        "example": "Acme B.V."
                                    },
                                    "phone": {
                                        "description": "Phone number",
                                        "type": "string",
                                        "example": "+31612345678"
                                    },
                                    "address": {
                                        "description": "Street address",
                                        "type": "string",
                                        "example": "Keizersgracht 1"
                                    },
                                    "postal_code": {
                                        "description": "Postal code",
                                        "type": "string",
                                        "example": "1015AA"
                                    },
                                    "city": {
                                        "description": "City",
                                        "type": "string",
                                        "example": "Amsterdam"
                                    },
                                    "country": {
                                        "description": "ISO 3166-1 alpha-2 country code",
                                        "type": "string",
                                        "example": "NL"
                                    },
                                    "vat_number": {
                                        "description": "VAT number",
                                        "type": "string",
                                        "example": "NL123456789B01"
                                    },
                                    "locale": {
                                        "enum": [
                                            "nl",
                                            "en",
                                            "de",
                                            "fr",
                                            "es"
                                        ],
                                        "type": "string",
                                        "example": "nl"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Customer details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Customer"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Customers"
                ],
                "summary": "Delete customer",
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/customers/{customerId}/mandates": {
            "get": {
                "tags": [
                    "Mandates"
                ],
                "summary": "List mandates for customer",
                "parameters": [
                    {
                        "name": "customerId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of mandates",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Mandate"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Mandates"
                ],
                "summary": "Create mandate for customer",
                "parameters": [
                    {
                        "name": "customerId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Mandate data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "consumer_name",
                                    "consumer_account"
                                ],
                                "properties": {
                                    "consumer_name": {
                                        "description": "Consumer name",
                                        "type": "string",
                                        "example": "John Doe"
                                    },
                                    "consumer_account": {
                                        "description": "IBAN account number",
                                        "type": "string",
                                        "example": "NL55INGB0000000000"
                                    },
                                    "custom_mandate_reference": {
                                        "description": "Custom mandate reference",
                                        "type": "string",
                                        "example": "MY-REF-001"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Mandate details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Mandate"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/customers/{customerId}/mandates/{id}": {
            "get": {
                "tags": [
                    "Mandates"
                ],
                "summary": "Show mandate for customer",
                "parameters": [
                    {
                        "name": "customerId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Mandate details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Mandate"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Mandates"
                ],
                "summary": "Revoke mandate for customer",
                "parameters": [
                    {
                        "name": "customerId",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/follow-ups": {
            "get": {
                "tags": [
                    "Follow-ups"
                ],
                "summary": "List follow-ups",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of follow-ups",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Followup"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string"
                                                },
                                                "last": {
                                                    "type": "string"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 3
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/follow-ups/{id}": {
            "get": {
                "tags": [
                    "Follow-ups"
                ],
                "summary": "Show follow-up",
                "responses": {
                    "200": {
                        "description": "Follow-up details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Followup"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Follow-ups"
                ],
                "summary": "Update follow-up status",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "description": "Follow-up status update",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "status"
                                ],
                                "properties": {
                                    "status": {
                                        "description": "New status",
                                        "enum": [
                                            "pending",
                                            "failed",
                                            "solved"
                                        ],
                                        "type": "string",
                                        "example": "solved"
                                    },
                                    "resolution": {
                                        "description": "Only with status `solved`: whether the customer paid outside RCUR (`paid_manually`) or the amount is written off unpaid (`written_off`). Used by the recovery report; omit it if unknown.",
                                        "enum": [
                                            "paid_manually",
                                            "written_off"
                                        ],
                                        "type": "string",
                                        "nullable": true,
                                        "example": "paid_manually"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Follow-up details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Followup"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/links": {
            "get": {
                "tags": [
                    "Payment Links"
                ],
                "summary": "List payment links",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of payment links",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Link"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/links?page=1"
                                                },
                                                "last": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/links?page=2"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "https://rcur.app/api/v2/links?page=2"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "from": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "path": {
                                                    "type": "string",
                                                    "example": "https://rcur.app/api/v2/links"
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "to": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 23
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/links/{id}": {
            "get": {
                "tags": [
                    "Payment Links"
                ],
                "summary": "Show payment link",
                "responses": {
                    "200": {
                        "description": "Payment link details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Link"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "tags": [
                    "Payment Links"
                ],
                "summary": "Archive payment link",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/orders": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "List orders",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of orders",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Order"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string"
                                                },
                                                "last": {
                                                    "type": "string"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 10
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/orders/{id}": {
            "get": {
                "tags": [
                    "Orders"
                ],
                "summary": "Show order",
                "responses": {
                    "200": {
                        "description": "Order details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Order"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/payments": {
            "get": {
                "tags": [
                    "Payments"
                ],
                "summary": "List payments",
                "responses": {
                    "200": {
                        "description": "List of payments",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Payment"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Payments"
                ],
                "summary": "Create payment",
                "requestBody": {
                    "description": "Payment data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "amount",
                                    "currency",
                                    "mollie_customer_id",
                                    "description",
                                    "redirect_url"
                                ],
                                "properties": {
                                    "amount": {
                                        "description": "Payment amount",
                                        "type": "number",
                                        "example": 29.99
                                    },
                                    "currency": {
                                        "description": "Currency",
                                        "enum": [
                                            "AED",
                                            "AUD",
                                            "BGN",
                                            "BRL",
                                            "CAD",
                                            "CHF",
                                            "CZK",
                                            "DKK",
                                            "EUR",
                                            "GBP",
                                            "HKD",
                                            "HUF",
                                            "ILS",
                                            "ISK",
                                            "JPY",
                                            "MXN",
                                            "MYR",
                                            "NOK",
                                            "NZD",
                                            "PHP",
                                            "PLN",
                                            "RON",
                                            "SEK",
                                            "SGD",
                                            "THB",
                                            "TWD",
                                            "USD",
                                            "ZAR"
                                        ],
                                        "type": "string",
                                        "example": "EUR"
                                    },
                                    "method": {
                                        "description": "Payment method",
                                        "enum": [
                                            "ideal",
                                            "creditcard",
                                            "bancontact",
                                            "sofort",
                                            "eps",
                                            "giropay",
                                            "belfius",
                                            "kbc",
                                            "banktransfer"
                                        ],
                                        "type": "string",
                                        "example": "ideal"
                                    },
                                    "mollie_customer_id": {
                                        "description": "Mollie customer ID",
                                        "type": "string",
                                        "example": "cst_abc123"
                                    },
                                    "description": {
                                        "description": "Payment description",
                                        "type": "string",
                                        "example": "Order #2025-001"
                                    },
                                    "redirect_url": {
                                        "description": "URL to redirect after payment",
                                        "type": "string",
                                        "example": "https://example.com/thank-you"
                                    },
                                    "webhook_url": {
                                        "description": "Webhook URL for status updates",
                                        "type": "string",
                                        "example": "https://example.com/webhook"
                                    },
                                    "mollie_profile_id": {
                                        "description": "Mollie profile ID",
                                        "type": "string",
                                        "example": "pfl_abc123"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Payment created successfully",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaymentCreated"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/payments/{id}": {
            "get": {
                "tags": [
                    "Payments"
                ],
                "summary": "Show payment",
                "responses": {
                    "200": {
                        "description": "Payment details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Payment"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/products": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "List products",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of products",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Product"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string"
                                                },
                                                "last": {
                                                    "type": "string"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 6
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Products"
                ],
                "summary": "Create product",
                "requestBody": {
                    "description": "Product data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "type",
                                    "name",
                                    "amount",
                                    "vat"
                                ],
                                "properties": {
                                    "type": {
                                        "enum": [
                                            "once",
                                            "subscription",
                                            "shipping_costs"
                                        ],
                                        "type": "string",
                                        "example": "subscription"
                                    },
                                    "name": {
                                        "description": "Product name",
                                        "type": "string",
                                        "example": "Premium Plan"
                                    },
                                    "amount": {
                                        "description": "Product amount",
                                        "type": "number",
                                        "example": 29.99
                                    },
                                    "vat": {
                                        "description": "VAT percentage",
                                        "type": "number",
                                        "example": 21
                                    },
                                    "interval": {
                                        "description": "Interval (required for subscription type)",
                                        "enum": [
                                            "day",
                                            "week",
                                            "month",
                                            "year"
                                        ],
                                        "type": "string",
                                        "example": "month"
                                    },
                                    "interval_value": {
                                        "description": "Interval value (required for subscription type)",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "times": {
                                        "description": "Number of payments (null = infinite)",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "woocommerce_product_id": {
                                        "description": "WooCommerce product ID",
                                        "type": "integer",
                                        "example": 1234
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "201": {
                        "description": "Product created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Product"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/products/{id}": {
            "get": {
                "tags": [
                    "Products"
                ],
                "summary": "Show product",
                "responses": {
                    "200": {
                        "description": "Product details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Product"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Products"
                ],
                "summary": "Update product",
                "requestBody": {
                    "description": "Product data to update",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "description": "Product name",
                                        "type": "string",
                                        "example": "Premium Plan"
                                    },
                                    "amount": {
                                        "description": "Product amount",
                                        "type": "number",
                                        "example": 29.99
                                    },
                                    "vat": {
                                        "description": "VAT percentage",
                                        "type": "number",
                                        "example": 21
                                    },
                                    "interval": {
                                        "description": "Interval (required for subscription type)",
                                        "enum": [
                                            "day",
                                            "week",
                                            "month",
                                            "year"
                                        ],
                                        "type": "string",
                                        "example": "month"
                                    },
                                    "interval_value": {
                                        "description": "Interval value (required for subscription type)",
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "times": {
                                        "description": "Number of payments (null = infinite)",
                                        "type": "integer",
                                        "example": 12
                                    },
                                    "woocommerce_product_id": {
                                        "description": "WooCommerce product ID",
                                        "type": "integer",
                                        "example": 1234
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Product details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Product"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Products"
                ],
                "summary": "Delete product",
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/subscriptions": {
            "get": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "List subscriptions",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "Page number for pagination",
                        "required": false,
                        "schema": {
                            "default": 1,
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "List of subscriptions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Subscription"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": "string"
                                                },
                                                "last": {
                                                    "type": "string"
                                                },
                                                "prev": {
                                                    "type": "string",
                                                    "nullable": true
                                                },
                                                "next": {
                                                    "type": "string",
                                                    "nullable": true
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "example": 15
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "example": 5
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "Create subscription",
                "requestBody": {
                    "description": "Subscription data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "name",
                                    "customer_id",
                                    "mollie_profile_id",
                                    "mollie_mandate_id",
                                    "start_date",
                                    "rules"
                                ],
                                "properties": {
                                    "name": {
                                        "description": "Subscription name",
                                        "type": "string",
                                        "example": "Monthly Premium"
                                    },
                                    "customer_id": {
                                        "description": "Customer hash ID",
                                        "type": "string",
                                        "example": "abc123def456"
                                    },
                                    "mollie_profile_id": {
                                        "description": "Mollie profile ID",
                                        "type": "string",
                                        "example": "pfl_abc123"
                                    },
                                    "mollie_mandate_id": {
                                        "description": "Mollie mandate ID",
                                        "type": "string",
                                        "example": "mdt_abc123"
                                    },
                                    "customer_portal": {
                                        "description": "Can the customer pause and cancel this subscription in the customer portal: inherit follows the customer portal settings, allow and deny overrule them. Defaults to inherit",
                                        "enum": [
                                            "inherit",
                                            "allow",
                                            "deny"
                                        ],
                                        "type": "string",
                                        "example": "inherit"
                                    },
                                    "start_date": {
                                        "description": "Start date (Y-m-d)",
                                        "type": "string",
                                        "example": "2025-02-01"
                                    },
                                    "workflow_id": {
                                        "description": "Invoice workflow ID (required for Moneybird)",
                                        "type": "string",
                                        "example": "wf_123"
                                    },
                                    "docstyle_id": {
                                        "description": "Document style ID (required for Moneybird)",
                                        "type": "string",
                                        "example": "ds_123"
                                    },
                                    "rules": {
                                        "description": "Subscription rules",
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "amount": {
                                                    "description": "Amount per interval",
                                                    "type": "number",
                                                    "example": 29.99
                                                },
                                                "interval": {
                                                    "description": "Interval type",
                                                    "enum": [
                                                        "day",
                                                        "week",
                                                        "month",
                                                        "year"
                                                    ],
                                                    "type": "string",
                                                    "example": "month"
                                                },
                                                "interval_amount": {
                                                    "description": "Number of intervals",
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "day": {
                                                    "description": "Day of interval (0-365)",
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "times": {
                                                    "description": "Number of times (null = infinite)",
                                                    "type": "integer",
                                                    "example": 12
                                                },
                                                "invoice_rules": {
                                                    "description": "Invoice rules (when invoicing is enabled)",
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "quantity": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "description": {
                                                                "type": "string",
                                                                "example": "Monthly subscription fee"
                                                            },
                                                            "amount": {
                                                                "type": "number",
                                                                "example": 29.99
                                                            },
                                                            "vat": {
                                                                "type": "string",
                                                                "example": "21"
                                                            },
                                                            "ledger_account_id": {
                                                                "type": "string",
                                                                "example": "la_123"
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Subscription details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Subscription"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            }
        },
        "/api/v2/subscriptions/{id}": {
            "get": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "Show subscription",
                "responses": {
                    "200": {
                        "description": "Subscription details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Subscription"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "Update subscription",
                "requestBody": {
                    "description": "Subscription data to update",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "description": "Subscription name",
                                        "type": "string",
                                        "example": "Monthly Premium"
                                    },
                                    "mollie_profile_id": {
                                        "description": "Mollie profile ID",
                                        "type": "string",
                                        "example": "pfl_abc123"
                                    },
                                    "mollie_mandate_id": {
                                        "description": "Mollie mandate ID",
                                        "type": "string",
                                        "example": "mdt_abc123"
                                    },
                                    "customer_portal": {
                                        "description": "Can the customer pause and cancel this subscription in the customer portal: inherit follows the customer portal settings, allow and deny overrule them. Defaults to inherit",
                                        "enum": [
                                            "inherit",
                                            "allow",
                                            "deny"
                                        ],
                                        "type": "string",
                                        "example": "inherit"
                                    }
                                }
                            }
                        }
                    },
                    "required": true
                },
                "responses": {
                    "200": {
                        "description": "Subscription details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Subscription"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationError"
                    }
                }
            },
            "delete": {
                "tags": [
                    "Subscriptions"
                ],
                "summary": "Cancel subscription",
                "requestBody": {
                    "description": "Cancellation data",
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "cancel_at": {
                                        "description": "Date to cancel at (Y-m-d). If omitted or in the past, cancels immediately.",
                                        "type": "string",
                                        "example": "2025-12-31"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Subscription details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Subscription"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Resource not found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/organizations/me": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "summary": "Get current organization",
                "responses": {
                    "200": {
                        "description": "Organization details",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Organization"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/v2/organizations/mollie-profiles": {
            "get": {
                "tags": [
                    "Organization"
                ],
                "summary": "List Mollie profiles",
                "responses": {
                    "200": {
                        "description": "List of Mollie profiles",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/MollieProfile"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "Customer": {
                "type": "object",
                "required": [
                    "id",
                    "first_name",
                    "last_name",
                    "email",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "abc123def456"
                    },
                    "number": {
                        "type": "string",
                        "nullable": true,
                        "example": "CUST-001"
                    },
                    "first_name": {
                        "type": "string",
                        "example": "John"
                    },
                    "last_name": {
                        "type": "string",
                        "example": "Doe"
                    },
                    "email": {
                        "type": "string",
                        "example": "john@example.com"
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "example": "+31612345678"
                    },
                    "organization_name": {
                        "type": "string",
                        "nullable": true,
                        "example": "Acme B.V."
                    },
                    "address": {
                        "type": "string",
                        "nullable": true,
                        "example": "Keizersgracht 1"
                    },
                    "postal_code": {
                        "type": "string",
                        "nullable": true,
                        "example": "1015AA"
                    },
                    "city": {
                        "type": "string",
                        "nullable": true,
                        "example": "Amsterdam"
                    },
                    "country": {
                        "type": "string",
                        "nullable": true,
                        "example": "NL"
                    },
                    "vat_number": {
                        "type": "string",
                        "nullable": true,
                        "example": "NL123456789B01"
                    },
                    "locale": {
                        "enum": [
                            "nl",
                            "en",
                            "fr",
                            "de",
                            "es"
                        ],
                        "type": "string",
                        "nullable": true,
                        "example": "nl"
                    },
                    "mollie_customer_id": {
                        "type": "string",
                        "nullable": true,
                        "example": "cst_abc123"
                    },
                    "created_at": {
                        "type": "string",
                        "example": "2025-01-15 10:30:00"
                    }
                }
            },
            "Error": {
                "type": "object",
                "required": [
                    "status",
                    "error"
                ],
                "properties": {
                    "status": {
                        "type": "integer",
                        "example": 404
                    },
                    "error": {
                        "type": "string",
                        "example": "Resource not found"
                    }
                }
            },
            "Followup": {
                "type": "object",
                "required": [
                    "id",
                    "description",
                    "type",
                    "status",
                    "amount",
                    "currency",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "fu_abc123"
                    },
                    "description": {
                        "type": "string",
                        "example": "Failed payment for subscription"
                    },
                    "type": {
                        "enum": [
                            "both",
                            "link",
                            "retry"
                        ],
                        "type": "string",
                        "example": "retry"
                    },
                    "status": {
                        "enum": [
                            "pending",
                            "solved",
                            "failed"
                        ],
                        "type": "string",
                        "example": "pending"
                    },
                    "resolution": {
                        "description": "How a solved follow-up ended: `paid` through RCUR, `paid_manually` outside RCUR, or `written_off` unpaid. Null while not solved, or when unknown.",
                        "enum": [
                            "paid",
                            "paid_manually",
                            "written_off"
                        ],
                        "type": "string",
                        "nullable": true,
                        "example": "paid"
                    },
                    "amount": {
                        "type": "string",
                        "example": "29.99"
                    },
                    "currency": {
                        "enum": [
                            "AED",
                            "AUD",
                            "BGN",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CZK",
                            "DKK",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "ISK",
                            "JPY",
                            "MXN",
                            "MYR",
                            "NOK",
                            "NZD",
                            "PHP",
                            "PLN",
                            "RON",
                            "SEK",
                            "SGD",
                            "THB",
                            "TWD",
                            "USD",
                            "ZAR"
                        ],
                        "type": "string",
                        "example": "EUR"
                    },
                    "mollie_profile_id": {
                        "type": "string",
                        "nullable": true,
                        "example": "pfl_abc123"
                    },
                    "mollie_payment_id": {
                        "type": "string",
                        "nullable": true,
                        "example": "tr_abc123"
                    },
                    "reason": {
                        "type": "string",
                        "nullable": true,
                        "example": "Insufficient funds"
                    },
                    "reason_code": {
                        "type": "string",
                        "nullable": true,
                        "example": "AM04"
                    },
                    "retries_done": {
                        "type": "integer",
                        "example": 2
                    },
                    "mails_sent": {
                        "type": "integer",
                        "example": 1
                    },
                    "next_retry_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-02-01"
                    },
                    "created_at": {
                        "type": "string",
                        "example": "2025-01-15 10:30:00"
                    },
                    "customer": {
                        "type": "object",
                        "nullable": true
                    },
                    "subscription": {
                        "type": "object",
                        "nullable": true
                    },
                    "order": {
                        "type": "object",
                        "nullable": true
                    }
                }
            },
            "Link": {
                "type": "object",
                "required": [
                    "id",
                    "status",
                    "active",
                    "type",
                    "description",
                    "currency",
                    "created_at",
                    "url"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "lnk_abc123"
                    },
                    "status": {
                        "enum": [
                            "draft",
                            "open",
                            "paid",
                            "expired"
                        ],
                        "type": "string",
                        "example": "open"
                    },
                    "active": {
                        "type": "boolean",
                        "example": true
                    },
                    "type": {
                        "enum": [
                            "payment",
                            "approval",
                            "basic-subscription",
                            "advanced-subscription",
                            "order",
                            "mandate",
                            "debit"
                        ],
                        "type": "string",
                        "example": "payment"
                    },
                    "description": {
                        "type": "string",
                        "example": "Monthly subscription - Pro plan"
                    },
                    "currency": {
                        "enum": [
                            "AED",
                            "AUD",
                            "BGN",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CZK",
                            "DKK",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "ISK",
                            "JPY",
                            "MXN",
                            "MYR",
                            "NOK",
                            "NZD",
                            "PHP",
                            "PLN",
                            "RON",
                            "SEK",
                            "SGD",
                            "THB",
                            "TWD",
                            "USD",
                            "ZAR"
                        ],
                        "type": "string",
                        "example": "EUR"
                    },
                    "amount": {
                        "type": "string",
                        "example": "29.95"
                    },
                    "first_amount": {
                        "type": "string",
                        "nullable": true,
                        "example": "14.95"
                    },
                    "interval": {
                        "enum": [
                            "week",
                            "month",
                            "quarter",
                            "year"
                        ],
                        "type": "string",
                        "nullable": true,
                        "example": "month"
                    },
                    "times": {
                        "type": "integer",
                        "nullable": true,
                        "example": 12
                    },
                    "trial_interval": {
                        "type": "string",
                        "nullable": true,
                        "example": "14 days"
                    },
                    "reminder_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-02-01 09:00:00"
                    },
                    "redirect_url_paid": {
                        "type": "string",
                        "nullable": true,
                        "example": "https://example.com/thank-you"
                    },
                    "redirect_url_failed": {
                        "type": "string",
                        "nullable": true,
                        "example": "https://example.com/failed"
                    },
                    "expires_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-06-01"
                    },
                    "created_at": {
                        "type": "string",
                        "example": "2025-01-15 10:30:00"
                    },
                    "url": {
                        "type": "string",
                        "example": "https://rcur.nl/pay/lnk_abc123"
                    },
                    "customer": {
                        "$ref": "#/components/schemas/Customer"
                    },
                    "subscription": {
                        "$ref": "#/components/schemas/Subscription"
                    }
                }
            },
            "Mandate": {
                "type": "object",
                "required": [
                    "id",
                    "method",
                    "status",
                    "details"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "mdt_abc123"
                    },
                    "method": {
                        "enum": [
                            "directdebit",
                            "creditcard"
                        ],
                        "type": "string",
                        "example": "directdebit"
                    },
                    "status": {
                        "enum": [
                            "valid",
                            "invalid",
                            "pending"
                        ],
                        "type": "string",
                        "example": "valid"
                    },
                    "custom_mandate_reference": {
                        "type": "string",
                        "nullable": true,
                        "example": "MY-REF-001"
                    },
                    "signature_date": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-01-15"
                    },
                    "details": {
                        "type": "object",
                        "properties": {
                            "consumer_name": {
                                "type": "string",
                                "nullable": true,
                                "example": "John Doe"
                            },
                            "consumer_account": {
                                "type": "string",
                                "nullable": true,
                                "example": "NL55INGB0000000000"
                            },
                            "consumer_bic": {
                                "type": "string",
                                "nullable": true,
                                "example": "INGBNL2A"
                            },
                            "card_holder": {
                                "type": "string",
                                "nullable": true,
                                "example": "J. Doe"
                            },
                            "card_number": {
                                "type": "string",
                                "nullable": true,
                                "example": "6787"
                            },
                            "card_expiry_date": {
                                "type": "string",
                                "nullable": true,
                                "example": "2028-12-31"
                            },
                            "card_label": {
                                "type": "string",
                                "nullable": true,
                                "example": "Mastercard"
                            },
                            "card_fingerprint": {
                                "type": "string",
                                "nullable": true,
                                "example": "Fh94dX2V"
                            }
                        }
                    }
                }
            },
            "MollieProfile": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "status",
                    "mode"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "pfl_abc123"
                    },
                    "name": {
                        "type": "string",
                        "example": "Acme Store"
                    },
                    "website": {
                        "type": "string",
                        "nullable": true,
                        "example": "https://acme.nl"
                    },
                    "email": {
                        "type": "string",
                        "nullable": true,
                        "example": "info@acme.nl"
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "example": "+31208202070"
                    },
                    "status": {
                        "enum": [
                            "unverified",
                            "verified",
                            "blocked"
                        ],
                        "type": "string",
                        "example": "verified"
                    },
                    "mode": {
                        "enum": [
                            "live",
                            "test"
                        ],
                        "type": "string",
                        "example": "live"
                    }
                }
            },
            "OrderProduct": {
                "type": "object",
                "required": [
                    "quantity",
                    "product"
                ],
                "properties": {
                    "next_order": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-02-01"
                    },
                    "quantity": {
                        "type": "integer",
                        "example": 2
                    },
                    "product": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "example": "prod_abc123"
                            },
                            "name": {
                                "type": "string",
                                "example": "Premium Plan"
                            },
                            "type": {
                                "enum": [
                                    "once",
                                    "subscription",
                                    "shipping_costs"
                                ],
                                "type": "string",
                                "example": "subscription"
                            },
                            "amount": {
                                "type": "string",
                                "example": "29.99"
                            },
                            "currency": {
                                "enum": [
                                    "AED",
                                    "AUD",
                                    "BGN",
                                    "BRL",
                                    "CAD",
                                    "CHF",
                                    "CZK",
                                    "DKK",
                                    "EUR",
                                    "GBP",
                                    "HKD",
                                    "HUF",
                                    "ILS",
                                    "ISK",
                                    "JPY",
                                    "MXN",
                                    "MYR",
                                    "NOK",
                                    "NZD",
                                    "PHP",
                                    "PLN",
                                    "RON",
                                    "SEK",
                                    "SGD",
                                    "THB",
                                    "TWD",
                                    "USD",
                                    "ZAR"
                                ],
                                "type": "string",
                                "example": "EUR"
                            },
                            "interval": {
                                "enum": [
                                    "day",
                                    "week",
                                    "month",
                                    "year"
                                ],
                                "type": "string",
                                "nullable": true,
                                "example": "month"
                            },
                            "times": {
                                "type": "integer",
                                "nullable": true,
                                "example": 12
                            },
                            "wc_product_id": {
                                "type": "integer",
                                "nullable": true,
                                "example": 1234
                            }
                        }
                    }
                }
            },
            "Order": {
                "type": "object",
                "required": [
                    "id",
                    "status",
                    "total_amount",
                    "currency",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "ord_abc123"
                    },
                    "order_number": {
                        "type": "string",
                        "nullable": true,
                        "example": "ORD-2025-001"
                    },
                    "status": {
                        "enum": [
                            "unpaid",
                            "pending",
                            "paid",
                            "completed",
                            "charged_back",
                            "cancelled"
                        ],
                        "type": "string",
                        "example": "paid"
                    },
                    "first_name": {
                        "type": "string",
                        "example": "John"
                    },
                    "last_name": {
                        "type": "string",
                        "example": "Doe"
                    },
                    "email": {
                        "type": "string",
                        "example": "john@example.com"
                    },
                    "organization_name": {
                        "type": "string",
                        "nullable": true,
                        "example": "Acme B.V."
                    },
                    "phone": {
                        "type": "string",
                        "nullable": true,
                        "example": "+31612345678"
                    },
                    "address": {
                        "type": "string",
                        "nullable": true,
                        "example": "Keizersgracht 1"
                    },
                    "postal_code": {
                        "type": "string",
                        "nullable": true,
                        "example": "1015AA"
                    },
                    "city": {
                        "type": "string",
                        "nullable": true,
                        "example": "Amsterdam"
                    },
                    "country": {
                        "description": "ISO 3166-1 alpha-2 country code",
                        "type": "string",
                        "nullable": true,
                        "example": "NL"
                    },
                    "vat_number": {
                        "type": "string",
                        "nullable": true,
                        "example": "NL123456789B01"
                    },
                    "carrier": {
                        "type": "string",
                        "nullable": true,
                        "example": "PostNL"
                    },
                    "tracktrace": {
                        "type": "string",
                        "nullable": true,
                        "example": "3STEST1234567"
                    },
                    "wc_order_id": {
                        "type": "integer",
                        "nullable": true,
                        "example": 5678
                    },
                    "wc_order_number": {
                        "type": "string",
                        "nullable": true,
                        "example": "WC-5678"
                    },
                    "subscription": {
                        "type": "string",
                        "nullable": true,
                        "example": "sub_abc123"
                    },
                    "subscription_status": {
                        "enum": [
                            "active",
                            "cancelled",
                            "completed"
                        ],
                        "type": "string",
                        "nullable": true,
                        "example": "active"
                    },
                    "cancel_subscription_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-12-31"
                    },
                    "total_amount": {
                        "type": "string",
                        "example": "59.98"
                    },
                    "currency": {
                        "enum": [
                            "AED",
                            "AUD",
                            "BGN",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CZK",
                            "DKK",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "ISK",
                            "JPY",
                            "MXN",
                            "MYR",
                            "NOK",
                            "NZD",
                            "PHP",
                            "PLN",
                            "RON",
                            "SEK",
                            "SGD",
                            "THB",
                            "TWD",
                            "USD",
                            "ZAR"
                        ],
                        "type": "string",
                        "example": "EUR"
                    },
                    "created_at": {
                        "type": "string",
                        "example": "2025-01-15 10:30:00"
                    },
                    "products": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/OrderProduct"
                        }
                    }
                }
            },
            "Organization": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "email"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "org_abc123"
                    },
                    "name": {
                        "type": "string",
                        "example": "Acme B.V."
                    },
                    "email": {
                        "type": "string",
                        "example": "info@acme.nl"
                    },
                    "mollie_organization_id": {
                        "type": "string",
                        "nullable": true,
                        "example": "org_12345678"
                    }
                }
            },
            "PaymentCreated": {
                "type": "object",
                "required": [
                    "id",
                    "mollie_payment_id",
                    "status",
                    "mollie_checkout_url"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "pay_abc123"
                    },
                    "mollie_payment_id": {
                        "type": "string",
                        "example": "tr_abc123"
                    },
                    "status": {
                        "enum": [
                            "open",
                            "pending"
                        ],
                        "type": "string",
                        "example": "open"
                    },
                    "mollie_checkout_url": {
                        "type": "string",
                        "example": "https://www.mollie.com/checkout/test-mode?method=ideal&token=abc123"
                    }
                }
            },
            "Payment": {
                "type": "object",
                "required": [
                    "id",
                    "mollie_payment_id",
                    "mollie_payment_status"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "pay_abc123"
                    },
                    "mollie_payment_id": {
                        "type": "string",
                        "example": "tr_abc123"
                    },
                    "mollie_payment_status": {
                        "enum": [
                            "open",
                            "canceled",
                            "pending",
                            "authorized",
                            "expired",
                            "failed",
                            "paid"
                        ],
                        "type": "string",
                        "example": "paid"
                    },
                    "webhook_url": {
                        "type": "string",
                        "nullable": true,
                        "example": "https://example.com/webhook"
                    }
                }
            },
            "Product": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "type",
                    "amount",
                    "currency"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "prod_abc123"
                    },
                    "name": {
                        "type": "string",
                        "example": "Premium Plan"
                    },
                    "type": {
                        "enum": [
                            "once",
                            "subscription",
                            "shipping_costs"
                        ],
                        "type": "string",
                        "example": "subscription"
                    },
                    "amount": {
                        "type": "string",
                        "example": "29.99"
                    },
                    "currency": {
                        "type": "string",
                        "example": "EUR"
                    },
                    "interval": {
                        "type": "string",
                        "nullable": true,
                        "example": "month"
                    },
                    "times": {
                        "type": "integer",
                        "nullable": true,
                        "example": 12
                    },
                    "wc_product_id": {
                        "type": "integer",
                        "nullable": true,
                        "example": 1234
                    }
                }
            },
            "SubscriptionRule": {
                "type": "object",
                "required": [
                    "id",
                    "amount",
                    "currency",
                    "interval",
                    "interval_amount",
                    "day",
                    "times_done"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "rule_abc123"
                    },
                    "amount": {
                        "type": "string",
                        "example": "29.99"
                    },
                    "currency": {
                        "enum": [
                            "AED",
                            "AUD",
                            "BGN",
                            "BRL",
                            "CAD",
                            "CHF",
                            "CZK",
                            "DKK",
                            "EUR",
                            "GBP",
                            "HKD",
                            "HUF",
                            "ILS",
                            "ISK",
                            "JPY",
                            "MXN",
                            "MYR",
                            "NOK",
                            "NZD",
                            "PHP",
                            "PLN",
                            "RON",
                            "SEK",
                            "SGD",
                            "THB",
                            "TWD",
                            "USD",
                            "ZAR"
                        ],
                        "type": "string",
                        "example": "EUR"
                    },
                    "interval": {
                        "enum": [
                            "day",
                            "week",
                            "month",
                            "year"
                        ],
                        "type": "string",
                        "example": "month"
                    },
                    "interval_amount": {
                        "type": "integer",
                        "example": 1
                    },
                    "day": {
                        "type": "integer",
                        "example": 1
                    },
                    "times": {
                        "type": "integer",
                        "nullable": true,
                        "example": 12
                    },
                    "times_done": {
                        "type": "integer",
                        "example": 3
                    }
                }
            },
            "Subscription": {
                "type": "object",
                "required": [
                    "id",
                    "name",
                    "status",
                    "start_date",
                    "created_at"
                ],
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "sub_abc123"
                    },
                    "name": {
                        "type": "string",
                        "example": "Monthly Premium"
                    },
                    "status": {
                        "enum": [
                            "draft",
                            "active",
                            "paused",
                            "cancelled",
                            "completed"
                        ],
                        "type": "string",
                        "example": "active"
                    },
                    "start_date": {
                        "type": "string",
                        "example": "2025-01-01"
                    },
                    "mollie_mandate_id": {
                        "type": "string",
                        "example": "mdt_abc123"
                    },
                    "mollie_profile_id": {
                        "type": "string",
                        "example": "pfl_abc123"
                    },
                    "next_payment_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-02-01"
                    },
                    "next_amount": {
                        "type": "string",
                        "nullable": true,
                        "example": "29.99"
                    },
                    "last_payment_created_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-01-01 10:00:00"
                    },
                    "resume_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-03-01"
                    },
                    "cancel_at": {
                        "type": "string",
                        "nullable": true,
                        "example": "2025-12-31"
                    },
                    "customer_portal": {
                        "description": "Can the customer pause and cancel this subscription in the customer portal: inherit follows the customer portal settings, allow and deny overrule them",
                        "enum": [
                            "inherit",
                            "allow",
                            "deny"
                        ],
                        "type": "string",
                        "example": "inherit"
                    },
                    "created_at": {
                        "type": "string",
                        "example": "2025-01-01 10:00:00"
                    },
                    "rules": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/SubscriptionRule"
                        }
                    },
                    "customer": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "string"
                        }
                    }
                }
            },
            "ValidationError": {
                "type": "object",
                "required": [
                    "status",
                    "error"
                ],
                "properties": {
                    "status": {
                        "type": "integer",
                        "example": 422
                    },
                    "error": {
                        "type": "string",
                        "example": "Could not process request. Some fields contain invalid data"
                    },
                    "fields": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "example": {
                            "email": [
                                "The email field is required."
                            ]
                        }
                    }
                }
            }
        },
        "responses": {
            "ValidationError": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ValidationError"
                        }
                    }
                }
            }
        },
        "securitySchemes": {
            "BearerToken": {
                "type": "http",
                "description": "API key from the integrations page in RCUR, sent as `Authorization: Bearer <key>`.",
                "scheme": "bearer"
            }
        }
    },
    "security": [
        {
            "BearerToken": []
        }
    ],
    "tags": [
        {
            "name": "Customers",
            "description": "The people and companies you collect payments from."
        },
        {
            "name": "Payment Links",
            "description": "Shareable links where customers pay once or sign up for a subscription."
        },
        {
            "name": "Subscriptions",
            "description": "Recurring payments on a schedule, charged through Mollie."
        },
        {
            "name": "Follow-ups",
            "description": "Automatic retries and reminders for payments that failed."
        },
        {
            "name": "Orders",
            "description": "Orders placed through payment links and subscriptions."
        },
        {
            "name": "Payments",
            "description": "Individual payments, including one-off charges on a mandate."
        },
        {
            "name": "Mandates",
            "description": "Permissions to charge a customer's bank account or card."
        },
        {
            "name": "Products",
            "description": "The products you sell, with their price and VAT."
        },
        {
            "name": "Organization",
            "description": "Your own RCUR account and its Mollie profiles."
        }
    ]
}