{
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "MerchantLimits": {
        "properties": {
          "access_type": {
            "enum": [
              "legacy",
              "beta"
            ],
            "title": "Access Type",
            "type": "string"
          },
          "beta_duration_days": {
            "title": "Beta Duration Days",
            "type": "integer"
          },
          "beta_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beta Expires At"
          },
          "beta_started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Beta Started At"
          },
          "creation_allowed": {
            "title": "Creation Allowed",
            "type": "boolean"
          },
          "creation_block_reason": {
            "anyOf": [
              {
                "enum": [
                  "account_inactive",
                  "creation_paused",
                  "beta_not_activated",
                  "beta_expired",
                  "total_quota_exhausted",
                  "daily_quota_exhausted"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Creation Block Reason"
          },
          "creation_enabled": {
            "title": "Creation Enabled",
            "type": "boolean"
          },
          "daily_left": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Left"
          },
          "daily_limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Daily Limit"
          },
          "daily_reset_at": {
            "format": "date-time",
            "title": "Daily Reset At",
            "type": "string"
          },
          "daily_used": {
            "title": "Daily Used",
            "type": "integer"
          },
          "last_api_request_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Api Request At"
          },
          "lifetime_requests_used": {
            "title": "Lifetime Requests Used",
            "type": "integer"
          },
          "merchant_id": {
            "title": "Merchant Id",
            "type": "string"
          },
          "requests_left": {
            "title": "Requests Left",
            "type": "integer"
          },
          "requests_used": {
            "title": "Requests Used",
            "type": "integer"
          },
          "server_time": {
            "format": "date-time",
            "title": "Server Time",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "total_limit": {
            "title": "Total Limit",
            "type": "integer"
          }
        },
        "required": [
          "merchant_id",
          "access_type",
          "status",
          "creation_enabled",
          "creation_allowed",
          "creation_block_reason",
          "beta_duration_days",
          "beta_started_at",
          "beta_expires_at",
          "total_limit",
          "requests_used",
          "requests_left",
          "lifetime_requests_used",
          "daily_limit",
          "daily_used",
          "daily_left",
          "daily_reset_at",
          "server_time",
          "last_api_request_at"
        ],
        "title": "MerchantLimits",
        "type": "object"
      },
      "PaymentCreateRequest": {
        "additionalProperties": false,
        "properties": {
          "amount": {
            "description": "Positive decimal string with at most two fractional digits; maximum 99999999.99.",
            "examples": [
              "49.00"
            ],
            "title": "Amount",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "maxLength": 500,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "merchant_wallet": {
            "maxLength": 34,
            "minLength": 34,
            "title": "Merchant Wallet",
            "type": "string"
          }
        },
        "required": [
          "amount",
          "merchant_wallet"
        ],
        "title": "PaymentCreateRequest",
        "type": "object"
      },
      "PaymentResponse": {
        "properties": {
          "callback_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Callback Url"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "expected_amount": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Expected Amount",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "merchant_wallet": {
            "title": "Merchant Wallet",
            "type": "string"
          },
          "payment_id": {
            "title": "Payment Id",
            "type": "string"
          },
          "payment_url": {
            "title": "Payment Url",
            "type": "string"
          },
          "review_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Review Reason"
          },
          "server_time": {
            "format": "date-time",
            "title": "Server Time",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "transaction_event_index": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Event Index"
          },
          "transaction_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transaction Id"
          },
          "verification_until": {
            "format": "date-time",
            "title": "Verification Until",
            "type": "string"
          }
        },
        "required": [
          "payment_id",
          "merchant_wallet",
          "expected_amount",
          "description",
          "status",
          "expires_at",
          "verification_until",
          "callback_url",
          "created_at",
          "payment_url",
          "transaction_id",
          "review_reason"
        ],
        "title": "PaymentResponse",
        "type": "object"
      },
      "PublicPaymentResponse": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "expected_amount": {
            "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
            "title": "Expected Amount",
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "title": "Expires At",
            "type": "string"
          },
          "merchant_wallet": {
            "title": "Merchant Wallet",
            "type": "string"
          },
          "payment_id": {
            "title": "Payment Id",
            "type": "string"
          },
          "server_time": {
            "format": "date-time",
            "title": "Server Time",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          },
          "verification_until": {
            "format": "date-time",
            "title": "Verification Until",
            "type": "string"
          }
        },
        "required": [
          "payment_id",
          "merchant_wallet",
          "expected_amount",
          "description",
          "status",
          "expires_at",
          "verification_until"
        ],
        "title": "PublicPaymentResponse",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WebhookDeliveryResponse": {
        "properties": {
          "attempts": {
            "title": "Attempts",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "error_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Category"
          },
          "event_id": {
            "title": "Event Id",
            "type": "string"
          },
          "failed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Failed At"
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Attempt At"
          },
          "payment_id": {
            "title": "Payment Id",
            "type": "string"
          },
          "status": {
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "payment_id",
          "status",
          "attempts",
          "created_at",
          "next_attempt_at",
          "delivered_at",
          "failed_at",
          "error_category"
        ],
        "title": "WebhookDeliveryResponse",
        "type": "object"
      },
      "WebhookSettingsRequest": {
        "additionalProperties": false,
        "properties": {
          "url": {
            "maxLength": 2048,
            "minLength": 1,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "title": "WebhookSettingsRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "APIKeyHeader": {
        "in": "header",
        "name": "X-API-Key",
        "type": "apiKey"
      }
    }
  },
  "info": {
    "description": "Generated offline from the Dedyx application. Merchant endpoints require X-API-Key, except API-key rotation (secret-key) and public-token status. Amounts must be decimal strings. Raw-body webhook verification, retries, quota and fulfilment rules are documented at https://dedyx.com/docs. Some dynamic JSON responses have no generated response schema; do not interpret an empty schema as an empty response. No live Swagger is enabled.",
    "title": "Dedyx Merchant API",
    "version": "2.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/merchant/limits": {
      "get": {
        "operationId": "limits_api_v1_merchant_limits_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MerchantLimits"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Limits"
      }
    },
    "/api/v1/merchant/rotate-key": {
      "post": {
        "operationId": "rotate_api_v1_merchant_rotate_key_post",
        "parameters": [
          {
            "in": "header",
            "name": "secret-key",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "title": "Secret-Key",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Rotate"
      }
    },
    "/api/v1/merchant/webhook": {
      "get": {
        "operationId": "get_webhook_api_v1_merchant_webhook_get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Get Webhook"
      },
      "put": {
        "operationId": "put_webhook_api_v1_merchant_webhook_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Put Webhook"
      }
    },
    "/api/v1/merchant/webhook/events/{event_id}/retry": {
      "post": {
        "operationId": "retry_webhook_api_v1_merchant_webhook_events__event_id__retry_post",
        "parameters": [
          {
            "in": "path",
            "name": "event_id",
            "required": true,
            "schema": {
              "title": "Event Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Retry Webhook"
      }
    },
    "/api/v1/merchant/webhook/rotate-key": {
      "post": {
        "operationId": "rotate_webhook_key_api_v1_merchant_webhook_rotate_key_post",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Rotate Webhook Key"
      }
    },
    "/api/v1/payments": {
      "get": {
        "operationId": "list_payments_api_v1_payments_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 10000,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PaymentResponse"
                  },
                  "title": "Response List Payments Api V1 Payments Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "List Payments"
      },
      "post": {
        "operationId": "create_payment_api_v1_payments_post",
        "parameters": [
          {
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 128,
                  "minLength": 8,
                  "pattern": "^[A-Za-z0-9._:-]+$",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "503": {
            "description": "Verification capacity unavailable; no payment or merchant quota is consumed.",
            "headers": {
              "Retry-After": {
                "description": "Seconds before retrying creation",
                "schema": {
                  "type": "string"
                }
              },
              "X-Capacity-Reason": {
                "description": "Safe capacity rejection category",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Create Payment"
      }
    },
    "/api/v1/payments/page": {
      "get": {
        "operationId": "payment_page_api_v1_payments_page_get",
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 2048,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Payment Page"
      }
    },
    "/api/v1/payments/{payment_id}/cancel": {
      "post": {
        "operationId": "cancel_payment_api_v1_payments__payment_id__cancel_post",
        "parameters": [
          {
            "in": "path",
            "name": "payment_id",
            "required": true,
            "schema": {
              "title": "Payment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Cancel Payment"
      }
    },
    "/api/v1/payments/{payment_id}/details": {
      "get": {
        "operationId": "payment_details_api_v1_payments__payment_id__details_get",
        "parameters": [
          {
            "in": "path",
            "name": "payment_id",
            "required": true,
            "schema": {
              "title": "Payment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Payment Details"
      }
    },
    "/api/v1/payments/{payment_id}/webhooks": {
      "get": {
        "operationId": "payment_webhooks_api_v1_payments__payment_id__webhooks_get",
        "parameters": [
          {
            "in": "path",
            "name": "payment_id",
            "required": true,
            "schema": {
              "title": "Payment Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookDeliveryResponse"
                  },
                  "title": "Response Payment Webhooks Api V1 Payments  Payment Id  Webhooks Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "security": [
          {
            "APIKeyHeader": []
          }
        ],
        "summary": "Payment Webhooks"
      }
    },
    "/api/v1/payments/{public_token}": {
      "get": {
        "operationId": "public_status_api_v1_payments__public_token__get",
        "parameters": [
          {
            "in": "path",
            "name": "public_token",
            "required": true,
            "schema": {
              "title": "Public Token",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPaymentResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Public Status"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.dedyx.com"
    }
  ]
}
