{
   "openapi" : "3.1.0",
   "info" : {
      "version" : "1",
      "x-publicVersion" : true,
      "title" : "Report webhooks",
      "description" : "Adyen sends webhooks to inform your system that reports were generated and are ready to be downloaded.\n\nYou can download reports programmatically by making an HTTP GET request, or manually from your [Balance Platform Customer Area](https://balanceplatform-test.adyen.com/balanceplatform).",
      "termsOfService" : "https://www.adyen.com/legal/terms-and-conditions",
      "contact" : {
         "name" : "Adyen Developer Experience team",
         "url" : "https://github.com/Adyen/adyen-openapi"
      }
   },
   "tags" : [
      {
         "name" : "General"
      }
   ],
   "webhooks" : {
      "balancePlatform.report.created" : {
         "post" : {
            "tags" : [
               "General"
            ],
            "summary" : "Report generated",
            "description" : "Adyen sends this webhook after a report is generated and ready to be downloaded. The webhook contains the URL at which the report can be downloaded.\n\nBefore you download reports, ask your Adyen contact for your report credentials. You must use your the credentials to authenticate your GET request.",
            "operationId" : "post-balancePlatform.report.created",
            "x-sortIndex" : 0,
            "x-methodName" : "reportGenerated",
            "security" : [
               {
                  "BasicAuth" : [
                     ]
               }
            ],
            "requestBody" : {
               "content" : {
                  "application/json" : {
                     "examples" : {
                        "balancePlatform.report.created" : {
                           "$ref" : "#/components/examples/post-balancePlatform.report.created-balancePlatform.report.created"
                        }
                     },
                     "schema" : {
                        "$ref" : "#/components/schemas/ReportNotificationRequest"
                     }
                  }
               }
            },
            "responses" : {
               "200" : {
                  "content" : {
                     "application/json" : {
                        "examples" : {
                           "balancePlatform.report.created" : {
                              "$ref" : "#/components/examples/WebhookAck"
                           }
                        },
                        "schema" : {
                           "$ref" : "#/components/schemas/BalancePlatformNotificationResponse"
                        }
                     }
                  },
                  "description" : "OK - the request has succeeded."
               }
            }
         }
      }
   },
   "components" : {
      "schemas" : {
         "BalancePlatformNotificationResponse" : {
            "additionalProperties" : false,
            "properties" : {
               "notificationResponse" : {
                  "description" : "Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).",
                  "type" : "string"
               }
            },
            "type" : "object"
         },
         "ReportNotificationData" : {
            "additionalProperties" : false,
            "properties" : {
               "accountHolder" : {
                  "description" : "The account holder related to the report.",
                  "$ref" : "#/components/schemas/ResourceReference"
               },
               "balanceAccount" : {
                  "description" : "The balance account related to the report.",
                  "$ref" : "#/components/schemas/ResourceReference"
               },
               "balancePlatform" : {
                  "description" : "The unique identifier of the balance platform.",
                  "type" : "string"
               },
               "creationDate" : {
                  "description" : "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.",
                  "format" : "date-time",
                  "type" : "string"
               },
               "downloadUrl" : {
                  "description" : "The URL at which you can download the report. To download, you must authenticate your GET request with your [API credentials](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/overview).",
                  "type" : "string"
               },
               "fileName" : {
                  "description" : "The filename of the report.",
                  "type" : "string"
               },
               "id" : {
                  "description" : "The ID of the resource.",
                  "type" : "string"
               },
               "reportType" : {
                  "description" : "The type of report. Possible values:\n\n- `balanceplatform_accounting_interactive_report`\n- `balanceplatform_accounting_report`\n- `balanceplatform_balance_report`\n- `balanceplatform_fee_report`\n- `balanceplatform_payment_instrument_report`\n- `balanceplatform_payout_report`\n- `balanceplatform_statement_report`\n\n",
                  "type" : "string"
               }
            },
            "required" : [
               "fileName",
               "reportType",
               "downloadUrl"
            ],
            "type" : "object"
         },
         "ReportNotificationRequest" : {
            "additionalProperties" : false,
            "properties" : {
               "data" : {
                  "description" : "Contains event details.",
                  "$ref" : "#/components/schemas/ReportNotificationData"
               },
               "environment" : {
                  "description" : "The environment from which the webhook originated.\n\nPossible values: **test**, **live**.",
                  "type" : "string"
               },
               "timestamp" : {
                  "description" : "When the event was queued.",
                  "format" : "date-time",
                  "type" : "string"
               },
               "type" : {
                  "description" : "Type of webhook.",
                  "enum" : [
                     "balancePlatform.report.created"
                  ],
                  "type" : "string"
               }
            },
            "required" : [
               "environment",
               "type",
               "data"
            ],
            "type" : "object"
         },
         "Resource" : {
            "additionalProperties" : false,
            "properties" : {
               "balancePlatform" : {
                  "description" : "The unique identifier of the balance platform.",
                  "type" : "string"
               },
               "creationDate" : {
                  "description" : "The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.",
                  "format" : "date-time",
                  "type" : "string"
               },
               "id" : {
                  "description" : "The ID of the resource.",
                  "type" : "string"
               }
            },
            "type" : "object"
         },
         "ResourceReference" : {
            "additionalProperties" : false,
            "properties" : {
               "description" : {
                  "description" : "The description of the resource.",
                  "type" : "string"
               },
               "id" : {
                  "description" : "The unique identifier of the resource.",
                  "type" : "string"
               },
               "reference" : {
                  "description" : "The reference for the resource.",
                  "type" : "string"
               }
            },
            "type" : "object"
         }
      },
      "securitySchemes" : {
         "BasicAuth" : {
            "scheme" : "basic",
            "type" : "http"
         }
      },
      "examples" : {
         "WebhookAck" : {
            "summary" : "Acknowledge Webhook",
            "value" : {
               "notificationResponse" : "[accepted]"
            }
         },
         "post-balancePlatform.report.created-balancePlatform.report.created" : {
            "summary" : "Report created",
            "description" : "Example webhook when a report was generated and is ready to be downloaded",
            "value" : {
               "data" : {
                  "balancePlatform" : "YOUR_BALANCE_PLATFORM",
                  "creationDate" : "2024-07-02T02:01:08+02:00",
                  "id" : "balanceplatform_accounting_report_2024_07_01.csv",
                  "downloadUrl" : "https://balanceplatform-test.adyen.com/balanceplatform/.../.../.../balanceplatform_accounting_report_2024_07_01.csv",
                  "fileName" : "balanceplatform_accounting_report_2024_07_01.csv",
                  "reportType" : "balanceplatform_accounting_report"
               },
               "environment" : "test",
               "timestamp" : "2024-07-02T02:01:05+02:00",
               "type" : "balancePlatform.report.created"
            }
         }
      }
   }
}