Retrieve your reconciliation reports programmatically with the Reports API.
Returns the list of reports and their details.
Reports retrieved successfully
Unauthorized – Access token may be invalid or missing
Unprocessable entity
// For more information please refer to https://github.com/checkout/checkout-sdk-go import ( "github.com/checkout/checkout-sdk-go" "github.com/checkout/checkout-sdk-go/configuration" "github.com/checkout/checkout-sdk-go/reports" ) // API Keys api, err := checkout. Builder(). StaticKeys(). WithSecretKey("secret_key"). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } // OAuth api, err := checkout. Builder(). OAuth(). WithClientCredentials("client_id", "client_secret"). WithScopes([]string{configuration.Reports}). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } query := reports.QueryFilter{ CreatedAfter: time.Parse("2006-01-02", time.Now().AddDate(0, 0, -10).Format("2006-01-02")), CreatedBefore: time.Parse("2006-01-02", time.Now().Format("2006-01-02")), EntityId: "entity_id", Limit: 20, } response, err := api.Reports.GetAllReports(query) if err != nil { return nil, err } return response, nil
{- "count": 1,
- "limit": 5,
- "data": [
- {
- "id": "rpt_lmmldzousk7etoqijqundqexa4",
- "created_on": "2022-02-18T13:00:12.357Z",
- "last_modified_on": "2022-02-18T13:16:12.357Z",
- "type": "Authentication",
- "description": "Reconciliation Report for X.",
- "account": {
- "client_id": "cli_bvaelhppmfiufdnatam37wrfc4",
- "entity_id": "ent_znj4ih5kn4fuxiaquoudv5mvwy"
}, - "tags": [
- "payout_id:pay_123456789"
], - "from": "2022-02-17T12:00:00Z",
- "to": "2022-02-18T12:00:00Z",
- "files": [
- {
- "id": "file_7ysmgfkj4ipunduud22uf73iey",
- "filename": "financial-actions_ent_znj4ih5kn4fuxiaquoudv5mvwy_20220218_000000001drl_1.csv",
- "format": "CSV",
- "_links": {
}
}
], - "_links": {
}
}
], - "_links": {
}
}Use this endpoint to retrieve a specific report using its ID.
Report details retrieved successfully
Unauthorized. Likely causes include an invalid or unspecified access token.
No report with the specified ID was found.
// For more information please refer to https://github.com/checkout/checkout-sdk-go import ( "github.com/checkout/checkout-sdk-go" "github.com/checkout/checkout-sdk-go/configuration" ) // API Keys api, err := checkout. Builder(). StaticKeys(). WithSecretKey("secret_key"). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } // OAuth api, err := checkout. Builder(). OAuth(). WithClientCredentials("client_id", "client_secret"). WithScopes([]string{configuration.Reports}). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } response, err := api.Reports.GetReportDetails("report_id") if err != nil { return nil, err } return response, nil
{- "id": "rpt_lmmldzousk7etoqijqundqexa4",
- "created_on": "2022-02-18T13:00:12.357Z",
- "last_modified_on": "2022-02-18T13:16:12.357Z",
- "type": "Authentication",
- "description": "Reconciliation Report for X.",
- "account": {
- "client_id": "cli_bvaelhppmfiufdnatam37wrfc4",
- "entity_id": "ent_znj4ih5kn4fuxiaquoudv5mvwy"
}, - "tags": [
- "payout_id:pay_123456789"
], - "from": "2022-02-17T12:00:00Z",
- "to": "2022-02-18T12:00:00Z",
- "files": [
- {
- "id": "file_7ysmgfkj4ipunduud22uf73iey",
- "filename": "financial-actions_ent_znj4ih5kn4fuxiaquoudv5mvwy_20220218_000000001drl_1.csv",
- "format": "CSV",
- "_links": {
}
}
], - "_links": {
}
}Use this endpoint to retrieve a specific file from a given report using their respective IDs.
Redirect to the report file download location.
Unauthorized. Likely causes include an invalid or unspecified access token.
No report with the specified ID was found.
// For more information please refer to https://github.com/checkout/checkout-sdk-go import ( "github.com/checkout/checkout-sdk-go" "github.com/checkout/checkout-sdk-go/configuration" ) // API Keys api, err := checkout. Builder(). StaticKeys(). WithSecretKey("secret_key"). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } // OAuth api, err := checkout. Builder(). OAuth(). WithClientCredentials("client_id", "client_secret"). WithScopes([]string{configuration.Reports}). WithEnvironment(configuration.Sandbox()). // or Environment.PRODUCTION WithEnvironmentSubdomain("{prefix}"). // Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see https://www.checkout.com/docs/developer-resources/api/api-endpoints. Build() if err != nil { return nil, err } response, err := api.Reports.GetReportFile("report_id", "file_id") if err != nil { return nil, err } return response, nil
{- "request_id": "0HMJGFVAQ35TL:00000117",
- "error_type": "not_found",
- "error_codes": [
- "report_file_not_found"
]
}