{
  "openapi": "3.0.1",
  "info": {
    "title": "LSG Payments API",
    "description": "Endpoints provide buisness standard payment operations",
    "contact": {
      "name": "Dev Team",
      "email": "ITDevelopment@leger.co.uk"
    },
    "version": "v1"
  },
  "paths": {
    "/api/v1/EcommPay/EcommCallBack": {
      "get": {
        "tags": [
          "EcommPay"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/EcommPay/GenerateSignature": {
      "get": {
        "tags": [
          "EcommPay"
        ],
        "parameters": [
          {
            "name": "json",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorMid",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MID"
            }
          },
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/EcommPay/GetPaymentStatus": {
      "get": {
        "tags": [
          "EcommPay"
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorMid",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MID"
            }
          },
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/EcommPay/PaymentPageProcessPayment": {
      "get": {
        "tags": [
          "EcommPay"
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorMid",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MID"
            }
          },
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/EcommPaymentStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/EcommPay/GetConf": {
      "get": {
        "tags": [
          "EcommPay"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Gateway/IsAlive": {
      "get": {
        "tags": [
          "Gateway"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "type": "string"
                }
              },
              "text/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/Gateway/Posting/{method}": {
      "post": {
        "tags": [
          "Gateway"
        ],
        "parameters": [
          {
            "name": "method",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "VPSProtocol": {
                    "type": "string"
                  },
                  "TxType": {
                    "type": "string"
                  },
                  "Vendor": {
                    "type": "string"
                  },
                  "VendorTxCode": {
                    "type": "string"
                  },
                  "Amount": {
                    "type": "string"
                  },
                  "Currency": {
                    "type": "string"
                  },
                  "Description": {
                    "type": "string"
                  },
                  "CardType": {
                    "type": "string"
                  },
                  "CardHolder": {
                    "type": "string"
                  },
                  "CardNumber": {
                    "type": "string"
                  },
                  "BillingSurname": {
                    "type": "string"
                  },
                  "BillingFirstnames": {
                    "type": "string"
                  },
                  "BillingAddress": {
                    "type": "string"
                  },
                  "BillingAddress1": {
                    "type": "string"
                  },
                  "BillingCity": {
                    "type": "string"
                  },
                  "BillingPostCode": {
                    "type": "string"
                  },
                  "BillingCountry": {
                    "type": "string"
                  },
                  "DeliverySurname": {
                    "type": "string"
                  },
                  "DeliveryFirstnames": {
                    "type": "string"
                  },
                  "DeliveryAddress1": {
                    "type": "string"
                  },
                  "DeliveryCity": {
                    "type": "string"
                  },
                  "DeliveryPostCode": {
                    "type": "string"
                  },
                  "DeliveryCountry": {
                    "type": "string"
                  },
                  "StartDate": {
                    "type": "string"
                  },
                  "ExpiryDate": {
                    "type": "string"
                  },
                  "CV2": {
                    "type": "string"
                  },
                  "StoreToken": {
                    "type": "string"
                  },
                  "ApplyAVSCV2": {
                    "type": "string"
                  },
                  "Apply3DSecure": {
                    "type": "string"
                  },
                  "AccountType": {
                    "type": "string"
                  },
                  "CreateToken": {
                    "type": "string"
                  },
                  "RelatedTxAuthNo": {
                    "type": "string"
                  },
                  "RelatedVendorTxCode": {
                    "type": "string"
                  },
                  "RelatedSecurityKey": {
                    "type": "string"
                  },
                  "RelatedVPSTxId": {
                    "type": "string"
                  },
                  "RelatedAquirer": {
                    "type": "string"
                  },
                  "RelatedAccountType": {
                    "type": "string"
                  },
                  "BookingID": {
                    "type": "string"
                  }
                }
              },
              "encoding": {
                "VPSProtocol": {
                  "style": "form"
                },
                "TxType": {
                  "style": "form"
                },
                "Vendor": {
                  "style": "form"
                },
                "VendorTxCode": {
                  "style": "form"
                },
                "Amount": {
                  "style": "form"
                },
                "Currency": {
                  "style": "form"
                },
                "Description": {
                  "style": "form"
                },
                "CardType": {
                  "style": "form"
                },
                "CardHolder": {
                  "style": "form"
                },
                "CardNumber": {
                  "style": "form"
                },
                "BillingSurname": {
                  "style": "form"
                },
                "BillingFirstnames": {
                  "style": "form"
                },
                "BillingAddress": {
                  "style": "form"
                },
                "BillingAddress1": {
                  "style": "form"
                },
                "BillingCity": {
                  "style": "form"
                },
                "BillingPostCode": {
                  "style": "form"
                },
                "BillingCountry": {
                  "style": "form"
                },
                "DeliverySurname": {
                  "style": "form"
                },
                "DeliveryFirstnames": {
                  "style": "form"
                },
                "DeliveryAddress1": {
                  "style": "form"
                },
                "DeliveryCity": {
                  "style": "form"
                },
                "DeliveryPostCode": {
                  "style": "form"
                },
                "DeliveryCountry": {
                  "style": "form"
                },
                "StartDate": {
                  "style": "form"
                },
                "ExpiryDate": {
                  "style": "form"
                },
                "CV2": {
                  "style": "form"
                },
                "StoreToken": {
                  "style": "form"
                },
                "ApplyAVSCV2": {
                  "style": "form"
                },
                "Apply3DSecure": {
                  "style": "form"
                },
                "AccountType": {
                  "style": "form"
                },
                "CreateToken": {
                  "style": "form"
                },
                "RelatedTxAuthNo": {
                  "style": "form"
                },
                "RelatedVendorTxCode": {
                  "style": "form"
                },
                "RelatedSecurityKey": {
                  "style": "form"
                },
                "RelatedVPSTxId": {
                  "style": "form"
                },
                "RelatedAquirer": {
                  "style": "form"
                },
                "RelatedAccountType": {
                  "style": "form"
                },
                "BookingID": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/Paysafe/UpdatePaymentDetails": {
      "get": {
        "tags": [
          "Paysafe"
        ],
        "parameters": [
          {
            "name": "paymentId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendorMid",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/MID"
            }
          },
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/Paysafe/GetPaymentToken": {
      "get": {
        "tags": [
          "Paysafe"
        ],
        "parameters": [
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/Paysafe/ProcessBalancePayment": {
      "post": {
        "tags": [
          "Paysafe"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPostData"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CardPostData"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CardPostData"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/Paysafe/ProcessBalancePaymentByBookingId": {
      "post": {
        "tags": [
          "Paysafe"
        ],
        "parameters": [
          {
            "name": "bookingId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "paymentAmount",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/v1/Paysafe/Payment": {
      "post": {
        "tags": [
          "Paysafe"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingProcessPaysafe"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingProcessPaysafe"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/BookingProcessPaysafe"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Account": {
        "type": "object",
        "properties": {
          "number": {
            "type": "string",
            "nullable": true
          },
          "token": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "card_holder": {
            "type": "string",
            "nullable": true
          },
          "expiry_month": {
            "type": "string",
            "nullable": true
          },
          "expiry_year": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Billingdetails": {
        "type": "object",
        "properties": {
          "street": {
            "type": "string",
            "nullable": true
          },
          "city": {
            "type": "string",
            "nullable": true
          },
          "zip": {
            "type": "string",
            "nullable": true
          },
          "country": {
            "type": "string",
            "nullable": true
          },
          "state": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "BookingProcessPaysafe": {
        "type": "object",
        "properties": {
          "merchantReferenceNumber": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "settleWithAuth": {
            "type": "boolean"
          },
          "isLowDeposit": {
            "type": "boolean"
          },
          "billingdetails": {
            "$ref": "#/components/schemas/Billingdetails"
          },
          "profile": {
            "$ref": "#/components/schemas/PaysafeProfile"
          },
          "paymentToken": {
            "type": "string",
            "nullable": true
          },
          "bookingId": {
            "type": "string",
            "nullable": true
          },
          "clientId": {
            "type": "string",
            "nullable": true
          },
          "isFlightBooking": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CardPostData": {
        "type": "object",
        "properties": {
          "vpsProtocol": {
            "type": "string",
            "nullable": true
          },
          "txType": {
            "type": "string",
            "nullable": true
          },
          "vendor": {
            "type": "string",
            "nullable": true
          },
          "vendorTxCode": {
            "type": "string",
            "nullable": true
          },
          "amount": {
            "type": "string",
            "nullable": true
          },
          "currency": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "cardType": {
            "type": "string",
            "nullable": true
          },
          "cardHolder": {
            "type": "string",
            "nullable": true
          },
          "cardNumber": {
            "type": "string",
            "nullable": true
          },
          "billingSurname": {
            "type": "string",
            "nullable": true
          },
          "billingFirstnames": {
            "type": "string",
            "nullable": true
          },
          "billingAddress": {
            "type": "string",
            "nullable": true
          },
          "billingAddress1": {
            "type": "string",
            "nullable": true
          },
          "billingCity": {
            "type": "string",
            "nullable": true
          },
          "billingPostCode": {
            "type": "string",
            "nullable": true
          },
          "billingCountry": {
            "type": "string",
            "nullable": true
          },
          "deliverySurname": {
            "type": "string",
            "nullable": true
          },
          "deliveryFirstnames": {
            "type": "string",
            "nullable": true
          },
          "deliveryAddress1": {
            "type": "string",
            "nullable": true
          },
          "deliveryCity": {
            "type": "string",
            "nullable": true
          },
          "deliveryPostCode": {
            "type": "string",
            "nullable": true
          },
          "deliveryCountry": {
            "type": "string",
            "nullable": true
          },
          "startDate": {
            "type": "string",
            "nullable": true
          },
          "expiryDate": {
            "type": "string",
            "nullable": true
          },
          "cV2": {
            "type": "string",
            "nullable": true
          },
          "storeToken": {
            "type": "string",
            "nullable": true
          },
          "applyAVSCV2": {
            "type": "string",
            "nullable": true
          },
          "apply3DSecure": {
            "type": "string",
            "nullable": true
          },
          "accountType": {
            "type": "string",
            "nullable": true
          },
          "createToken": {
            "type": "string",
            "nullable": true
          },
          "relatedTxAuthNo": {
            "type": "string",
            "nullable": true
          },
          "relatedVendorTxCode": {
            "type": "string",
            "nullable": true
          },
          "relatedSecurityKey": {
            "type": "string",
            "nullable": true
          },
          "relatedVPSTxId": {
            "type": "string",
            "nullable": true
          },
          "relatedAquirer": {
            "type": "string",
            "nullable": true
          },
          "relatedAccountType": {
            "type": "string",
            "nullable": true
          },
          "bookingID": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "EcommPaymentStatusResponse": {
        "type": "object",
        "properties": {
          "vpsProtocol": {
            "type": "string",
            "nullable": true
          },
          "securityKey": {
            "type": "string",
            "nullable": true
          },
          "txAuthNo": {
            "type": "string",
            "nullable": true
          },
          "avscV2": {
            "type": "string",
            "nullable": true
          },
          "addressResult": {
            "type": "string",
            "nullable": true
          },
          "cV2Result": {
            "type": "string",
            "nullable": true
          },
          "threedSecureStatus": {
            "type": "string",
            "nullable": true
          },
          "accountType": {
            "type": "string",
            "nullable": true
          },
          "account": {
            "$ref": "#/components/schemas/Account"
          },
          "project_id": {
            "type": "integer",
            "format": "int32"
          },
          "payment": {
            "$ref": "#/components/schemas/Payment"
          },
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Operation"
            },
            "nullable": true
          },
          "signature": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Errors"
            },
            "nullable": true
          },
          "statusDetail": {
            "type": "string",
            "nullable": true
          },
          "vpsTxId": {
            "type": "string",
            "nullable": true
          },
          "cardAquirer": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "travellerResponse": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "Errors": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MID": {
        "enum": [
          0,
          1,
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10
        ],
        "type": "integer",
        "format": "int32"
      },
      "Operation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "stsEcomm": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "created_date": {
            "type": "string",
            "format": "date-time"
          },
          "request_id": {
            "type": "string",
            "nullable": true
          },
          "sum_initial": {
            "$ref": "#/components/schemas/Sum_Initial"
          },
          "sum_converted": {
            "$ref": "#/components/schemas/Sum_Converted"
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "eci": {
            "type": "string",
            "nullable": true
          },
          "provider": {
            "$ref": "#/components/schemas/Provider"
          }
        },
        "additionalProperties": false
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "stsEcomm": {
            "type": "string",
            "nullable": true
          },
          "date": {
            "type": "string",
            "format": "date-time"
          },
          "method": {
            "type": "string",
            "nullable": true
          },
          "sum": {
            "$ref": "#/components/schemas/Sum"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PaysafeProfile": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": "string",
            "nullable": true
          },
          "lastName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Provider": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "payment_id": {
            "type": "string",
            "nullable": true
          },
          "auth_code": {
            "type": "string",
            "nullable": true
          },
          "endpoint_id": {
            "type": "integer",
            "format": "int32"
          },
          "date": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Sum": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int32"
          },
          "currency": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Sum_Converted": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int32"
          },
          "currency": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Sum_Initial": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "format": "int32"
          },
          "currency": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "API Key required to access this API",
        "name": "x-api-key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ]
}