openapi: 3.0.3
info:
    title: 'Zanifu API'
    description: ''
    version: 1.0.0
servers:
    -
        url: 'https://development.zanifu.com'
paths:
    /api/login:
        post:
            summary: 'Validate user credentials'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
            requestBody:
                required: false
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                key:
                                    type: string
                                    description: 'This can also be email|phone'
                                    example: labore
                                email:
                                    type: string
                                    description: 'This can also be phone|key'
                                    example: omnis
                                phone:
                                    type: string
                                    description: 'This can also be email|key'
                                    example: quia
                                password:
                                    type: string
                                    description: 'This can also be secret'
                                    example: harum
                                secret:
                                    type: string
                                    description: 'This can also be password'
                                    example: et
            security: []
    /api/sign-up:
        post:
            summary: 'Register new distributor'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
            requestBody:
                required: false
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                account_type:
                                    type: integer
                                    description: ''
                                    example: 12
                                name:
                                    type: string
                                    description: 'Distributor Name'
                                    example: illum
                                phone:
                                    type: string
                                    description: 'Distributor Phone number'
                                    example: voluptatibus
                                email:
                                    type: string
                                    description: 'Distributor Email'
                                    example: temporibus
            security: []
    /api/password-reset:
        post:
            summary: 'Initiate a password reset request'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                email:
                                    type: string
                                    description: 'Distributor Email'
                                    example: aut
                            required:
                                - email
            security: []
    /api/reset-password:
        post:
            summary: 'Complete password reset'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                email:
                                    type: string
                                    description: 'Distributor Email'
                                    example: dolorum
                                token:
                                    type: string
                                    description: 'Generated token from email'
                                    example: nihil
                                new_password:
                                    type: string
                                    description: 'New password'
                                    example: rerum
                            required:
                                - email
                                - token
                                - new_password
            security: []
    /api/change-password:
        post:
            summary: 'Change the current user password'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                current_password:
                                    type: string
                                    description: 'Current user password'
                                    example: qui
                                new_password:
                                    type: string
                                    description: 'New user password'
                                    example: et
                            required:
                                - current_password
                                - new_password
    /api/logout:
        post:
            summary: 'Log out the distributor.'
            description: 'Remove current distributor token'
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Authentication
    /api/carts:
        get:
            summary: 'List carts'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Cart
    '/api/carts/{cart}':
        get:
            summary: 'Get single cart details'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Cart
        parameters:
            -
                in: path
                name: cart
                description: 'Cart id'
                example: 3
                required: true
                schema:
                    type: integer
    /api/categories:
        get:
            summary: 'List of categories'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                200:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    data: [{ id: 1, name: Bakeries }, { id: 2, name: 'Barber and Beauty Shops' }, { id: 3, name: 'Butchery and Meat supplies' }, { id: 4, name: 'Book Stores' }, { id: 5, name: 'Carwash and Dry Cleaners' }, { id: 6, name: 'Chemicals and Allied Products' }, { id: 7, name: 'Children’s and Infant’s Wear Stores' }, { id: 8, name: 'Cigar Stores and suppliers' }, { id: 9, name: 'Commercial Footwear' }, { id: 10, name: 'Computers, Computer Peripheral Equipment, Software' }, { id: 11, name: 'Dairy Products Stores' }, { id: 12, name: 'Drinking Places (Alcoholic Beverages), Bars, Taverns, Cocktail lounges, Nightclubs and Discotheques' }, { id: 13, name: 'Drug Stores and Pharmacies' }, { id: 14, name: 'Eating places and Restaurants' }, { id: 15, name: 'Electrical Parts and Equipment' }, { id: 16, name: 'Fast Food Restaurants' }, { id: 17, name: 'Florists’ Supplies, Nursery Stock and Flowers' }, { id: 18, name: 'Glassware/Crystal Stores' }, { id: 19, name: 'Hardware Stores' }, { id: 20, name: 'Health and Beauty Shops' }, { id: 21, name: 'Household Appliance Stores' }, { id: 22, name: 'Industrial Supplies' }, { id: 23, name: 'Medical, Dental Ophthalmic, Hospital Equipment and Supplies' }, { id: 24, name: 'Men’s Women’s and Children’s Uniforms and Commercial Clothing' }, { id: 25, name: 'Misc. General Merchandise' }, { id: 26, name: 'Motorcycle Dealers' }, { id: 27, name: 'Motor vehicle supplies and new parts' }, { id: 28, name: 'Package Stores - Beer, Wine, and Liquor' }, { id: 29, name: 'Paints, Varnishes, and Supplies' }, { id: 30, name: 'Petroleum and Petroleum Products' }, { id: 31, name: 'Phones and Electronic Sales' }, { id: 32, name: 'Plumbing and Heating Equipment and Supplies' }, { id: 33, name: 'Sports Apparel Stores' }, { id: 34, name: 'Stationery, Office Supplies, Printing, and Writing Paper' }, { id: 35, name: Supermarkets }, { id: 36, name: 'Welding and Repair' }]
                                properties:
                                    data: { type: array, example: [{ id: 1, name: Bakeries }, { id: 2, name: 'Barber and Beauty Shops' }, { id: 3, name: 'Butchery and Meat supplies' }, { id: 4, name: 'Book Stores' }, { id: 5, name: 'Carwash and Dry Cleaners' }, { id: 6, name: 'Chemicals and Allied Products' }, { id: 7, name: 'Children’s and Infant’s Wear Stores' }, { id: 8, name: 'Cigar Stores and suppliers' }, { id: 9, name: 'Commercial Footwear' }, { id: 10, name: 'Computers, Computer Peripheral Equipment, Software' }, { id: 11, name: 'Dairy Products Stores' }, { id: 12, name: 'Drinking Places (Alcoholic Beverages), Bars, Taverns, Cocktail lounges, Nightclubs and Discotheques' }, { id: 13, name: 'Drug Stores and Pharmacies' }, { id: 14, name: 'Eating places and Restaurants' }, { id: 15, name: 'Electrical Parts and Equipment' }, { id: 16, name: 'Fast Food Restaurants' }, { id: 17, name: 'Florists’ Supplies, Nursery Stock and Flowers' }, { id: 18, name: 'Glassware/Crystal Stores' }, { id: 19, name: 'Hardware Stores' }, { id: 20, name: 'Health and Beauty Shops' }, { id: 21, name: 'Household Appliance Stores' }, { id: 22, name: 'Industrial Supplies' }, { id: 23, name: 'Medical, Dental Ophthalmic, Hospital Equipment and Supplies' }, { id: 24, name: 'Men’s Women’s and Children’s Uniforms and Commercial Clothing' }, { id: 25, name: 'Misc. General Merchandise' }, { id: 26, name: 'Motorcycle Dealers' }, { id: 27, name: 'Motor vehicle supplies and new parts' }, { id: 28, name: 'Package Stores - Beer, Wine, and Liquor' }, { id: 29, name: 'Paints, Varnishes, and Supplies' }, { id: 30, name: 'Petroleum and Petroleum Products' }, { id: 31, name: 'Phones and Electronic Sales' }, { id: 32, name: 'Plumbing and Heating Equipment and Supplies' }, { id: 33, name: 'Sports Apparel Stores' }, { id: 34, name: 'Stationery, Office Supplies, Printing, and Writing Paper' }, { id: 35, name: Supermarkets }, { id: 36, name: 'Welding and Repair' }], items: { type: object } }
            tags:
                - Categories
            security: []
    '/api/tills/{till}':
        get:
            summary: 'Get till details'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Checkout
        parameters:
            -
                in: path
                name: till
                description: 'Till Number'
                example: 6
                required: true
                schema:
                    type: integer
    /api/checkout:
        post:
            summary: Checkout
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Checkout
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                payment_method:
                                    type: string
                                    description: 'Payment Method (mpesa, zanifu_credit, pay_later)'
                                    example: mpesa
                                till:
                                    type: integer
                                    description: 'Distributor Till Number'
                                    example: 12345
                                phone_number:
                                    type: string
                                    description: 'Alternative Phone Number'
                                    example: '+254123456789'
                                products:
                                    type: array
                                    description: 'Products selected for payment'
                                    example: [[], []]
                                    items: { type: object, properties: { id: { type: integer, description: '', example: 13 }, quantity: { type: integer, description: '', example: 5 } }, required: [id, quantity] }
                            required:
                                - payment_method
                                - till
                                - products
    /api/customers:
        get:
            summary: 'Customer summary per region'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 18
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 18
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 19
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 19
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: velit
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: velit
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Customers
    '/api/customers/{customer}/transactions':
        get:
            summary: 'Customer transactions'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 12
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 12
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 18
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 18
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Customers
        parameters:
            -
                in: path
                name: customer
                description: 'Customer ID'
                example: 19
                required: true
                schema:
                    type: integer
    '/api/customers/{region}':
        get:
            summary: 'Customers in a region'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 5
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 5
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 18
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 18
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: quam
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: quam
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Customers
        parameters:
            -
                in: path
                name: region
                description: 'Region ID'
                example: 1
                required: true
                schema:
                    type: integer
    /api/dashboard:
        get:
            summary: 'Distributor dashboard'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filters[period]'
                    description: 'Filter by transaction period'
                    example: monthly
                    required: false
                    schema:
                        type: string
                        description: 'Filter by transaction period'
                        example: monthly
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/sales:
        get:
            summary: 'Sales summary'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filters[period]'
                    description: 'Filter by transaction period'
                    example: monthly
                    required: false
                    schema:
                        type: string
                        description: 'Filter by transaction period'
                        example: monthly
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/stock-credit:
        get:
            summary: 'Stock credit summary'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filters[period]'
                    description: 'Filter by transaction period'
                    example: monthly
                    required: false
                    schema:
                        type: string
                        description: 'Filter by transaction period'
                        example: monthly
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/finance/stock-credit:
        get:
            summary: 'Stock credit details'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 12
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 12
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 18
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 18
                -
                    in: query
                    name: 'filter[start_date]'
                    description: 'date Filter start date'
                    example: '2021-06-01'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter start date'
                        example: '2021-06-01'
                -
                    in: query
                    name: 'filter[end_date]'
                    description: 'date Filter end date'
                    example: '2021-06-30'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter end date'
                        example: '2021-06-30'
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: rerum
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: rerum
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/finance/stock-credit/export:
        get:
            summary: 'Export credit sales'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filter[start_date]'
                    description: 'date Filter start date'
                    example: '2021-06-01'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter start date'
                        example: '2021-06-01'
                -
                    in: query
                    name: 'filter[end_date]'
                    description: 'date Filter end date'
                    example: '2021-06-30'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter end date'
                        example: '2021-06-30'
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: illo
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: illo
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/finance/sales:
        get:
            summary: 'Sales details'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 17
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 17
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 10
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 10
                -
                    in: query
                    name: 'filter[start_date]'
                    description: 'date Filter start date'
                    example: '2021-06-01'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter start date'
                        example: '2021-06-01'
                -
                    in: query
                    name: 'filter[end_date]'
                    description: 'date Filter end date'
                    example: '2021-06-30'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter end date'
                        example: '2021-06-30'
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: aut
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: aut
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    /api/orders:
        get:
            summary: 'List of orders'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 12
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 12
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 6
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 6
                -
                    in: query
                    name: 'filter[start_date]'
                    description: 'date Filter start date'
                    example: '2021-06-01'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter start date'
                        example: '2021-06-01'
                -
                    in: query
                    name: 'filter[end_date]'
                    description: 'date Filter end date'
                    example: '2021-06-30'
                    required: false
                    schema:
                        type: string
                        description: 'date Filter end date'
                        example: '2021-06-30'
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: et
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: et
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Endpoints
    '/api/orders/{order}':
        patch:
            summary: ''
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Endpoints
            security: []
        parameters:
            -
                in: path
                name: order
                description: ''
                example: et
                required: true
                schema:
                    type: string
    /api/loans:
        get:
            summary: 'All user loans'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Loans
        post:
            summary: 'Make Loan Payment'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Loans
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                amount:
                                    type: string
                                    description: 'Amount being paid'
                                    example: '2'
                                phone_number:
                                    type: string
                                    description: 'Alternative Phone Number'
                                    example: '+254123456789'
                            required:
                                - amount
    /api/loans/limit:
        get:
            summary: 'Check loan limit'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Loans
    /api/merchants:
        post:
            summary: 'Register a new merchant.'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                phone_number:
                                    type: string
                                    description: ''
                                    example: vel
                                pin:
                                    type: string
                                    description: ''
                                    example: rerum
                                category_id:
                                    type: string
                                    description: ''
                                    example: explicabo
                            required:
                                - phone_number
                                - pin
                                - category_id
            security: []
    '/api/merchants{merchant}':
        put:
            summary: 'Update merchant details.'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                merchant_name:
                                    type: string
                                    description: ''
                                    example: omnis
                                business_name:
                                    type: string
                                    description: ''
                                    example: aut
                                email:
                                    type: string
                                    description: ''
                                    example: eligendi
                                location:
                                    type: string
                                    description: ''
                                    example: cupiditate
                            required:
                                - merchant_name
                                - business_name
                                - email
                                - location
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 15
                required: true
                schema:
                    type: integer
    '/api/merchants/{merchant}/application':
        get:
            summary: 'Get application status.'
            description: ''
            parameters:
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Merchants
            security: []
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 6
                required: true
                schema:
                    type: integer
    '/api/merchants/{merchant}/national-id':
        post:
            summary: 'Upload merchant ID'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: multipart/form-data
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    multipart/form-data:
                        schema:
                            type: object
                            properties:
                                front:
                                    type: string
                                    format: binary
                                    description: ''
                                back:
                                    type: string
                                    format: binary
                                    description: ''
                            required:
                                - front
                                - back
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 10
                required: true
                schema:
                    type: integer
    '/api/merchants/{merchant}/business-permit':
        post:
            summary: 'Upload business permit'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: multipart/form-data
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    multipart/form-data:
                        schema:
                            type: object
                            properties:
                                business_permit:
                                    type: string
                                    format: binary
                                    description: ''
                            required:
                                - business_permit
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 4
                required: true
                schema:
                    type: integer
    '/api/merchants/{merchant}/mpesa-statement':
        post:
            summary: 'Upload mpesa statement'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: multipart/form-data
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    multipart/form-data:
                        schema:
                            type: object
                            properties:
                                business_permit:
                                    type: string
                                    format: binary
                                    description: ''
                            required:
                                - business_permit
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 14
                required: true
                schema:
                    type: integer
    '/api/merchants/{merchant}/other-documents':
        post:
            summary: 'Upload other files'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: multipart/form-data
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Merchants
            requestBody:
                required: true
                content:
                    multipart/form-data:
                        schema:
                            type: object
                            properties:
                                'files[]':
                                    type: string
                                    format: binary
                                    description: ''
                            required:
                                - 'files[]'
        parameters:
            -
                in: path
                name: merchant
                description: ''
                example: 18
                required: true
                schema:
                    type: integer
    /api/products:
        get:
            summary: 'List of products'
            description: ''
            parameters:
                -
                    in: query
                    name: 'filter[category]'
                    description: 'Filter by category'
                    example: 4
                    required: false
                    schema:
                        type: integer
                        description: 'Filter by category'
                        example: 4
                -
                    in: query
                    name: 'filter[distributor]'
                    description: 'Filter by distributor'
                    example: 2
                    required: false
                    schema:
                        type: integer
                        description: 'Filter by distributor'
                        example: 2
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 19
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 19
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 20
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 20
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: rerum
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: rerum
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Products
        post:
            summary: 'Add a new product'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Products
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                title:
                                    type: string
                                    description: 'Product Title'
                                    example: nam
                                description:
                                    type: string
                                    description: 'Product description'
                                    example: fugit
                                price:
                                    type: integer
                                    description: 'Product price'
                                    example: 11
                                distributor_id:
                                    type: integer
                                    description: 'Product distributor'
                                    example: 1
                                category_id:
                                    type: integer
                                    description: 'Product category'
                                    example: 13
                            required:
                                - title
                                - price
                                - distributor_id
                                - category_id
    '/api/products/{product}':
        get:
            summary: 'Get single product details'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Products
        put:
            summary: 'Update a product'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Products
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                title:
                                    type: string
                                    description: 'Product Title'
                                    example: sit
                                description:
                                    type: string
                                    description: 'Product description'
                                    example: facere
                                price:
                                    type: integer
                                    description: 'Product price'
                                    example: 6
                                distributor_id:
                                    type: integer
                                    description: 'Product distributor'
                                    example: 3
                                category_id:
                                    type: integer
                                    description: 'Product category'
                                    example: 4
                            required:
                                - title
                                - price
                                - distributor_id
                                - category_id
        delete:
            summary: 'Delete a product'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Products
        parameters:
            -
                in: path
                name: product
                description: 'Product id'
                example: 5
                required: true
                schema:
                    type: integer
    /api/users:
        get:
            summary: 'Show all users'
            description: ''
            parameters:
                -
                    in: query
                    name: 'page[number]'
                    description: 'Page number'
                    example: 9
                    required: false
                    schema:
                        type: integer
                        description: 'Page number'
                        example: 9
                -
                    in: query
                    name: 'page[size]'
                    description: 'Number of records on a page'
                    example: 6
                    required: false
                    schema:
                        type: integer
                        description: 'Number of records on a page'
                        example: 6
                -
                    in: query
                    name: 'filter[search]'
                    description: 'Filter by query'
                    example: et
                    required: false
                    schema:
                        type: string
                        description: 'Filter by query'
                        example: et
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Users
        post:
            summary: 'Create a new user'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Users
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                first_name:
                                    type: string
                                    description: 'User''s first name'
                                    example: autem
                                last_name:
                                    type: string
                                    description: 'User''s last name'
                                    example: labore
                                email:
                                    type: string
                                    description: 'User''s email'
                                    example: aut
                                phone_number:
                                    type: string
                                    description: 'User''s phone number'
                                    example: adipisci
                                is_admin:
                                    type: boolean
                                    description: 'If user is an admin'
                                    example: false
                                permissions:
                                    type: array
                                    description: 'Permissions for non admin'
                                    example: '[''sales'',''orders'']'
                            required:
                                - first_name
                                - last_name
                                - email
                                - phone_number
                                - is_admin
    '/api/users/{user}':
        get:
            summary: 'Get single user details'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses:
                401:
                    description: ''
                    content:
                        application/json:
                            schema:
                                type: object
                                example:
                                    message: Unauthenticated.
                                properties:
                                    message: { type: string, example: Unauthenticated. }
            tags:
                - Users
        put:
            summary: 'Update user details.'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Users
            requestBody:
                required: true
                content:
                    application/json:
                        schema:
                            type: object
                            properties:
                                first_name:
                                    type: string
                                    description: 'User''s first name'
                                    example: aperiam
                                last_name:
                                    type: string
                                    description: 'User''s last name'
                                    example: delectus
                                phone_number:
                                    type: string
                                    description: 'User''s phone number'
                                    example: consequuntur
                                is_admin:
                                    type: boolean
                                    description: 'If user is an admin'
                                    example: false
                                permissions:
                                    type: array
                                    description: 'Permissions for non admin'
                                    example: '[''sales'',''orders'']'
                                email:
                                    type: string
                                    description: 'User''s email'
                                    example: impedit
                            required:
                                - first_name
                                - last_name
                                - phone_number
                                - is_admin
                                - email
        delete:
            summary: 'Deactivate a user'
            description: ''
            parameters:
                -
                    in: header
                    name: Authorization
                    description: ''
                    example: 'Bearer {YOUR_AUTH_KEY}'
                    schema:
                        type: string
                -
                    in: header
                    name: Content-Type
                    description: ''
                    example: application/json
                    schema:
                        type: string
                -
                    in: header
                    name: Accept
                    description: ''
                    example: application/json
                    schema:
                        type: string
            responses: {  }
            tags:
                - Users
        parameters:
            -
                in: path
                name: user
                description: 'User''s id'
                example: 3
                required: true
                schema:
                    type: integer
components:
    securitySchemes:
        default:
            type: http
            scheme: bearer
            description: ''
security:
    -
        default: []
