Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
feat(doc): add dispute management endpoints (#12650)
Akshaya Shankar1b22f6cebdec
diff --git a/api-reference/docs.json b/api-reference/docs.jsonindex 6274ba0310..ad5324fd0c 100644--- a/api-reference/docs.json+++ b/api-reference/docs.json@@ -110,7 +110,17 @@"group": "Disputes","pages": ["v1/disputes/disputes--retrieve",- "v1/disputes/disputes--list"+ "v1/disputes/disputes--list",+ "v1/disputes/disputes--list-profiles",+ "v1/disputes/disputes--accept",+ "v1/disputes/disputes--submit-evidence",+ "v1/disputes/disputes--attach-evidence",+ "v1/disputes/disputes--retrieve-evidence",+ "v1/disputes/disputes--delete-evidence",+ "v1/disputes/disputes--get-aggregate",+ "v1/disputes/disputes--get-aggregate-profiles",+ "v1/disputes/disputes--get-filters",+ "v1/disputes/disputes--get-filters-profiles"]},{diff --git a/api-reference/v1/disputes/disputes--accept.mdx b/api-reference/v1/disputes/disputes--accept.mdxnew file mode 100644index 0000000000..485c1c1e5b--- /dev/null+++ b/api-reference/v1/disputes/disputes--accept.mdx@@ -0,0 +1,3 @@+---+openapi: post /disputes/accept/{dispute_id}+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--attach-evidence.mdx b/api-reference/v1/disputes/disputes--attach-evidence.mdxnew file mode 100644index 0000000000..82ffee4ba4--- /dev/null+++ b/api-reference/v1/disputes/disputes--attach-evidence.mdx@@ -0,0 +1,3 @@+---+openapi: put /disputes/evidence+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--delete-evidence.mdx b/api-reference/v1/disputes/disputes--delete-evidence.mdxnew file mode 100644index 0000000000..387b8bebf2--- /dev/null+++ b/api-reference/v1/disputes/disputes--delete-evidence.mdx@@ -0,0 +1,3 @@+---+openapi: delete /disputes/evidence+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--get-aggregate-profiles.mdx b/api-reference/v1/disputes/disputes--get-aggregate-profiles.mdxnew file mode 100644index 0000000000..00cbb31bb3--- /dev/null+++ b/api-reference/v1/disputes/disputes--get-aggregate-profiles.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/profile/aggregate+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--get-aggregate.mdx b/api-reference/v1/disputes/disputes--get-aggregate.mdxnew file mode 100644index 0000000000..7507ee08ae--- /dev/null+++ b/api-reference/v1/disputes/disputes--get-aggregate.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/aggregate+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--get-filters-profiles.mdx b/api-reference/v1/disputes/disputes--get-filters-profiles.mdxnew file mode 100644index 0000000000..dc64d53690--- /dev/null+++ b/api-reference/v1/disputes/disputes--get-filters-profiles.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/profile/filter+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--get-filters.mdx b/api-reference/v1/disputes/disputes--get-filters.mdxnew file mode 100644index 0000000000..d8f3d5a8cd--- /dev/null+++ b/api-reference/v1/disputes/disputes--get-filters.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/filter+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--list-profiles.mdx b/api-reference/v1/disputes/disputes--list-profiles.mdxnew file mode 100644index 0000000000..976b1131cb--- /dev/null+++ b/api-reference/v1/disputes/disputes--list-profiles.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/profile/list+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--retrieve-evidence.mdx b/api-reference/v1/disputes/disputes--retrieve-evidence.mdxnew file mode 100644index 0000000000..bb14cb4045--- /dev/null+++ b/api-reference/v1/disputes/disputes--retrieve-evidence.mdx@@ -0,0 +1,3 @@+---+openapi: get /disputes/evidence/{dispute_id}+---\ No newline at end of filediff --git a/api-reference/v1/disputes/disputes--submit-evidence.mdx b/api-reference/v1/disputes/disputes--submit-evidence.mdxnew file mode 100644index 0000000000..30f8e569a4--- /dev/null+++ b/api-reference/v1/disputes/disputes--submit-evidence.mdx@@ -0,0 +1,3 @@+---+openapi: post /disputes/evidence+---\ No newline at end of filediff --git a/api-reference/v1/openapi_spec_v1.json b/api-reference/v1/openapi_spec_v1.jsonindex b7cd7cf5ce..ded148d017 100644--- a/api-reference/v1/openapi_spec_v1.json+++ b/api-reference/v1/openapi_spec_v1.json@@ -4616,6 +4616,535 @@]}},+ "/disputes/profile/list": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - List Disputes for The Given Profiles",+ "description": "Lists all the Disputes for a merchant",+ "operationId": "List Disputes for The given Profiles",+ "parameters": [+ {+ "name": "limit",+ "in": "query",+ "description": "The maximum number of Dispute Objects to include in the response",+ "required": false,+ "schema": {+ "type": "integer",+ "format": "int64",+ "nullable": true+ }+ },+ {+ "name": "dispute_status",+ "in": "query",+ "description": "The status of dispute",+ "required": false,+ "schema": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DisputeStatus"+ }+ ],+ "nullable": true+ }+ },+ {+ "name": "dispute_stage",+ "in": "query",+ "description": "The stage of dispute",+ "required": false,+ "schema": {+ "allOf": [+ {+ "$ref": "#/components/schemas/DisputeStage"+ }+ ],+ "nullable": true+ }+ },+ {+ "name": "reason",+ "in": "query",+ "description": "The reason for dispute",+ "required": false,+ "schema": {+ "type": "string",+ "nullable": true+ }+ },+ {+ "name": "connector",+ "in": "query",+ "description": "The connector linked to dispute",+ "required": false,+ "schema": {+ "type": "string",+ "nullable": true+ }+ },+ {+ "name": "received_time",+ "in": "query",+ "description": "The time at which dispute is received",+ "required": false,+ "schema": {+ "type": "string",+ "format": "date-time",+ "nullable": true+ }+ },+ {+ "name": "received_time.lt",+ "in": "query",+ "description": "Time less than the dispute received time",+ "required": false,+ "schema": {+ "type": "string",+ "format": "date-time",+ "nullable": true+ }+ },+ {+ "name": "received_time.gt",+ "in": "query",+ "description": "Time greater than the dispute received time",+ "required": false,+ "schema": {+ "type": "string",+ "format": "date-time",+ "nullable": true+ }+ },+ {+ "name": "received_time.lte",+ "in": "query",+ "description": "Time less than or equals to the dispute received time",+ "required": false,+ "schema": {+ "type": "string",+ "format": "date-time",+ "nullable": true+ }+ },+ {+ "name": "received_time.gte",+ "in": "query",+ "description": "Time greater than or equals to the dispute received time",+ "required": false,+ "schema": {+ "type": "string",+ "format": "date-time",+ "nullable": true+ }+ }+ ],+ "responses": {+ "200": {+ "description": "The dispute list was retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DisputeResponse"+ }+ }+ }+ }+ },+ "401": {+ "description": "Unauthorized request"+ }+ },+ "security": [+ {+ "api_key": []+ }+ ]+ }+ },+ "/disputes/filter": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Disputes Filters",+ "description": "Lists all the filters associated with disputes",+ "operationId": "List all filters for disputes",+ "responses": {+ "200": {+ "description": "List of filters",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputeListFilters"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/profile/filter": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Disputes Filters Profile",+ "description": "Lists all the filters associated with disputes for the given profiles",+ "operationId": "List all filters for disputes for the given Profiles",+ "responses": {+ "200": {+ "description": "List of filters",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputeListFilters"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/accept/{dispute_id}": {+ "post": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Accept Dispute",+ "description": "Accepts a dispute",+ "operationId": "Accept a Dispute",+ "parameters": [+ {+ "name": "dispute_id",+ "in": "path",+ "description": "The identifier for dispute",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "The dispute was accepted successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputeResponse"+ }+ }+ }+ },+ "404": {+ "description": "Dispute does not exist in our records",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GenericErrorResponseOpenApi"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/evidence": {+ "post": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Uploads Dispute Evidence",+ "description": "Uploads evidence for a dispute",+ "operationId": "Submit Dispute Evidence",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/SubmitEvidenceRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "The dispute evidence submitted successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputeResponse"+ }+ }+ }+ },+ "404": {+ "description": "Dispute does not exist in our records",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GenericErrorResponseOpenApi"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ },+ "put": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Attach Evidence to Dispute",+ "description": "Attaches an uploaded evidence file to a dispute",+ "operationId": "Attach Evidence to Dispute",+ "requestBody": {+ "description": "A multipart/form-data request with a `file` field containing the evidence file.",+ "content": {+ "multipart/form-data": {+ "schema": {+ "type": "string"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Evidence attached to dispute",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/CreateFileResponse"+ }+ }+ }+ },+ "400": {+ "description": "Bad Request",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GenericErrorResponseOpenApi"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ },+ "delete": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Delete Evidence attached to a Dispute",+ "description": "Deletes an evidence file attached to a dispute",+ "operationId": "Delete Evidence attached to a Dispute",+ "requestBody": {+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DeleteEvidenceRequest"+ }+ }+ },+ "required": true+ },+ "responses": {+ "200": {+ "description": "Evidence deleted from a dispute"+ },+ "400": {+ "description": "Bad Request"+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/evidence/{dispute_id}": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Retrieve Dispute Evidence",+ "description": "Retrieves evidence for a dispute",+ "operationId": "Retrieve a Dispute Evidence",+ "parameters": [+ {+ "name": "dispute_id",+ "in": "path",+ "description": "The identifier for dispute",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "The dispute evidence was retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DisputeEvidenceBlock"+ }+ }+ }+ }+ },+ "404": {+ "description": "Dispute does not exist in our records",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/GenericErrorResponseOpenApi"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/aggregate": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Get Disputes Aggregate",+ "description": "Gets a count of disputes grouped by their status for a merchant within a time range",+ "operationId": "Get Disputes Aggregate",+ "parameters": [+ {+ "name": "start_time",+ "in": "query",+ "description": "The start time for the aggregate query",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Disputes aggregate retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputesAggregateResponse"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },+ "/disputes/profile/aggregate": {+ "get": {+ "tags": [+ "Disputes"+ ],+ "summary": "Disputes - Get Disputes Aggregate for Profiles",+ "description": "Gets a count of disputes grouped by their status for the given profiles within a time range",+ "operationId": "Get Disputes Aggregate for Profiles",+ "parameters": [+ {+ "name": "start_time",+ "in": "query",+ "description": "The start time for the aggregate query",+ "required": true,+ "schema": {+ "type": "string"+ }+ }+ ],+ "responses": {+ "200": {+ "description": "Disputes aggregate retrieved successfully",+ "content": {+ "application/json": {+ "schema": {+ "$ref": "#/components/schemas/DisputesAggregateResponse"+ }+ }+ }+ }+ },+ "security": [+ {+ "api_key": []+ },+ {+ "jwt_key": []+ }+ ]+ }+ },"/routing": {"post": {"tags": [@@ -17958,6 +18487,18 @@}}},+ "CreateFileResponse": {+ "type": "object",+ "required": [+ "file_id"+ ],+ "properties": {+ "file_id": {+ "type": "string",+ "description": "ID of the file created"+ }+ }+ },"CreateSubscriptionPaymentDetails": {"type": "object","required": [@@ -19473,6 +20014,22 @@}}},+ "DeleteEvidenceRequest": {+ "type": "object",+ "required": [+ "dispute_id",+ "evidence_type"+ ],+ "properties": {+ "dispute_id": {+ "type": "string",+ "description": "Id of the dispute"+ },+ "evidence_type": {+ "$ref": "#/components/schemas/EvidenceType"+ }+ }+ },"DeviceChannel": {"type": "string","description": "Device Channel indicating whether request is coming from App or Browser",@@ -19556,6 +20113,63 @@}}},+ "DisputeEvidenceBlock": {+ "type": "object",+ "required": [+ "evidence_type",+ "file_metadata_response"+ ],+ "properties": {+ "evidence_type": {+ "$ref": "#/components/schemas/EvidenceType"+ },+ "file_metadata_response": {+ "$ref": "#/components/schemas/FileMetadataResponse"+ }+ }+ },+ "DisputeListFilters": {+ "type": "object",+ "required": [+ "connector",+ "currency",+ "dispute_status",+ "dispute_stage"+ ],+ "properties": {+ "connector": {+ "type": "object",+ "description": "The map of available connector filters, where the key is the connector name and the value is a list of MerchantConnectorInfo instances",+ "additionalProperties": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/MerchantConnectorInfo"+ }+ }+ },+ "currency": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/Currency"+ },+ "description": "The list of available currency filters"+ },+ "dispute_status": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DisputeStatus"+ },+ "description": "The list of available dispute status filters"+ },+ "dispute_stage": {+ "type": "array",+ "items": {+ "$ref": "#/components/schemas/DisputeStage"+ },+ "description": "The list of available dispute stage filters"+ }+ }+ },"DisputeResponse": {"type": "object","required": [@@ -19750,6 +20364,22 @@"dispute_lost"]},+ "DisputesAggregateResponse": {+ "type": "object",+ "required": [+ "status_with_count"+ ],+ "properties": {+ "status_with_count": {+ "type": "object",+ "description": "Different status of disputes with their count",+ "additionalProperties": {+ "type": "integer",+ "format": "int64"+ }+ }+ }+ },"DocumentDetails": {"type": "object","required": [@@ -20678,6 +21308,21 @@"invoice_paid"]},+ "EvidenceType": {+ "type": "string",+ "enum": [+ "cancellation_policy",+ "customer_communication",+ "customer_signature",+ "receipt",+ "refund_policy",+ "service_documentation",+ "shipping_documentation",+ "invoice_showing_distinct_transactions",+ "recurring_transaction_agreement",+ "uncategorized_file"+ ]+ },"ExemptionIndicator": {"type": "string","description": "Represents the exemption indicator used in a transaction under PSD2 SCA (Strong Customer Authentication) rules.",@@ -21512,6 +22157,39 @@],"description": "Possible field type of required fields in payment_method_data"},+ "FileMetadataResponse": {+ "type": "object",+ "required": [+ "file_id",+ "file_size",+ "file_type",+ "available"+ ],+ "properties": {+ "file_id": {+ "type": "string",+ "description": "ID of the file created"+ },+ "file_name": {+ "type": "string",+ "description": "Name of the file",+ "nullable": true+ },+ "file_size": {+ "type": "integer",+ "format": "int32",+ "description": "Size of the file"+ },+ "file_type": {+ "type": "string",+ "description": "Type of the file"+ },+ "available": {+ "type": "boolean",+ "description": "File availability"+ }+ }+ },"FinixAdditionalDetails": {"type": "object","properties": {@@ -24916,6 +25594,25 @@}}},+ "MerchantConnectorInfo": {+ "type": "object",+ "required": [+ "connector_label",+ "merchant_connector_id",+ "connector_type"+ ],+ "properties": {+ "connector_label": {+ "type": "string"+ },+ "merchant_connector_id": {+ "type": "string"+ },+ "connector_type": {+ "$ref": "#/components/schemas/ConnectorType"+ }+ }+ },"MerchantConnectorListResponse": {"type": "object","required": [@@ -42238,6 +42935,148 @@},"additionalProperties": false},+ "SubmitEvidenceRequest": {+ "type": "object",+ "required": [+ "dispute_id"+ ],+ "properties": {+ "dispute_id": {+ "type": "string",+ "description": "Dispute Id"+ },+ "access_activity_log": {+ "type": "string",+ "description": "Logs showing the usage of service by customer",+ "nullable": true+ },+ "billing_address": {+ "type": "string",+ "description": "Billing address of the customer",+ "nullable": true+ },+ "cancellation_policy": {+ "type": "string",+ "description": "File Id of cancellation policy",+ "nullable": true+ },+ "cancellation_policy_disclosure": {+ "type": "string",+ "description": "Details of showing cancellation policy to customer before purchase",+ "nullable": true+ },+ "cancellation_rebuttal": {+ "type": "string",+ "description": "Details telling why customer's subscription was not cancelled",+ "nullable": true+ },+ "customer_communication": {+ "type": "string",+ "description": "File Id of customer communication",+ "nullable": true+ },+ "customer_email_address": {+ "type": "string",+ "description": "Customer email address",+ "nullable": true+ },+ "customer_name": {+ "type": "string",+ "description": "Customer name",+ "nullable": true+ },+ "customer_purchase_ip": {+ "type": "string",+ "description": "IP address of the customer",+ "nullable": true+ },+ "customer_signature": {+ "type": "string",+ "description": "Fild Id of customer signature",+ "nullable": true+ },+ "product_description": {+ "type": "string",+ "description": "Product Description",+ "nullable": true+ },+ "receipt": {+ "type": "string",+ "description": "File Id of receipt",+ "nullable": true+ },+ "refund_policy": {+ "type": "string",+ "description": "File Id of refund policy",+ "nullable": true+ },+ "refund_policy_disclosure": {+ "type": "string",+ "description": "Details of showing refund policy to customer before purchase",+ "nullable": true+ },+ "refund_refusal_explanation": {+ "type": "string",+ "description": "Details why customer is not entitled to refund",+ "nullable": true+ },+ "service_date": {+ "type": "string",+ "description": "Customer service date",+ "nullable": true+ },+ "service_documentation": {+ "type": "string",+ "description": "File Id service documentation",+ "nullable": true+ },+ "shipping_address": {+ "type": "string",+ "description": "Shipping address of the customer",+ "nullable": true+ },+ "shipping_carrier": {+ "type": "string",+ "description": "Delivery service that shipped the product",+ "nullable": true+ },+ "shipping_date": {+ "type": "string",+ "description": "Shipping date",+ "nullable": true+ },+ "shipping_documentation": {+ "type": "string",+ "description": "File Id shipping documentation",+ "nullable": true+ },+ "shipping_tracking_number": {+ "type": "string",+ "description": "Tracking number of shipped product",+ "nullable": true+ },+ "invoice_showing_distinct_transactions": {+ "type": "string",+ "description": "File Id showing two distinct transactions when customer claims a payment was charged twice",+ "nullable": true+ },+ "recurring_transaction_agreement": {+ "type": "string",+ "description": "File Id of recurring transaction agreement",+ "nullable": true+ },+ "uncategorized_file": {+ "type": "string",+ "description": "Any additional supporting file",+ "nullable": true+ },+ "uncategorized_text": {+ "type": "string",+ "description": "Any additional evidence statements",+ "nullable": true+ }+ }+ },"SubscriptionId": {"type": "string","description": "A type for subscription_id that can be used for subscription ids"diff --git a/crates/api_models/src/disputes.rs b/crates/api_models/src/disputes.rsindex 9a5aaa3b99..6ce1f2a713 100644--- a/crates/api_models/src/disputes.rs+++ b/crates/api_models/src/disputes.rs@@ -8,7 +8,7 @@ use time::PrimitiveDateTime;use utoipa::ToSchema;use super::enums::{Currency, DisputeStage, DisputeStatus};-use crate::{admin::MerchantConnectorInfo, files};+use crate::{admin::MerchantConnectorInfo, files::FileMetadataResponse};#[derive(Clone, Debug, Serialize, ToSchema)]pub struct DisputeResponse {@@ -105,7 +105,7 @@ pub struct DisputeResponsePaymentsRetrieve {pub created_at: PrimitiveDateTime,}-#[derive(Debug, Serialize, Deserialize, strum::Display, Clone)]+#[derive(Debug, Serialize, Deserialize, strum::Display, Clone, ToSchema)]#[serde(rename_all = "snake_case")]#[strum(serialize_all = "snake_case")]pub enum EvidenceType {@@ -126,7 +126,7 @@ pub struct DisputeEvidenceBlock {/// Evidence typepub evidence_type: EvidenceType,/// File metadata- pub file_metadata_response: files::FileMetadataResponse,+ pub file_metadata_response: FileMetadataResponse,}#[derive(Clone, Debug, Deserialize, Serialize, ToSchema)]@@ -250,7 +250,7 @@ pub struct DisputeRetrieveRequest {pub force_sync: Option<bool>,}-#[derive(Clone, Debug, serde::Serialize)]+#[derive(Clone, Debug, serde::Serialize, ToSchema)]pub struct DisputesAggregateResponse {/// Different status of disputes with their countpub status_with_count: HashMap<DisputeStatus, i64>,diff --git a/crates/openapi/src/openapi.rs b/crates/openapi/src/openapi.rsindex 1592c6690f..d797d9bfd9 100644--- a/crates/openapi/src/openapi.rs+++ b/crates/openapi/src/openapi.rs@@ -163,6 +163,16 @@ Never share your secret api keys. Keep them guarded and secure.// Routes for disputesroutes::disputes::retrieve_dispute,routes::disputes::retrieve_disputes_list,+ routes::disputes::retrieve_disputes_list_profile,+ routes::disputes::get_disputes_filters,+ routes::disputes::get_disputes_filters_profile,+ routes::disputes::accept_dispute,+ routes::disputes::submit_dispute_evidence,+ routes::disputes::attach_dispute_evidence,+ routes::disputes::retrieve_dispute_evidence,+ routes::disputes::delete_dispute_evidence,+ routes::disputes::get_disputes_aggregate,+ routes::disputes::get_disputes_aggregate_profile,// Routes for routingroutes::routing::routing_create_config,@@ -354,6 +364,7 @@ Never share your secret api keys. Keep them guarded and secure.api_models::organization::OrganizationCreateRequest,api_models::organization::OrganizationUpdateRequest,api_models::organization::OrganizationResponse,+ api_models::admin::MerchantConnectorInfo,api_models::admin::MerchantAccountCreate,api_models::admin::MerchantAccountUpdate,api_models::admin::MerchantAccountDeleteResponse,@@ -511,6 +522,14 @@ Never share your secret api keys. Keep them guarded and secure.api_models::admin::TransactionDetailsUiConfiguration,api_models::disputes::DisputeResponse,api_models::disputes::DisputeResponsePaymentsRetrieve,+ api_models::disputes::DisputeListFilters,+ api_models::disputes::SubmitEvidenceRequest,+ api_models::disputes::DeleteEvidenceRequest,+ api_models::disputes::DisputesAggregateResponse,+ api_models::disputes::DisputeEvidenceBlock,+ api_models::disputes::EvidenceType,+ api_models::files::CreateFileResponse,+ api_models::files::FileMetadataResponse,api_models::card_issuer::CardIssuerRequest,api_models::card_issuer::CardIssuerResponse,api_models::card_issuer::CardIssuerUpdateRequest,diff --git a/crates/openapi/src/routes/disputes.rs b/crates/openapi/src/routes/disputes.rsindex 2fa9c23f22..b4ca6cf605 100644--- a/crates/openapi/src/routes/disputes.rs+++ b/crates/openapi/src/routes/disputes.rs@@ -44,6 +44,128 @@ pub async fn retrieve_dispute() {})]pub async fn retrieve_disputes_list() {}+/// Disputes - Accept Dispute+/// Accepts a dispute+#[utoipa::path(+ post,+ path = "/disputes/accept/{dispute_id}",+ params(+ ("dispute_id" = String, Path, description = "The identifier for dispute")+ ),+ responses(+ (status = 200, description = "The dispute was accepted successfully", body = DisputeResponse),+ (status = 404, description = "Dispute does not exist in our records", body = GenericErrorResponseOpenApi),+ ),+ tag = "Disputes",+ operation_id = "Accept a Dispute",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn accept_dispute() {}++/// Disputes - Attach Evidence to Dispute+/// Attaches an uploaded evidence file to a dispute+#[utoipa::path(+ put,+ path = "/disputes/evidence",+ request_body(+ content = String,+ content_type = "multipart/form-data",+ description = "A multipart/form-data request with a `file` field containing the evidence file.",+ ),+ responses(+ (status = 200, description = "Evidence attached to dispute", body = CreateFileResponse),+ (status = 400, description = "Bad Request", body = GenericErrorResponseOpenApi),+ ),+ tag = "Disputes",+ operation_id = "Attach Evidence to Dispute",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn attach_dispute_evidence() {}++/// Disputes - Uploads Dispute Evidence+/// Uploads evidence for a dispute+#[utoipa::path(+ post,+ path = "/disputes/evidence",+ request_body = SubmitEvidenceRequest,+ responses(+ (status = 200, description = "The dispute evidence submitted successfully", body = DisputeResponse),+ (status = 404, description = "Dispute does not exist in our records", body = GenericErrorResponseOpenApi)+ ),+ tag = "Disputes",+ operation_id = "Submit Dispute Evidence",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn submit_dispute_evidence() {}++/// Disputes - Retrieve Dispute Evidence+/// Retrieves evidence for a dispute+#[utoipa::path(+ get,+ path = "/disputes/evidence/{dispute_id}",+ params(+ ("dispute_id" = String, Path, description = "The identifier for dispute")+ ),+ responses(+ (status = 200, description = "The dispute evidence was retrieved successfully", body = Vec<DisputeEvidenceBlock>),+ (status = 404, description = "Dispute does not exist in our records", body = GenericErrorResponseOpenApi)+ ),+ tag = "Disputes",+ operation_id = "Retrieve a Dispute Evidence",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn retrieve_dispute_evidence() {}++/// Disputes - Delete Evidence attached to a Dispute+/// Deletes an evidence file attached to a dispute+#[utoipa::path(+ delete,+ path = "/disputes/evidence",+ request_body = DeleteEvidenceRequest,+ responses(+ (status = 200, description = "Evidence deleted from a dispute"),+ (status = 400, description = "Bad Request")+ ),+ tag = "Disputes",+ operation_id = "Delete Evidence attached to a Dispute",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn delete_dispute_evidence() {}++/// Disputes - Get Disputes Aggregate+/// Gets a count of disputes grouped by their status for a merchant within a time range+#[utoipa::path(+ get,+ path = "/disputes/aggregate",+ params(+ ("start_time" = String, Query, description = "The start time for the aggregate query")+ ),+ responses(+ (status = 200, description = "Disputes aggregate retrieved successfully", body = DisputesAggregateResponse),+ ),+ tag = "Disputes",+ operation_id = "Get Disputes Aggregate",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn get_disputes_aggregate() {}++/// Disputes - Get Disputes Aggregate for Profiles+/// Gets a count of disputes grouped by their status for the given profiles within a time range+#[utoipa::path(+ get,+ path = "/disputes/profile/aggregate",+ params(+ ("start_time" = String, Query, description = "The start time for the aggregate query")+ ),+ responses(+ (status = 200, description = "Disputes aggregate retrieved successfully", body = DisputesAggregateResponse),+ ),+ tag = "Disputes",+ operation_id = "Get Disputes Aggregate for Profiles",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn get_disputes_aggregate_profile() {}+/// Disputes - List Disputes for The Given Profiles/// Lists all the Disputes for a merchant#[utoipa::path(@@ -70,3 +192,31 @@ pub async fn retrieve_disputes_list() {}security(("api_key" = [])))]pub async fn retrieve_disputes_list_profile() {}++/// Disputes - Disputes Filters+/// Lists all the filters associated with disputes+#[utoipa::path(+ get,+ path = "/disputes/filter",+ responses(+ (status = 200, description = "List of filters", body = DisputeListFilters),+ ),+ tag = "Disputes",+ operation_id = "List all filters for disputes",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn get_disputes_filters() {}++/// Disputes - Disputes Filters Profile+/// Lists all the filters associated with disputes for the given profiles+#[utoipa::path(+ get,+ path = "/disputes/profile/filter",+ responses(+ (status = 200, description = "List of filters", body = DisputeListFilters),+ ),+ tag = "Disputes",+ operation_id = "List all filters for disputes for the given Profiles",+ security(("api_key" = []), ("jwt_key" = []))+)]+pub async fn get_disputes_filters_profile() {}