#nicosix.

1 messages · Page 1 of 1 (latest)

old loomBOT
limber plume
#

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.

wooden magnet
#

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

limber plume
#

because there is no create method

#

you create them using an instance method on a Transfer like the API ref mentions

wooden magnet
#

oh indeed! So knowing the transfer ID I'd have to first recreate my transfer object, then use create_reversal?

limber plume
#

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

wooden magnet
#

Alright, I see, thanks!

#

I think our Stripe lib is quite outdated, pip freeze gives me stripe==3.0.0

limber plume