#nicosix.
1 messages · Page 1 of 1 (latest)
hi! hmm, not sure I understand. That code hows how to create them. Was there some error when you tried?
what version of stripe-python are you using?
looking at the types(I don't use Python much and the types we added are new) I agree the type is Reversal yes.
Hi, let me check the version, I think we have a recent one
But my IDE is not able to find the create method for reversal, although it can find create for other objects
because there is no create method
you create them using an instance method on a Transfer like the API ref mentions
oh indeed! So knowing the transfer ID I'd have to first recreate my transfer object, then use create_reversal?
you have to retrieve the Transfer object yes and then call create_reversal on it
this is because in the underlying API instead of it being a top-level API like /v1/transfer_reversals , it is instead a nested resource of a Transfer, like /v1/transfers/tr_xxx/reversals
and the way that works in the SDKs is you need to have a Transfer object so we know the ID and can put it into the URL we need to call
that pattern of nested resources is something we try to avoid nowadays in new parts of the API since it causes this type of problem in the SDKs but it's just how the Transfer API exists today
Alright, I see, thanks!
I think our Stripe lib is quite outdated, pip freeze gives me stripe==3.0.0
if you decide to update make sure to read the changelog and migration guides in Github since there are breaking changes and the overall approach of the library changed in recent months https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#600---2023-08-16