Skip to content

Commit

Permalink
Updated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
arnav13081994 committed Dec 17, 2022
1 parent aee6021 commit a39f6d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions djstripe/management/commands/djstripe_sync_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
7) To only sync Stripe Accounts and Charges for sk_test_XXX and sk_test_YYY API keys:
python manage.py djstripe_sync_models Account Charge --api-keys sk_test_XXX sk_test_YYY
6) To only sync Stripe Accounts for sk_test_XXX and sk_test_YYY API keys for objects created after {unix_timestamp}:
python manage.py djstripe_sync_models Account --api-keys sk_test_XXX sk_test_YYY --created "{\"gt\": {unix_timestamp}}"
7) To only sync Stripe Accounts and Charges for sk_test_XXX and sk_test_YYY API keys for objects created between {unix_gt_timestamp} and {unix_lt_timestamp}:
python manage.py djstripe_sync_models Account Charge --api-keys sk_test_XXX sk_test_YYY --created "{\"gte\": {unix_gt_timestamp}, \"lte\": {unix_lt_timestamp}}"
"""
import json
from typing import Dict, List, Union
Expand Down
6 changes: 6 additions & 0 deletions docs/usage/manually_syncing_with_stripe.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ A list of models to sync can also be provided along with the API Keys.
```
This will sync all the Invoice and Subscription data for the given API Keys. Please note that the API Keys sk_test_YYY and sk_test_XXX need to be in the database.

An Optional Kwarg `created` can be added to restrict syncing objects created between a certain timeperiod as mentioned in the [Stripe docs.](https://stripe.com/docs/api/customers/list#list_customers-created). Please note that the `created` kwarg is not supported by all Stripe models and we silently ignore it is the model being synced does not support it.

```bash
./manage.py djstripe_sync_models Invoice Subscription --api-keys sk_test_XXX sk_test_YYY --created "{\"gte\": {unix_gt_timestamp}, \"lte\": {unix_lt_timestamp}}"
```

You can manually reprocess events using the management commands
[`djstripe_process_events`][djstripe.management.commands.djstripe_process_events]. By default this processes all events, but
options can be passed to limit the events processed. Note the Stripe API
Expand Down

0 comments on commit a39f6d0

Please sign in to comment.