Uh oh!
There was an error while loading. Please reload this page.
docs(reports): document the on-demand refund transactions export (#159069) - #172
docs(reports): document the on-demand refund transactions export (#159069)#172gergesfikry-ottu wants to merge 1 commit into
Conversation
…9069) Adds a Generating a Refund Export section to the Reports API page: endpoint, auth matrix, four-language quick implementation, the async 201-means-queued contract, full query parameter tables, a Timezones section with a worked example of the eight-hour spread the same literal request produces across zones, parent-transaction filtering, and complete response and error tables. Also corrects the page's two existing samples, which sent the API key as a bare Api-Key header. HasPrivateAPIKey reads the standard Authorization header with the Api-Key keyword, and no API_KEY_CUSTOM_HEADER is configured. Documents #159067.
gergesfikry-ottu
commented
Aug 19, 2026
Closing this — wrong audience. The endpoint is not merchant-facing and does not belong in the public docs.
I over-weighted the fact that the view accepts The backend fix this documented is unaffected and still shipping: ottuco/core_backend#424 (#159067). Its OpenAPI description lives in No changes here are being carried forward. Docs ticket #159069 closed as well. |
What
Documents the refund transactions export — an on-demand endpoint that builds a refund-only CSV/XLSX report, filtered by date, state, order, currency, or gateway, with full timezone control. It was previously undocumented, so merchants had no way to discover it or to know that its date filters are timezone-sensitive.
The endpoint is the generation half of a flow whose other two halves (List Reports, Download Report) were already documented on this page, so this extends
docs/developers/reports.mdxrather than adding a new page: request a report → poll until finished → download.Docs ticket: https://orbit.ottu.com/issues/159069
Source ticket: https://orbit.ottu.com/issues/159067 (backend change this documents)
Source PR: https://github.com/ottuco/core_backend/pull/424
Pages
docs/developers/reports.mdx— new Generating a Refund Export section (~290 lines): endpoint, auth matrix, four-language quick implementation, async-generation warning, full query-parameter tables, a Timezones section with a worked example, parent-transaction filtering, response-field table, error table. Also updates the page intro, use cases, workflow diagram, and report-sources list to account for the third endpoint, and adds 5 FAQ entries and 3 best practices.sidebars.ts— "Refund Export" anchor added to the Reports category.Contract documented
GET /b/api/v1/dashboard/refund-transactions/export/Authorization: Api-Key <key>· Basic · Keycloak JWT BearerX-Timezone: <IANA name>— takes priority over?timezone=timezone— IANA name; sets both filter interpretation and rendered datesfile_format(csv/xlsx),fields,languagecreated_*,modified_*,state(refunded/refund_queued),order_no,product_type,currency_code,gateway_code,initiator,q201id,status,type,file,size,file_format,records_amount,period,created_at,exported_at,username,report_type400invalid timezone / invalid date / invalid state ·401·403Also fixed on this page
The two existing samples used
-H "Api-Key: your_private_api_key".HasPrivateAPIKeyreads the standardAuthorizationheader viarest_framework_api_key'sKeyParser(keywordApi-Key), and noAPI_KEY_CUSTOM_HEADERis configured — so the correct form isAuthorization: Api-Key <key>, which is whatdocs/developers/payments/wallet/index.mdxalready uses. Corrected both.Verification
Every claim in the new section was checked against the running endpoint, not inferred. Three drafted statements were wrong and were corrected before commit:
400 {"created": ["Enter a valid date/time."]}, keyed on the filter's base name rather than the bound you sentfile_formatis not rejected with404— it returns201and the value is stored as-isavailable_untilis absent from this response; it is awith_available_until()queryset annotation applied by List Reports, not a stored fieldThe
201example body is a captured response, not a hand-written one.npm run typecheck— passesnpm run build— passes,[SUCCESS] Generated static files in "build". The six broken-anchor warnings it prints are pre-existing on other pages (glossary terms, checkout-api, wallet); none originates from/developers/reports/.#generating-a-refund-export,#timezones,#worked-example,#filtering-by-order) all resolve.Source of truth
Field names, enum values, and error strings taken verbatim from
ottuco/core_backend@e1e5db763:contrib/dashboard/views.py:361-374— endpoint, auth, permissions, refunded/refund_queued querysetcontrib/dashboard/urls.py:23-25— pathutils/rest/views.py:154-193—get_report_timezone(header-over-query precedence, 400 on invalid), asyncexport(),file_format/fields/languagecore/payment/filters.py:99-197,354-372,398-478— filters,statechoices, parent-matchingorder_no/product_type,TimezoneAwareExportFilterMixincontrib/report/serializers.py:13-66— response fieldscontrib/report/models.py:128-131—ReportStatusvaluescontrib/report/export/export_builders.py:154-161+export/formatters.py:118—report_timezonedrives rendered datescontrib/report/managers.py:7-9—available_untilis an annotation