{
  "openapi": "3.0.0",
  "info": {
    "title": "x-gateway-external-api",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.xgateway.tech/api/v2"
    }
  ],
  "paths": {
    "/gateway10": {
      "post": {
        "operationId": "CreateAndActivateDepositInvoice",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppSuccessResponse_CreateInvoiceResponse_"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "data": {
                        "threeDSURL": "https://example.com",
                        "message": "Invoice has been successfully activated. 3DS verification is required."
                      },
                      "success": true
                    }
                  },
                  "Example 2": {
                    "value": {
                      "data": {
                        "threeDSURL": null,
                        "message": "The invoice has been successfully finalized."
                      },
                      "success": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Database violation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "bad_request",
                          "message": "Card details are invalid. Please check and try again."
                        }
                      ],
                      "success": false
                    }
                  },
                  "Example 2": {
                    "value": {
                      "errors": [
                        {
                          "code": "db_violation",
                          "message": "The request failed because it violated a database constraint."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppAuthenticationErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "unauthorized",
                          "message": "You do not have permission to access this resource."
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "not_found",
                          "message": "The Account could not be found"
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppValidationErrorResponse"
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "errors": [
                        {
                          "code": "too_small",
                          "message": "Number must be greater than 0",
                          "minimum": 0,
                          "type": "number",
                          "inclusive": false,
                          "exact": false,
                          "path": [
                            "body",
                            "amount"
                          ]
                        }
                      ],
                      "success": false
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppErrorResponse"
                }
              }
            }
          }
        },
        "description": "Creates and activates a Gateway10 invoice for card payment processing.\r\n\r\nThis API creates an invoice and immediately activates it with the provided payment details.\r\nIf 3DS verification is required, a 3DS URL will be returned for customer authentication.\r\n\r\nAccess to this endpoint requires a valid API key. The API key is sent in the `x-api-key` header on requests.",
        "summary": "Create and activate a Gateway10 invoice with card payment details.",
        "tags": [
          "Gateway10"
        ],
        "security": [
          {
            "api_key": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "description": "- The input data for creating a Gateway10 invoice.",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvoiceGateway10Input",
                "description": "- The input data for creating a Gateway10 invoice."
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AppClientErrorResponseCode": {
        "type": "string",
        "enum": [
          "bad_request",
          "db_violation",
          "unauthorized",
          "payment_required",
          "forbidden",
          "not_found",
          "method_not_allowed",
          "not_acceptable",
          "proxy_authentication_required",
          "request_timeout",
          "conflict",
          "db_unique_violation",
          "gone",
          "length_required",
          "precondition_failed",
          "payload_too_large",
          "uri_too_long",
          "unsupported_media_type",
          "range_not_satisfiable",
          "expectation_failed",
          "misdirected_request",
          "unprocessable_content",
          "db_non_null_violation",
          "locked",
          "failed_dependency",
          "upgrade_required",
          "precondition_required",
          "too_many_requests",
          "request_header_fields_too_large",
          "unavailable_for_legal_reasons"
        ],
        "nullable": false,
        "description": "The AppClientErrorResponseCode object contains all client error response codes."
      },
      "AppServerErrorResponseCode": {
        "type": "string",
        "enum": [
          "internal_server_error",
          "not_implemented",
          "bad_gateway",
          "service_unavailable",
          "gateway_timeout",
          "http_version_not_supported",
          "variant_also_negotiates",
          "insufficient_storage",
          "loop_detected",
          "not_extended",
          "network_authentication_required"
        ],
        "nullable": false,
        "description": "The AppServerErrorResponseCode object contains all server error response codes."
      },
      "IAppError": {
        "description": "The IAppError interface represents an application error message.",
        "properties": {
          "code": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AppClientErrorResponseCode"
              },
              {
                "$ref": "#/components/schemas/AppServerErrorResponseCode"
              }
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppErrorResponse": {
        "description": "The AppErrorResponse object contains general information about the error message.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/IAppError"
            },
            "type": "array"
          }
        },
        "required": [
          "success",
          "errors"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppAuthenticationErrorResponse": {
        "description": "The AppAuthenticationErrorResponse object contains general information about the authentication\r\nerror.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "errors": {
            "items": {
              "$ref": "#/components/schemas/IAppError"
            },
            "type": "array",
            "default": [
              {
                "code": "unauthorized",
                "message": "You do not have permission to access this resource."
              }
            ]
          }
        },
        "required": [
          "success",
          "errors"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppValidationErrorResponse": {
        "description": "The AppValidationErrorResponse object contains general information about the validation error.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": false
          },
          "errors": {
            "items": {},
            "type": "array"
          }
        },
        "required": [
          "success",
          "errors"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "InvoiceStrategy": {
        "description": "Represents the possible strategies of an invoice.",
        "enum": [
          "floating",
          "fixed"
        ],
        "type": "string"
      },
      "CreateInvoiceResponse": {
        "properties": {
          "threeDSURL": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "threeDSURL",
          "message"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "AppSuccessResponse_CreateInvoiceResponse_": {
        "description": "The AppSuccessResponse object contains general information about the success execution.",
        "properties": {
          "success": {
            "type": "boolean",
            "default": true
          },
          "data": {
            "$ref": "#/components/schemas/CreateInvoiceResponse"
          }
        },
        "required": [
          "success",
          "data"
        ],
        "type": "object",
        "additionalProperties": false
      },
      "FiatCurrency": {
        "type": "string",
        "enum": [
          "EUR",
          "GBP",
          "AZN",
          "BDT",
          "INR",
          "JPY",
          "PKR",
          "RUB",
          "TRY",
          "UZS",
          "AUD",
          "BRL",
          "CAD",
          "CHF",
          "CZK",
          "DKK",
          "KES",
          "NOK",
          "NZD",
          "SEK",
          "USD"
        ],
        "description": "Represents all fiat currencies in the payment processing system.\r\n\r\nCurrencies:\r\n- `AZN` - Azerbaijani Manat\r\n- `BDT` - Bangladeshi Taka\r\n- `EUR` - Euro\r\n- `GBP` - Pound Sterling\r\n- `INR` - Indian Rupee\r\n- `JPY` - Japanese Yen\r\n- `KES` - Kenyan Shilling\r\n- `PKR` - Pakistani Rupee\r\n- `RUB` - Russian Ruble\r\n- `TRY` - Turkish Lira\r\n- `USD` - United States Dollar\r\n- `UZS` - Uzbekistani Som."
      },
      "CreateInvoiceGateway10Input": {
        "properties": {
          "accountId": {
            "type": "string"
          },
          "amount": {
            "type": "number",
            "format": "double"
          },
          "baseCurrency": {
            "$ref": "#/components/schemas/FiatCurrency"
          },
          "customerId": {
            "type": "string"
          },
          "card": {
            "properties": {
              "cardSecurityCode": {
                "type": "string"
              },
              "expiryYear": {
                "type": "string"
              },
              "expiryMonth": {
                "type": "string"
              },
              "cardNumber": {
                "type": "string"
              }
            },
            "required": [
              "cardSecurityCode",
              "expiryYear",
              "expiryMonth",
              "cardNumber"
            ],
            "type": "object"
          },
          "customerFirstName": {
            "type": "string"
          },
          "customerLastName": {
            "type": "string"
          },
          "customerEmail": {
            "type": "string"
          },
          "customerPhone": {
            "type": "string"
          },
          "customerCity": {
            "type": "string"
          },
          "customerState": {
            "type": "string"
          },
          "customerStreet": {
            "type": "string"
          },
          "customerCountry": {
            "type": "string"
          },
          "customerPostCode": {
            "type": "string"
          },
          "ip": {
            "type": "string"
          },
          "invoiceStrategy": {
            "$ref": "#/components/schemas/InvoiceStrategy"
          },
          "orderId": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "redirectUrl": {
            "type": "string"
          }
        },
        "required": [
          "accountId",
          "amount",
          "baseCurrency",
          "customerId",
          "card",
          "customerFirstName",
          "customerLastName",
          "customerEmail",
          "customerPhone",
          "customerCity",
          "customerState",
          "customerStreet",
          "customerCountry",
          "customerPostCode",
          "ip"
        ],
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "api_key": {
        "in": "header",
        "name": "x-api-key",
        "type": "apiKey"
      }
    }
  }
}