Skip to content

Instantly share code, notes, and snippets.

@clintonb
Created March 1, 2016 20:39
Show Gist options
  • Save clintonb/ed7237a5d308bb80c58c to your computer and use it in GitHub Desktop.
Save clintonb/ed7237a5d308bb80c58c to your computer and use it in GitHub Desktop.
Delete Otto baskets
from edx_rest_api_client.client import EdxRestApiClient
ACCESS_TOKEN = ''
basket_ids = []
api_client = EdxRestApiClient('https://ecommerce.stage.edx.org/api/v2/', oauth_access_token=ACCESS_TOKEN)
for basket_id in basket_ids:
if not api_client.baskets(basket_id).delete():
print('Failed to delete basket [{}].'.format(basket_id))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment