{
    "swagger": "2.0",
    "info": {
        "title": "Frakmenta's POS API",
        "contact": {
            "email": "sistemas@frakmenta.com"
        },
        "version": "2.0.0"
    },
    "host": "",
    "basePath": "/api",
    "schemes": [
        "https",
        "http"
    ],
    "consumes": [
        "application/json,application/x-www-form-urlencoded"
    ],
    "produces": [
        "application/xml,application/json"
    ],
    "paths": {
        "/operation": {
            "post": {
                "tags": [
                    "Operation"
                ],
                "summary": "Creates an operation",
                "description": "Posts the operation data and returns the operation Id and token.",
                "operationId": "PostOperation",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "type",
                        "in": "formData",
                        "description": "Operation's type: deferred or loan. By default loan.",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "cardholder_name",
                        "in": "formData",
                        "description": "Cardholder's name. Ex: 'Juan Garcia'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_user_id",
                        "in": "formData",
                        "description": "PayTPV Card's user id. Ex: '7633358'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "card_token_id",
                        "in": "formData",
                        "description": "PayTPV Card's token id. Ex: 'dfRrbGR123hQekd'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "phone_number",
                        "in": "formData",
                        "description": "Client's phone number. Ex: '654889147'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "product_price",
                        "in": "formData",
                        "description": "Transaction's total amount. Ex: 300.0",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "initial_amount",
                        "in": "formData",
                        "description": "Transaction's initial amount. Ex: 80.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "initial_commission_amount",
                        "in": "formData",
                        "description": "Transaction's initial commission amount. Ex: 5.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "repayment_amount",
                        "in": "formData",
                        "description": "Transaction's repayment amount. Ex: 25.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "repayment_commission_amount",
                        "in": "formData",
                        "description": "Transaction's repayment commission amount. Ex: 2.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "installments",
                        "in": "formData",
                        "description": "Number of installments. Ex: 3",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "first_repayment_date",
                        "in": "formData",
                        "description": "Date in which the initial amount will be paid in YYYY-MM-DD format. Ex: '2017-04-06'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "product_id",
                        "in": "formData",
                        "description": "Product's ID. Ex: '5600001'",
                        "required": true,
                        "type": "number"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "operation_id": {
                                            "type": "number",
                                            "example": "1234"
                                        },
                                        "token_id": {
                                            "type": "string",
                                            "example": "xTsF"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/operation/get_scoring": {
            "get": {
                "tags": [
                    "Operation"
                ],
                "summary": "Gets the operation's scoring result",
                "description": "Gets the operation's scoring result. Returns 'no' if the scoring is not ready. If scoring is completed, it responds with it's result ('ok', 'cfr', 'ko')",
                "operationId": "OperationScoring",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "query",
                        "description": "Current Operation's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "score": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "token_id": {
                                            "type": "string",
                                            "example": "xTsF"
                                        },
                                        "document": {
                                            "type": "string",
                                            "example": "12345678Z"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. One of these things happened: a malformed parameter was sent, the operation has expired or it has been completed."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/operation/add_phone": {
            "post": {
                "tags": [
                    "Operation"
                ],
                "summary": "Adds a phone number to an operation",
                "description": "Adds a phone number to an operation.",
                "operationId": "operationAddPhone",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "formData",
                        "description": "Current Operation's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "phone_number",
                        "in": "formData",
                        "description": "Phone number to add. Ex: '654889114'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "example": "OK"
                                        },
                                        "token_id": {
                                            "type": "string",
                                            "example": "ABCD"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. One of these things happened: a malformed parameter was sent, the operation has expired or it has been completed."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/operation/add_nif": {
            "post": {
                "tags": [
                    "Operation"
                ],
                "summary": "Adds a NIF to an operation",
                "description": "Adds a NIF to an operation",
                "operationId": "operationAddNif",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "formData",
                        "description": "Current Operation's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "nif",
                        "in": "formData",
                        "description": "NIF to add. Ex: '56629384A'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "example": "OK"
                                        },
                                        "ine_url": {
                                            "type": "string",
                                            "example": "https://frakmenta.s3-eu-west-1.amazonaws.com/local/operations/4870/ine.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJJRUMFSZ2WAD5ALQ%2F20170911%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20170911T073247Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1800&X-Amz-Signature=4a98f2801a693a2d3ec5d52905e4e79bf1ac5be623189dc76eb860f19a98b9f2"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. One of these things happened: a malformed parameter was sent, the operation has expired or it has been completed."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/operation/accept_terms": {
            "post": {
                "tags": [
                    "Operation"
                ],
                "summary": "Notifies the client's terms acceptance",
                "description": "Notifies the client's terms acceptance",
                "operationId": "OperationAcceptTerms",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "formData",
                        "description": "Operation Id which terms were accepted. Ex: 19",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "result": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. One of these things happened: a malformed parameter was sent, the operation has expired or it has been completed."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/operation/": {
            "get": {
                "tags": [
                    "Operation"
                ],
                "summary": "Gets the data of the operation with the specified operation id",
                "description": "This call is to be used in the Promo D\u00fao feature.",
                "operationId": "OperationGetRefund",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "query",
                        "description": "Refund Operation's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client ID. Ex: '111'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "integer"
                    },
                    {
                        "name": "merchant_id",
                        "in": "query",
                        "description": "Merchant's ID. Ex: 19665",
                        "required": true,
                        "type": "integer",
                        "format": "integer"
                    },
                    {
                        "name": "office_id",
                        "in": "query",
                        "description": ". Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "integer"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "id": {
                                            "type": "integer",
                                            "example": "1234"
                                        },
                                        "product_price": {
                                            "type": "number",
                                            "example": "250.50"
                                        },
                                        "score": {
                                            "type": "string",
                                            "example": "no"
                                        },
                                        "product_id": {
                                            "type": "string",
                                            "example": "5600001"
                                        },
                                        "repayment_amount": {
                                            "type": "number",
                                            "example": "100"
                                        },
                                        "repayment_commission_amount": {
                                            "type": "number",
                                            "example": "2.95"
                                        },
                                        "installments": {
                                            "type": "integer",
                                            "example": "3"
                                        },
                                        "first_repayment_date": {
                                            "type": "string",
                                            "example": "2017-10-11"
                                        },
                                        "card_token": {
                                            "type": "string",
                                            "example": "8rok0zbwk4"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/pos/get_config": {
            "get": {
                "tags": [
                    "Pos"
                ],
                "summary": "Gets the Pos's configuration parameters",
                "description": "Gets the Pos's configuration parameters.",
                "operationId": "getPosConfig",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation.",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "merchant_name": {
                                            "type": "string",
                                            "example": "Zapatolandia"
                                        },
                                        "merchant_cif": {
                                            "type": "string",
                                            "example": "53400660L"
                                        },
                                        "merchant_address": {
                                            "type": "string",
                                            "example": "Calle Povedilla 40, Madrid"
                                        },
                                        "merchant_password": {
                                            "type": "string",
                                            "example": "pass1234"
                                        },
                                        "merchant_password_salt": {
                                            "type": "string",
                                            "example": "S@lt"
                                        },
                                        "products": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "product_id": {
                                                        "type": "string",
                                                        "example": "5600001"
                                                    },
                                                    "product_name": {
                                                        "type": "string",
                                                        "example": "Producto prueba"
                                                    },
                                                    "is_promo_product": {
                                                        "type": "boolean",
                                                        "example": "true"
                                                    },
                                                    "valid_since": {
                                                        "type": "string",
                                                        "example": "20171010"
                                                    },
                                                    "valid_until": {
                                                        "type": "string",
                                                        "example": "20171025"
                                                    },
                                                    "grace_periods": {
                                                        "type": "integer",
                                                        "example": "0"
                                                    },
                                                    "promotional_periods": {
                                                        "type": "integer",
                                                        "example": "0"
                                                    },
                                                    "promotional_interest": {
                                                        "type": "integer",
                                                        "example": "0"
                                                    },
                                                    "initial_commission_percentage": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "initial_commission_min_amount": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "initial_commission_max_amount": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "commission_table": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "amount_from": {
                                                                    "type": "number",
                                                                    "example": "80"
                                                                },
                                                                "amount_to": {
                                                                    "type": "number",
                                                                    "example": "99.99"
                                                                },
                                                                "installments": {
                                                                    "type": "integer",
                                                                    "example": "6"
                                                                },
                                                                "amount": {
                                                                    "type": "number",
                                                                    "example": "1"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "404": {
                        "description": "Not Found. No configuration was found."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/pos/get_totals": {
            "get": {
                "tags": [
                    "Pos"
                ],
                "summary": "Gets the totals for a specified pos.",
                "description": "Gets the totals for a specified pos.",
                "operationId": "PosGetTotals",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "single_operations": {
                                            "type": "number",
                                            "example": "7"
                                        },
                                        "single_totals": {
                                            "type": "number",
                                            "example": "1500"
                                        },
                                        "split_operations": {
                                            "type": "number",
                                            "example": "4"
                                        },
                                        "split_totals": {
                                            "type": "number",
                                            "example": "3500"
                                        },
                                        "return_operations": {
                                            "type": "number",
                                            "example": "2"
                                        },
                                        "return_totals": {
                                            "type": "number",
                                            "example": "350"
                                        },
                                        "percentage_commission": {
                                            "type": "number",
                                            "example": "0.06"
                                        },
                                        "total_commission": {
                                            "type": "number",
                                            "example": "36.25"
                                        },
                                        "grand_total": {
                                            "type": "number",
                                            "example": "3624"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Requested pos doesn not belong to merchant."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/transaction/single_payment": {
            "post": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Posts a single payment transaction",
                "description": "Posts a single payment transaction and returns it's transaction Id.",
                "operationId": "PostSinglePayment",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_id",
                        "in": "formData",
                        "description": "Transaction's ID number. Ex: '24589'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bank_transaction_id",
                        "in": "formData",
                        "description": "Bank's transaction ID number. Ex: '1234567'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_user_id",
                        "in": "formData",
                        "description": "PayTPV Card's user id. Ex: '7633358'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "card_token_id",
                        "in": "formData",
                        "description": "PayTPV Card's token id. Ex: 'dfRrbGR123hQekd'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "Transaction's amount. Ex: 200.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "result_ok",
                        "in": "formData",
                        "description": "1 if the transaction was approved and 0 otherwise",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "ko_reason",
                        "in": "formData",
                        "description": "Reason for which the transaction was not approved. Ex: 'not enough funds', or blank if the transaction was approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "authorization_code",
                        "in": "formData",
                        "description": "Transaction's authorization code. Ex: '123456', or blank if the transaction was not approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_date",
                        "in": "formData",
                        "description": "Transaction's date and time in YYYY-MM-DD hh:mm:ss format. Ex: '2017-03-27 09:14:11'",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "ack": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/transaction/split_payment": {
            "post": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Posts a split payment transaction and returns it's transaction Id.",
                "description": "Posts a split payment transaction and returns it's transaction Id.",
                "operationId": "PostSplitPayment",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "formData",
                        "description": "Operation's ID. Ex: 19",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "transaction_id",
                        "in": "formData",
                        "description": "Transaction's ID number. Ex: '24589'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bank_transaction_id",
                        "in": "formData",
                        "description": "Bank's transaction ID number. Ex: '1234567'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_pan",
                        "in": "formData",
                        "description": "Card's Primary Account Number.",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "Transaction's amount. Ex: 200.5",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "result_ok",
                        "in": "formData",
                        "description": "1 if the transaction was approved and 0 otherwise",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "ko_reason",
                        "in": "formData",
                        "description": "Reason for which the transaction was not approved. Ex: 'not enough funds', or blank if the transaction was approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "authorization_code",
                        "in": "formData",
                        "description": "Transaction's authorization code. Ex: '123456', or blank if the transaction was not approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_date",
                        "in": "formData",
                        "description": "Transaction's date and time in YYYY-MM-DD hh:mm:ss format. Ex: '2017-03-27 09:14:11'",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "ack": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/transaction/refund": {
            "post": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Posts a refund transaction and returns it's transaction Id.",
                "description": "Posts a refund transaction and returns it's transaction Id.",
                "operationId": "PostRefund",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "original_transaction_id",
                        "in": "formData",
                        "description": "ID of the transaction to be refunded. Ex: 19",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "transaction_id",
                        "in": "formData",
                        "description": "Refund transaction's ID number. Ex: '24589'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bank_transaction_id",
                        "in": "formData",
                        "description": "Refund Bank's transaction ID number. Ex: '1234567'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_user_id",
                        "in": "formData",
                        "description": "PayTPV Card's user id. Ex: '7633358'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "card_token_id",
                        "in": "formData",
                        "description": "PayTPV Card's token id. Ex: 'dfRrbGR123hQekd'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "refund_amount",
                        "in": "formData",
                        "description": "Refund's amount. Ex: 120.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "first_repayment_capital_refund",
                        "in": "formData",
                        "description": "Capital refunded from the first payment transaction. Ex: 60.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "first_repayment_commission_refund",
                        "in": "formData",
                        "description": "Commission amount refunded from the first payment transaction. Ex: 12.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "result_ok",
                        "in": "formData",
                        "description": "1 if the transaction was approved and 0 otherwise",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "ko_reason",
                        "in": "formData",
                        "description": "Reason for which the transaction was not approved. Ex: 'not enough funds', or blank if the transaction was approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "authorization_code",
                        "in": "formData",
                        "description": "Transaction's authorization code. Ex: '123456', or blank if the transaction was not approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_date",
                        "in": "formData",
                        "description": "Transaction's date and time in YYYY-MM-DD hh:mm:ss format. Ex: '2017-03-27 09:14:11'",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "ack": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/transaction/refund_data": {
            "get": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Gets the data of the transaction with the specified transaction id. This information is to be used by refund transactions.",
                "description": "Gets the data of the transaction with the specified transaction id. This information is to be used by refund transactions.",
                "operationId": "TransactionGetRefund",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_id",
                        "in": "query",
                        "description": "Refund Transaction's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "refund_amount",
                        "in": "query",
                        "description": "Amount to be refunded. Ex: 20.00",
                        "required": true,
                        "type": "number"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "amount": {
                                            "type": "number",
                                            "example": "200.00"
                                        },
                                        "card_bin": {
                                            "type": "number",
                                            "example": "456213"
                                        },
                                        "card_exp_date": {
                                            "type": "string",
                                            "example": "05/18"
                                        },
                                        "card_last_four": {
                                            "type": "number",
                                            "example": "1234"
                                        },
                                        "client_name": {
                                            "type": "string",
                                            "example": "Carlos Alonso"
                                        },
                                        "document": {
                                            "type": "string",
                                            "example": "12345678Z"
                                        },
                                        "first_repayment_capital_refund": {
                                            "type": "number",
                                            "example": "50.25"
                                        },
                                        "first_repayment_commission_refund": {
                                            "type": "number",
                                            "example": "80.25"
                                        },
                                        "is_single_payment": {
                                            "type": "integer",
                                            "example": "1"
                                        },
                                        "max_refund": {
                                            "type": "number",
                                            "example": "100.00"
                                        },
                                        "transaction_date": {
                                            "type": "string",
                                            "example": "2017-09-11"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Requested transaction id does not belong to merchant."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/operation": {
            "post": {
                "tags": [
                    "Operation"
                ],
                "summary": "Creates an operation",
                "description": "Posts the operation data and returns the operation Id and token.",
                "operationId": "PostOperation",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "type",
                        "in": "formData",
                        "description": "Operation's type: deferred or loan. By default loan.",
                        "required": false,
                        "type": "string"
                    },
                    {
                        "name": "cardholder_name",
                        "in": "formData",
                        "description": "Cardholder's name. Ex: 'Juan Garcia'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_user_id",
                        "in": "formData",
                        "description": "PayTPV Card's user id. Ex: '7633358'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "card_token_id",
                        "in": "formData",
                        "description": "PayTPV Card's token id. Ex: 'dfRrbGR123hQekd'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "phone_number",
                        "in": "formData",
                        "description": "Client's phone number. Ex: '654889147'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "product_price",
                        "in": "formData",
                        "description": "Transaction's total amount. Ex: 300.0",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "initial_amount",
                        "in": "formData",
                        "description": "Transaction's initial amount. Ex: 80.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "initial_commission_amount",
                        "in": "formData",
                        "description": "Transaction's initial commission amount. Ex: 5.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "repayment_amount",
                        "in": "formData",
                        "description": "Transaction's repayment amount. Ex: 25.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "repayment_commission_amount",
                        "in": "formData",
                        "description": "Transaction's repayment commission amount. Ex: 2.5",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "installments",
                        "in": "formData",
                        "description": "Number of installments. Ex: 3",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "first_repayment_date",
                        "in": "formData",
                        "description": "Date in which the initial amount will be paid in YYYY-MM-DD format. Ex: '2017-04-06'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "product_id",
                        "in": "formData",
                        "description": "Product's ID. Ex: '5600001'",
                        "required": true,
                        "type": "number"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "operation_id": {
                                            "type": "number",
                                            "example": "1234"
                                        },
                                        "token_id": {
                                            "type": "string",
                                            "example": "xTsF"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/operation/get_scoring": {
            "get": {
                "tags": [
                    "Operation"
                ],
                "summary": "Gets the operation's scoring result",
                "description": "Gets the operation's scoring result. Returns 'no' if the scoring is not ready. If scoring is completed, it responds with it's result ('ok', 'cfr', 'ko')",
                "operationId": "OperationScoring",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "query",
                        "description": "Current Operation's ID. Ex: 53",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "reason",
                        "in": "query",
                        "description": "Reason why result is KO. Ex: La operaci\u00f3n ha sido denegada.",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "score": {
                                            "type": "string",
                                            "example": "ok"
                                        },
                                        "token_id": {
                                            "type": "string",
                                            "example": "xTsF"
                                        },
                                        "document": {
                                            "type": "string",
                                            "example": "12345678Z"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. One of these things happened: a malformed parameter was sent, the operation has expired or it has been completed."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/pos/deferred_config": {
            "get": {
                "tags": [
                    "Pos"
                ],
                "summary": "Gets the Pos's deferred options parameters",
                "description": "Gets the Pos's deferred options parameters.",
                "operationId": "getDeferredId",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "amount",
                        "in": "query",
                        "description": "Amount to be paid. Ex: 200.00",
                        "required": true,
                        "type": "number"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation.",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "deferred_options": {
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "deferred_option_id": {
                                                        "type": "string",
                                                        "example": "1"
                                                    },
                                                    "deferred_name": {
                                                        "type": "string",
                                                        "example": "3 meses"
                                                    },
                                                    "valid_since": {
                                                        "type": "string",
                                                        "example": "20171010"
                                                    },
                                                    "valid_until": {
                                                        "type": "string",
                                                        "example": "20171025"
                                                    },
                                                    "initial_commission_percentage": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "initial_commission_min_amount": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "initial_commission_max_amount": {
                                                        "type": "number",
                                                        "example": "0"
                                                    },
                                                    "commission_table": {
                                                        "type": "array",
                                                        "items": {
                                                            "properties": {
                                                                "amount_from": {
                                                                    "type": "number",
                                                                    "example": "80"
                                                                },
                                                                "amount_to": {
                                                                    "type": "number",
                                                                    "example": "99.99"
                                                                },
                                                                "amount": {
                                                                    "type": "number",
                                                                    "example": "1"
                                                                }
                                                            },
                                                            "type": "object"
                                                        }
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "404": {
                        "description": "Not Found. No configuration was found."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/pos/password": {
            "get": {
                "tags": [
                    "Pos"
                ],
                "summary": "Checks if the password match",
                "description": "Checks if the password match.",
                "operationId": "checkPassword",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "co_password",
                        "in": "query",
                        "description": "User password. Ex: 1234",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Password matches.",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "404": {
                        "description": "Not Found. No configuration was found."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/pos/change_password": {
            "get": {
                "tags": [
                    "Pos"
                ],
                "summary": "Change the password",
                "description": "Change the password.",
                "operationId": "changePassword",
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "query",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "query",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "query",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "co_password",
                        "in": "query",
                        "description": "User password. Ex: 1234",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Password changed successfully.",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "401": {
                        "description": "Unauthorized. Invalid POS's status."
                    },
                    "404": {
                        "description": "Not Found. No configuration was found."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/transaction/deferred_payment": {
            "post": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Posts a deferred payment transaction and returns it's transaction Id.",
                "description": "Posts a deferred payment transaction and returns it's transaction Id.",
                "operationId": "PostDeferredPayment",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "operation_id",
                        "in": "formData",
                        "description": "Operation's ID. Ex: 19",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "transaction_id",
                        "in": "formData",
                        "description": "Transaction's ID number. Ex: '24589'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bank_transaction_id",
                        "in": "formData",
                        "description": "Bank's transaction ID number. Ex: '1234567'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_pan",
                        "in": "formData",
                        "description": "Card's Primary Account Number.",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "amount",
                        "in": "formData",
                        "description": "Transaction's amount. Ex: 200.5",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "result_ok",
                        "in": "formData",
                        "description": "1 if the transaction was approved and 0 otherwise",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "ko_reason",
                        "in": "formData",
                        "description": "Reason for which the transaction was not approved. Ex: 'not enough funds', or blank if the transaction was approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "authorization_code",
                        "in": "formData",
                        "description": "Transaction's authorization code. Ex: '123456', or blank if the transaction was not approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_date",
                        "in": "formData",
                        "description": "Transaction's date and time in YYYY-MM-DD hh:mm:ss format. Ex: '2017-03-27 09:14:11'",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "ack": {
                                            "type": "string",
                                            "example": "OK"
                                        },
                                        "login_url": {
                                            "type": "string",
                                            "example": "https://frakmenta.com/login"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        },
        "/v2/transaction/refund": {
            "post": {
                "tags": [
                    "Transaction"
                ],
                "summary": "Posts a refund transaction and returns it's transaction Id.",
                "description": "Posts a refund transaction and returns it's transaction Id.",
                "operationId": "PostRefund",
                "consumes": [
                    "application/json,application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json",
                    "application/xml"
                ],
                "parameters": [
                    {
                        "name": "x-auth-token",
                        "in": "header",
                        "description": "Authorization header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "x-idempotency-token",
                        "in": "header",
                        "description": "Idempotency header",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "original_transaction_id",
                        "in": "formData",
                        "description": "ID of the transaction to be refunded. Ex: 19",
                        "required": true,
                        "type": "number"
                    },
                    {
                        "name": "transaction_id",
                        "in": "formData",
                        "description": "Refund transaction's ID number. Ex: '24589'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "bank_transaction_id",
                        "in": "formData",
                        "description": "Refund Bank's transaction ID number. Ex: '1234567'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_client",
                        "in": "formData",
                        "description": "ClearOne's client identifier. Ex: '1234'",
                        "required": true,
                        "type": "integer"
                    },
                    {
                        "name": "co_store",
                        "in": "formData",
                        "description": "ClearOne's store identifier. Ex: '1234'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "co_pos",
                        "in": "formData",
                        "description": "ClearOne's TPV identifier. Ex: 1",
                        "required": true,
                        "type": "integer",
                        "format": "int32"
                    },
                    {
                        "name": "card_user_id",
                        "in": "formData",
                        "description": "PayTPV Card's user id. Ex: '7633358'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "card_token_id",
                        "in": "formData",
                        "description": "PayTPV Card's token id. Ex: 'dfRrbGR123hQekd'",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "refund_amount",
                        "in": "formData",
                        "description": "Refund's amount. Ex: 120.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "first_repayment_capital_refund",
                        "in": "formData",
                        "description": "Capital refunded from the first payment transaction. Ex: 60.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "first_repayment_commission_refund",
                        "in": "formData",
                        "description": "Commission amount refunded from the first payment transaction. Ex: 12.5",
                        "required": true,
                        "type": "number",
                        "format": "int32"
                    },
                    {
                        "name": "result_ok",
                        "in": "formData",
                        "description": "1 if the transaction was approved and 0 otherwise",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "ko_reason",
                        "in": "formData",
                        "description": "Reason for which the transaction was not approved. Ex: 'not enough funds', or blank if the transaction was approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "authorization_code",
                        "in": "formData",
                        "description": "Transaction's authorization code. Ex: '123456', or blank if the transaction was not approved",
                        "required": true,
                        "type": "string"
                    },
                    {
                        "name": "transaction_date",
                        "in": "formData",
                        "description": "Transaction's date and time in YYYY-MM-DD hh:mm:ss format. Ex: '2017-03-27 09:14:11'",
                        "required": true,
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "successful operation",
                        "schema": {
                            "properties": {
                                "status": {
                                    "type": "string",
                                    "example": "ok"
                                },
                                "code": {
                                    "type": "integer",
                                    "example": "200"
                                },
                                "messages": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "example": ""
                                    }
                                },
                                "data": {
                                    "properties": {
                                        "ack": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            },
                            "type": "object"
                        }
                    },
                    "400": {
                        "description": "Bad Request. Probably a malformed parameter was sent."
                    },
                    "500": {
                        "description": "Server error."
                    }
                },
                "schemes": [
                    "https",
                    "http"
                ]
            }
        }
    },
    "definitions": {
        "Error": {
            "required": [
                "code",
                "message"
            ],
            "properties": {
                "code": {
                    "type": "integer",
                    "format": "int32"
                },
                "message": {
                    "type": "string"
                }
            }
        }
    },
    "securityDefinitions": {
        "default": {
            "type": "apiKey",
            "name": "x-auth-token",
            "in": "header"
        }
    }
}