Manage virtual cards on Extend
Project description
Extend API
Programmatically manage virtual cards on Extend
[!CAUTION] This is an unofficial client that is not affiliated with or endorsed by Extend. Using this client may violate Extend's Terms of Service. By using this client, you acknowledge and accept all associated risks.
Installation
pip install extend-vcc
Device Verification
- Login to the Extend dashboard
- Open the browser's developer tools
- Run the following JavaScript in the console:
function lookup(suffix) {
const key = Object.keys(localStorage).find(
(key) =>
key.startsWith("CognitoIdentityServiceProvider") && key.endsWith(suffix)
);
if (!key) return;
console.log(suffix, localStorage[key]);
}
lookup("deviceGroupKey");
lookup("deviceKey");
lookup("randomPasswordKey");
Quick Start
Initialize the client
from extend_vcc import Client
from extend_vcc.cognito import Cognito, AuthParams
# Initialize authentication
auth = Cognito(AuthParams(
username="user@email.com",
password="password",
device_group_key="device_group_key", # deviceGroupKey from browser
device_key="device_key", # deviceKey from browser
device_password="device_password", # randomPasswordKey from browser
))
# Create client
client = Client(auth)
Create a virtual card
from extend_vcc.virtual_card import CreateVirtualCardOptions
from extend_vcc.types import Currency
from datetime import datetime, timedelta
card = client.create_virtual_card(CreateVirtualCardOptions(
credit_card_id="cc_id",
display_name="Team Expenses",
balance_cents=10000,
currency=Currency.USD,
valid_to=datetime.now() + timedelta(days=30),
recipient="team@company.com",
notes="This card is for team expenses"
))
Get a virtual card
card = client.get_virtual_card("vc_id")
Cancel a virtual card
card = client.cancel_virtual_card("vc_id")
Close a virtual card
card = client.close_virtual_card("vc_id")
List virtual cards with pagination
from extend_vcc.types import PaginationOptions, SortDirection
from extend_vcc.virtual_card import ListVirtualCardsOptions, VirtualCardStatus
# Create listing options
options = ListVirtualCardsOptions(
pagination_options=PaginationOptions(
page=0,
count=10,
sort_direction=SortDirection.ASC,
sort_field="activeClosedUpdatedAt"
),
cardholder_or_viewer="me",
issued=True,
statuses=[VirtualCardStatus.ACTIVE]
)
# Get paginator
cards = client.list_virtual_cards(options)
# Iterate through pages
for page in cards:
for card in page.items():
# Process each card
print(f"Card: {card.display_name}")
Bulk create virtual cards
from extend_vcc.virtual_card import BulkCreateVirtualCard, VirtualCardType
from datetime import datetime, timedelta
# Prepare card configurations
cards = [
BulkCreateVirtualCard(
card_type=VirtualCardType.STANDARD,
recipient="user1@company.com",
display_name="Marketing Card 1",
balance_cents=10000,
valid_to=datetime.now() + timedelta(days=30)
),
BulkCreateVirtualCard(
card_type=VirtualCardType.STANDARD,
recipient="user2@company.com",
display_name="Marketing Card 2",
balance_cents=20000,
valid_to=datetime.now() + timedelta(days=30)
)
]
# Create cards in bulk
upload = client.bulk_create_virtual_cards("cc_id", cards)
# Check bulk upload status
status = client.get_bulk_virtual_card_upload(upload.bulk_virtual_card_push.bulk_virtual_card_upload_id)
Contributing
Contributions are welcome! Please see our contributing guidelines for more details.
License
Support
For issues, please open a GitHub issue in the repository.
Credits
This is a python version of the golang package made by saucesteals which can be found here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file extend_vcc-0.1.6.tar.gz.
File metadata
- Download URL: extend_vcc-0.1.6.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04be03647527eda9b507ec7ea50c9f7df1add9f19ec6596d609535b5bfd4af88
|
|
| MD5 |
d65fbda1eb2b2106c1464620114df469
|
|
| BLAKE2b-256 |
cbec1c0d8ca065e11b26551d3b72787710ba4e4708c799d1d93eaf36f49cd6f6
|
Provenance
The following attestation bundles were made for extend_vcc-0.1.6.tar.gz:
Publisher:
python-publish.yml on christianobora/extend-vcc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extend_vcc-0.1.6.tar.gz -
Subject digest:
04be03647527eda9b507ec7ea50c9f7df1add9f19ec6596d609535b5bfd4af88 - Sigstore transparency entry: 156789153
- Sigstore integration time:
-
Permalink:
christianobora/extend-vcc@75c25619b2136104d01a309335531c182a59a807 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/christianobora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@75c25619b2136104d01a309335531c182a59a807 -
Trigger Event:
release
-
Statement type:
File details
Details for the file extend_vcc-0.1.6-py3-none-any.whl.
File metadata
- Download URL: extend_vcc-0.1.6-py3-none-any.whl
- Upload date:
- Size: 21.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38fcaac29eb3f5a1c062716ffd169d27df36b580ace69c81e06d08cb64f03c69
|
|
| MD5 |
d9ad6248e36fab83508c4320056f2b56
|
|
| BLAKE2b-256 |
599ebb46555caeb85b618b0e8b322f189df69d66b8d18a59065824a038042d92
|
Provenance
The following attestation bundles were made for extend_vcc-0.1.6-py3-none-any.whl:
Publisher:
python-publish.yml on christianobora/extend-vcc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
extend_vcc-0.1.6-py3-none-any.whl -
Subject digest:
38fcaac29eb3f5a1c062716ffd169d27df36b580ace69c81e06d08cb64f03c69 - Sigstore transparency entry: 156789154
- Sigstore integration time:
-
Permalink:
christianobora/extend-vcc@75c25619b2136104d01a309335531c182a59a807 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/christianobora
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@75c25619b2136104d01a309335531c182a59a807 -
Trigger Event:
release
-
Statement type: