Account の残高を銀行口座に資金を移動することを「入金」と呼ぶ。英語のドキュメントでは「Payout」と書かれている。このとき、移動できるのは available な残高だけだ。
図
Buyer Seller
Card Bank
: ^
: |
: [Payout] 👈
: ^
: |
Payment Method -> [Charge] -> [Balance Transaction] -> Account
: |
[Payment Intent] v fee
Stripe
※ 昨日書き忘れてたけど、最初の支払いが正常に受領されてから、少なくとも 7 日後に入金可能となる。
Scheduled Payout
スケジュールとして、毎月、毎週、手動のいずれかを、ダッシュボードで指定できる。
毎月の場合は、毎月の何日かを指定する。31 日とかを指定したとき、31 日がない月では末日を指定したことになる。毎週の場合は、曜日を指定する。休日・祝日のときにどう動くかはドキュメントされていない。
毎月・毎週のいずれの場合も、Payout 処理時点で available な残高すべてが対象になる。また、対象となった Balance Transaction を追跡できる。このあたりは、Reconsiliation(消込)と関係してくるので、明後日くらいに見ていく。
Manual Payouts
手動を指定すると、ダッシュボードまたは API で明示的に金額を指定して payout する。Payout 対象となった Balance Transaction がどれか、というひもづけは行われない。
curl https://api.stripe.com/v1/payouts \
-u sk_xxxx: \
-d amount=5000 \
-d currency=jpy
Payout の Balance Transaction
Payout を実行すると、Account の残高が減るという残高変化を表す Balance Transaction が作られる。
Buyer Seller
Card Bank
: ^
: |
: [Payout]
: [Balance Transaction]👈
: ^
: |
Payment Method -> [Charge] -> [Balance Transaction] -> Account
: |
[Payment Intent] v fee
Stripe
request
curl https://api.stripe.com/v1/payouts/po_xxxx \
-u sk_xxxx: \
-d "expand[]"=balance_transaction
response
{
"id": "po_xxxx",
"amount": 1523825, # Payout の金額は正
"balance_transaction": {
"id": "txn_xxxx",
"currency": "jpy",
"amount": -1523825,
"fee": 0,
"net": -1523825, # 残高は減るので負
"created": 1635444020, # 2021-10-29 03:00:20 JST
"available_on": 1635692400, # 2021-11-01 00:00:00 JST 翌営業日っぽい
...
},
...
}
まとめ
Payout のタイミングと指定方法まで見られた。明日は、Refudns と Disputes を見ていく。