기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
결제 이벤트 데이터 피드
이 데이터 피드는 인보이스 발행 및 지불 등 결제 이벤트에 대한 정보를 제공합니다.
예를 들어, 이 데이터 피드를 사용하여 구매자에게 인보이스가 발행되는 시기와 항목을 확인할 수 있습니다. 예제 SQL 쿼리를 사용하여 이 데이터 피드의 데이터를 분석할 수도 있습니다.
이 데이터 피드에는 사용자가 등록 판매자인 결제 이벤트와 관련된 정보가 포함되어 있습니다. 채널 파트너를 통해 체결된 계약의 경우 이 데이터 피드는 제조업자와 등록 판매자 간의 결제 이벤트에 대한 정보를 포함합니다.
결제 이벤트 데이터 피드는 24시간마다 새로 고쳐지므로 매일 새 데이터를 사용할 수 있습니다.
결제 이벤트 데이터는 변경할 수 없습니다.
다음 표에서는 데이터 피드 열의 이름과 설명을 설명합니다.
열 이름 | 설명 |
---|---|
billing_event_id | 결제 이벤트의 식별자입니다. 이 ID는 판매자의 환경에서 고유합니다. |
from_account_id |
결제 이벤트를 시작한 계정입니다.
|
to_account_id | 제품에 대한 거래 금액을 수취하는 계정입니다. 계정 데이터 피드에 대한 외래 키입니다.
|
end_user_account_id | 제품을 사용하는 계정입니다. 이 계정은 구매자 및 지급인 계정과 다를 수 있습니다.
|
product_id | 제품의 식별자입니다. 제품 데이터 피드에 대한 외래 키입니다.
|
작업 |
이 이벤트의 작업 유형입니다. 가능한 값은 다음과 같습니다.
|
transaction_type |
거래 유형입니다. 예시는 세금 시나리오 섹션을 참조하세요. 가능한 값은 다음과 같습니다.
|
parent_billing_event_id |
|
disbursement_billing_event_id |
그 외의 경우에는 이 값이 null입니다. |
amount | 결제 이벤트 금액입니다. |
currency | ISO 639 통화 코드입니다. |
balance_impacting | 판매자 지불액 계산 시 해당 금액이 고려되는지 여부입니다. 값이 0 이면 해당 금액이 정보 제공을 위해 표시된 것이며 잔액에는 영향을 주지 않습니다. 값이 1 이면 판매자 지불액을 결정할 때 이 금액이 고려됩니다. |
invoice_date | 인보이스가 발행된 날짜입니다. |
payment_due_date |
|
usage_period_start_date | 레코드에 있는 기간 시작 날짜입니다. |
usage_period_end_date | 레코드에 있는 기간 종료 날짜입니다. |
invoice_id |
AWS 인보이스 ID입니다. |
billing_address_id | 주소 데이터 피드에서 지급인의 청구지 주소 참조입니다.
|
transaction_reference_id |
다음 보고서의 데이터를 상호 참조할 수 있도록 하는 식별자입니다. |
bank_trace_id |
지급 거래( |
broker_id |
거래를 이끈 기업체의 식별자입니다. 가능한 값은 다음과 같습니다.
|
buyer_transaction_reference_id |
|
세금 시나리오
구매자와 판매자의 국가와 지방 정부의 과세 모델에 따라 세금을 수금하고 송금하는 방식이 달라집니다. 가능한 시나리오는 다음과 같습니다.
-
AWS에서 세금을 수금 및 송금합니다. 이 경우
transaction_type
은AWS_TAX_SHARE
입니다. -
AWS에서 세금을 수금한 후 판매자에게 지불하고 판매자가 이 세금을 세무 당국에 송금합니다. 이 경우
transaction_type
은SELLER_TAX_SHARE
입니다. -
AWS에서 세금을 수금하지 않습니다. 판매자가 세금을 계산하여 세무 당국에 송금해야 합니다. 이러한 경우 AWS Marketplace에서는 세금 계산을 수행하거나 세금 정보를 받지 않습니다. 판매자가 수익에서 세금을 지불합니다.
결제 이벤트 데이터 피드의 예
이 단원에서는 송장 발행 시점부터 한 달 이후의 결제 이벤트 데이터 기간에 대한 예를 보여줍니다. 이 단원의 모든 표에서 다음 사항에 유의하십시오.
-
데이터 피드에서
billing_event_id
값은 40자의 영숫자 문자열이지만, 여기서는 가독성을 위해 2자의 문자열로 표시되어 있습니다. -
데이터 피드에서 이 정보는 단일 테이블에 표시됩니다. 가독성을 위해 여기에는 데이터가 여러 표에 나와 있고 모든 열은 표시되어 있지 않습니다.
이 섹션의 예에서는 다음과 같이 가정합니다.
-
Arnav는 구매자입니다.
-
계정 ID는
737399998888
입니다. -
Marketplace Facilitator 법률이 적용되는 프랑스에 거주하고 있습니다. 자세한 내용은 Amazon Web Service 세금 도움말
을 참조하십시오. -
prod-o4grxfafcxxxx
를 구매했고 이 제품의 월 사용에 대해 120.60 USD의 인보이스를 받았습니다. -
그 달 안에 인보이스를 지불했습니다.
-
-
Jane은 제조업자입니다.
-
계정 ID는
111122223333
입니다.
-
-
Paulo는 등록 판매자입니다.
-
계정 ID는
777788889999
입니다. -
Marketplace Facilitator 법률이 적용되지 않는 미국 캔자스주에 거주하고 있습니다.
-
등록 판매자에 대한 결제 이벤트 데이터 피드
등록 판매자로서 Paulo는 구매자인 Arnav에게 인보이스를 발행합니다.
다음 표는 Paulo가 Arnav에게 인보이스를 발행할 때 Paulo의 데이터 피드에 포함되는 관련 정보를 보여줍니다.
billing_event_id | from_account_id | to_account_id | end_user_account_id | product_id | action | transaction_type |
---|---|---|---|---|---|---|
I0 | 737399998888 | 777788889999 | 737399998888 | prod-o4grxfafcxxxx | INVOICED | SELLER_REV_SHARE |
I1 | 737399998888 | AWS | 737399998888 | prod-o4grxfafcxxxx | INVOICED | AWS_TAX_SHARE |
I2 | 777788889999 | 111122223333 | 737399998888 | prod-o4grxfafcxxxx | INVOICED | SELLER_REV_SHARE |
I3 | 777788889999 | AWS | 737399998888 | prod-o4grxfafcxxxx | INVOICED | AWS_REV_SHARE |
parent_billing_event_id | disbursement_billing_event_id | amount | currency | invoice_date | invoice_id |
---|---|---|---|---|---|
100 | USD | 2018-12-31T00:00:00Z | 781216640 | ||
20.6 | USD | 2018-12-31T00:00:00Z | 781216640 | ||
-80 | USD | 2018-12-31T00:04:07Z | 788576665 | ||
-0.2 | USD | 2018-12-31T00:04:07Z | 788576665 |
다음 표는 Arnav가 인보이스 대금을 지불한 후 월말에 Paulo의 데이터 피드에 포함되는 관련 정보를 보여줍니다.
billing_event_id | from_account_id | to_account_id | end_user_account_id | product_id | action | transaction_type |
---|---|---|---|---|---|---|
I10 | 737399998888 | 777788889999 | 737399998888 | DISBURSED | SELLER_REV_SHARE | |
I12 | 777788889999 | 111122223333 | 737399998888 | DISBURSED | SELLER_REV_SHARE | |
I13 | 777788889999 | AWS | 737399998888 | prod-o4grxfafcxxxx | DISBURSED | AWS_REV_SHARE |
I14 | AWS | 777788889999 | DISBURSED | DISBURSEMENT |
parent_billing_event_id | disbursement_billing_event_id | amount | currency | invoice_date | invoice_id |
---|---|---|---|---|---|
I0 | I14 | -100 | USD | 2018-12-31T00:00:00Z | 781216640 |
I2 | I14 | 80 | USD | 2018-12-31T00:04:07Z | 788576665 |
I3 | I14 | 0.2 | USD | 2018-12-31T00:04:07Z | 788576665 |
19.8 | USD |
제조업자에 대한 결제 이벤트 데이터 피드
다음 표는 Paulo가 Arnav에게 인보이스를 발행할 때 Jane의 데이터 피드에 포함되는 관련 정보를 보여줍니다.
billing_event_id | from_account_id | to_account_id | end_user_account_id | product_id | action | transaction_type |
---|---|---|---|---|---|---|
I5 | 777788889999 | 111122223333 | prod-o4grxfafcxxxx | INVOICED | SELLER_REV_SHARE | |
I6 | 777788889999 | 111122223333 | prod-o4grxfafcxxxx | INVOICED | SELLER_TAX_SHARE | |
I7 | 111122223333 | AWS | prod-o4grxfafcxxxx | INVOICED | AWS_REV_SHARE |
parent_billing_event_id | disbursement_billing_event_id | amount | currency | invoice_date | invoice_id |
---|---|---|---|---|---|
73.5 | 2018-12-31T00:04:07Z | 788576665 | |||
6.5 | 2018-12-31T00:04:07Z | 788576665 | |||
-7.35 | 2018-12-31T00:04:07Z | 788576665 |
다음 표는 인보이스 대금이 지불된 후 월말에 Jane의 데이터 피드에 포함되는 관련 정보를 보여줍니다.
billing_event_id | from_account_id | to_account_id | end_user_account_id | product_id | action | transaction_type |
---|---|---|---|---|---|---|
I30 | 777788889999 | 111122223333 | prod-o4grxfafcxxxx | DISBURSED | SELLER_REV_SHARE | |
I31 | 777788889999 | 111122223333 | prod-o4grxfafcxxxx | DISBURSED | SELLER_TAX_SHARE | |
I32 | 111122223333 | AWS | prod-o4grxfafcxxxx | DISBURSED | AWS_REV_SHARE | |
I33 | AWS | 111122223333 | DISBURSED | DISBURSEMENT |
parent_billing_event_id | disbursement_billing_event_id | amount | currency | invoice_date | invoice_id |
---|---|---|---|---|---|
I5 | I33 | -73.5 | USD | ||
I6 | I33 | -6.5 | USD | ||
I7 | I33 | 7.35 | USD | ||
72.65 | USD |
쿼리 예제
데이터 피드를 사용하여 데이터 수집 및 분석에 설명된 대로 Athena를 사용하여 관리형 Amazon S3 버킷에 데이터 피드로 수집 및 저장된 데이터에 대한 쿼리를 실행할 수 있습니다. 이 단원에서는 이 작업을 수행하는 일반적인 방법의 몇 가지 예제를 제공합니다. 모든 예제에서는 단일 통화가 사용된다고 가정합니다.
예제 1: 세금을 포함한 인보이스 금액
세금을 포함하여 구매자에게 발행된 인보이스 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다.
SELECT sum(amount) FROM billing_event WHERE action = 'INVOICED' AND ( (transaction_type in ('SELLER_REV_SHARE', 'SELLER_TAX_SHARE') -- to discard SELLER_REV_SHARE from Manufacturer to Channel Partner, aka cost of goods AND to_account_id='
seller-account-id
' ) OR transaction_type= 'AWS_TAX_SHARE' );
예제 2: 판매자를 대신하여 구매자에게 발행된 인보이스 금액
판매자를 대신하여 구매자에게 발행된 인보이스 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다.
SELECT sum(amount) FROM billing_event WHERE action = 'INVOICED' AND transaction_type in ('SELLER_REV_SHARE', 'SELLER_TAX_SHARE') AND to_account_id='
seller-account-id
' ;
예제 3: 판매자를 대신하여 AWS에서 수금할 수 있는 금액
AWS가 환불, 크레딧, 면제된 계정을 제외하고 판매자를 대신하여 수금할 수 있는 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다.
SELECT sum(amount) FROM billing_event WHERE -- what is invoiced on behalf of SELLER, incl. refunds/ credits and cost of goods transaction_type like 'SELLER_%' -- FORGIVEN action records will "negate" related INVOICED and action in ('INVOICED','FORGIVEN') ;
예제 4: 판매자가 수금할 수 있는 금액
판매자가 수금할 수 있는 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다. 이 예제에서는 AWS에서 수금하는 등록 수수료 및 세금은 제외하고 예외적인 잔액 조정을 추가합니다.
SELECT sum(amount) FROM billing_event WHERE (transaction_type like 'SELLER_%' -- what is invoiced on behalf of SELLER or transaction_type like 'AWS_REV_%' -- what is owed to AWS or transaction_type = 'BALANCE_ADJUSTMENT' -- exceptionnal case ) and action in ('INVOICED','FORGIVEN') ;
또한 다음 예제처럼 다음 쿼리를 사용하여 동일한 정보를 수집할 수도 있습니다.
SELECT sum(amount) FROM billing_event WHERE balance_impacting = 1 and action in ('INVOICED','FORGIVEN') ;
다음 예제에서는 동일한 정보를 보여 주지만 2018년 거래로 제한되며 모든 구매자가 인보이스 대금을 지불했다고 가정합니다.
SELECT sum(amount) FROM billing_event WHERE invoice_date between '2018-01-01' and '2018-12-31' and balance_impacting = 1 and action in ('INVOICED','FORGIVEN') ;
예제 5: 지불 금액
지불된 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다.
select sum(amount) FROM billing_event WHERE action ='DISBURSED' and transaction_type like 'DISBURSEMENT%' ;
예제 6: 지불 보류 금액
지급 보류 중인 금액을 확인하려면 다음 예제처럼 쿼리를 실행하면 됩니다. 이 쿼리는 이미 지불된 금액을 제외합니다.
SELECT sum(amount) FROM billing_event targeted WHERE (transaction_type like 'SELLER_%' -- what is invoiced on behalf of SELLER or transaction_type like 'AWS_REV_%' -- what is owed to AWS or transaction_type = 'BALANCE_ADJUSTMENT' -- exceptionnal case ) -- DISBURSEMENT action records will "negate" 'INVOICED' -- but do not take into account failed disbursements AND (not exists (select 1 from billing_event disbursement join billing_event failed_disbursement on disbursement.billing_event_id=failed_disbursement.parent_billing_event_id where disbursement.transaction_type='DISBURSEMENT' and failed_disbursement.transaction_type='DISBURSEMENT_FAILURE' and targeted.disbursement_billing_event_id=disbursement.billing_event_id ) ) ;
동일한 정보를 얻는 또 다른 방법은 다음 예제처럼 쿼리를 실행하여 판매자의 잔액을 구하는 것입니다.
SELECT sum(amount) FROM billing_event WHERE balance_impacting = 1 ;
다음 쿼리는 예제를 확장하여 2018년 거래로 결과를 제한하고 거래에 대한 추가 정보를 반환합니다.
select sum(residual_amount_per_transaction) from (SELECT max(billed_invoices.amount) invoiced_amount, sum(nvl(disbursed_invoices.amount,0)) disbursed_amount, -- Exercise left to the reader: -- use transaction_type to distinguish listing fee vs seller-owed money -- still pending collection max(transaction_type) transaction_type, max(billed_invoices.amount) + sum(nvl(disbursed_invoices.amount,0)) residual_amount_per_transaction FROM billing_event billed_invoices -- find related disbursements left join billing_event disbursed_invoices on disbursed_invoices.action='DISBURSED' and disbursed_invoices.parent_billing_event_id=billed_invoices.billing_event_id WHERE billed_invoices.invoice_date between '2018-01-01' and '2018-12-31' and billed_invoices.transaction_type like 'SELLER_%' -- invoiced on behalf of SELLER and billed_invoices.action in ('INVOICED','FORGIVEN') -- do not take into account failed disbursements AND not exists (select 1 from billing_event failed_disbursement where disbursed_invoices.disbursement_billing_event_id = failed_disbursement.parent_billing_event_id ) GROUP BY billed_invoices.billing_event_id );
예제 7: 인보이스 세트의 잔액
인보이스 세트의 합계를 알아보려면 다음 예제처럼 쿼리를 실행하면 됩니다.
SELECT invoice_id, sum(amount) FROM billing_event targeted WHERE -- invoice_id is only not null for invoiced records AND disbursed records -- linking them to related disbursement -> no need to filter more precisely invoice_id in ('XXX','YYY') -- filter out failed disbursements AND not exists (select 1 from billing_event disbursement join billing_event failed_disbursement on disbursement.billing_event_id=failed_disbursement.parent_billing_event_id where disbursement.transaction_type='DISBURSEMENT' and failed_disbursement.transaction_type='DISBURSEMENT_FAILURE' and targeted.disbursement_billing_event_id=disbursement.billing_event_id ) group by invoice_id;