diff --git a/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql b/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql index 4fab78f..f3b4606 100644 --- a/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql +++ b/models/streamline/external/snag/transaction_entries/streamline__transaction_entries_realtime.sql @@ -25,7 +25,7 @@ ROW_NUMBER() over ( ORDER BY partition_key DESC, - INDEX DESC + INDEX ASC ) AS rn FROM {{ ref('silver_api__transaction_entries') }} @@ -55,7 +55,7 @@ SELECT DATE_PART('EPOCH', SYSDATE()) :: INTEGER AS partition_key, {{ target.database }}.live.udf_api( 'GET', - '{Service}/api/loyalty/transaction_entries' || '?organizationId=' || '{organization_id}' || '&websiteId=' || '{website_id}' || '&limit=' || api_limit{% if not var('STOREFRONT_INITIAL_RUN', false) %} || '&startingAfter=' || '{{ starting_after }}'{% endif %}{% if not var('IS_BACKFILL', false) %} || '&sortDir=asc'{% endif %}, + '{Service}/api/loyalty/transaction_entries' || '?organizationId=' || '{organization_id}' || '&websiteId=' || '{website_id}' || '&limit=' || api_limit{% if not var('STOREFRONT_INITIAL_RUN', false) %} || '&startingAfter=' || '{{ starting_after }}'{% endif %} || '&sortDir=asc', { 'x-api-key': '{Authentication}' }, {}, 'Vault/prod/flow/snag-api'