#logonoff

1 messages ยท Page 1 of 1 (latest)

spring elmBOT
patent pulsar
#

Could you share a bit more context here? Are you using manual or automatic payouts?

shadow zinc
#

Sure! Connected account has automatic payouts enabled.

Let's say I created a transfer to that account

โžœ stripe transfers retrieve tr_1MDuBWENxjodxCKlFPpBeNbf                                                                                                                                                                                                   {
  "id": "tr_1MDuBWENxjodxCKlFPpBeNbf",
  "object": "transfer",
  "amount": 4278,
  "amount_reversed": 0,
  "balance_transaction": "txn_1MDuBWENxjodxCKl5LFR9diX",
  "created": 1670783014,
  "currency": "usd",
  "description": "Payout for statement 3a5ae9d7-007c-4ea2-9fbe-f3cff11c28af",
  "destination": "acct_1MC64FEPfvmnS5SL",
  "destination_payment": "py_1MDuBWEPfvmnS5SLOj472Pj8",
  "livemode": false,
  "metadata": {},
  "reversals": {
    "object": "list",
    "data": [],
    "has_more": false,
    "total_count": 0,
    "url": "/v1/transfers/tr_1MDuBWENxjodxCKlFPpBeNbf/reversals"
  },
  "reversed": false,
  "source_transaction": null,
  "source_type": "card",
  "transfer_group": null
}

I can look up charge created for that transfer

stripe charges retrieve py_1MDuBWEPfvmnS5SLOj472Pj8 --stripe-account acct_1MC64FEPfvmnS5SL        ```
#

It points to balance transaction on the connected account

  "id": "txn_1MDuBWEPfvmnS5SLOJwAzg6z",
  "object": "balance_transaction",
  "amount": 4278,
  "available_on": 1670783014,
  "created": 1670783014,
  "currency": "usd",
  "description": null,
  "exchange_rate": null,
  "fee": 0,
  "fee_details": [],
  "net": 4278,
  "reporting_category": "charge",
  "source": "py_1MDuBWEPfvmnS5SLOj472Pj8",
  "status": "available",
  "type": "payment"
}



#

And I know there's a payout created for it

stripe payouts retrieve po_1ME0pWEPfvmnS5SLBAK5j44F  --stripe-account acct_1MC64FEPfvmnS5SL                                                                                                                                                             {
  "id": "po_1ME0pWEPfvmnS5SLBAK5j44F",
  "object": "payout",
  "amount": 4278,
  "arrival_date": 1670803200,
  "automatic": true,
  "balance_transaction": "txn_1ME0pWEPfvmnS5SLfEYzNBzX",
  "created": 1670808558,
  "currency": "usd",
  "description": "STRIPE PAYOUT",
  "destination": "ba_1MC67IEPfvmnS5SLO4IxlIkx",
  "failure_balance_transaction": null,
  "failure_code": null,
  "failure_message": null,
  "livemode": false,
  "metadata": {},
  "method": "standard",
  "original_payout": null,
  "reversed_by": null,
  "source_type": "card",
  "statement_descriptor": null,
  "status": "paid",
  "type": "bank_account"
}
plain ivy
#

๐Ÿ‘‹ stepping in

#

roadrunner had to step away

shadow zinc
#

So I'm trying to get to that payout through all that objects, sorry for all that JSON

plain ivy
#

So you want to go from Payout on Connected Account to original transfer on platform, correct?

shadow zinc
#

The other way - I know transfer id for the connected account and I want to see if there's a successful payout with it

plain ivy
#

Ah

#

Then you would have to list balance transactions by payout on that Connected Account

#

So really not a good way to do this unfortunately

shadow zinc
#

So if I want to find payout I would need to enumerate all of them and match with transactions I have? ok

plain ivy
#

Yes that's correct if you want to go transfer --> payout

shadow zinc
#

Got it, thanks you!!!

plain ivy
#

Yeah that said to help you you can also list Payouts based on the timestamp

#

So you don't just loop through all the payouts

shadow zinc
#

Yup, that's what I'm planning

plain ivy
#

And you can look at the balance_transaction's available_on