uber/rides-python-sdk

Is there a way to apply promocode using SDK?

BakanovKirill opened this issue · 6 comments

curl -X PATCH -H "Authorization: Bearer "
-H "Content-Type: application/json"
-d '{
"applied_promotion_codes": "mypromo"
}' "https://api.uber.com/v1.2/me"

Is this function existing?

I didn't find anything related to applied_promotion_codes in the sources

Hi,

We do not currently support this endpoint in the sdk, but we will note it as a feature request. You can access the underlying request library using the api client:

client._api_call('PATCH', 'v1.2/me', { 'applied_promotion_codes': 'xxx' })

I haven't implemented and tested yet, but 9ef271e should work.

thanks. It works. I used requests library before you answered me, but this approach looks nicer.

Also is there a way to revert applying promocode? Cause i can't test it without buying real events. (And i don't wanna make mocks because API can change)

There is not currently a way to remove a promo code from a rider account.

Merged to master and resolved. I will release a new sdk version with more updated next week.