Skip to main content

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

  1. Login to the Extend dashboard
  2. Open the browser's developer tools
  3. 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

MIT

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

Metadata

Release files for extend-vcc 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extend-vcc 0.1.6
File Size Uploaded
extend_vcc-0.1.6.tar.gz 20.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for extend-vcc 0.1.6
File Interpreter ABI Platform
extend_vcc-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 41.3 kB

Release files / extend_vcc-0.1.6.tar.gz

Download URL extend_vcc-0.1.6.tar.gz
Size 20.0 kB
Tags Source
SHA-256 checksum
How to use checksums
04be03647527eda9b507ec7ea50c9f7df1add9f19ec6596d609535b5bfd4af88
BLAKE2b-256 checksum
How to use checksums
cbec1c0d8ca065e11b26551d3b72787710ba4e4708c799d1d93eaf36f49cd6f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release files / extend_vcc-0.1.6-py3-none-any.whl

Download URL extend_vcc-0.1.6-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38fcaac29eb3f5a1c062716ffd169d27df36b580ace69c81e06d08cb64f03c69
BLAKE2b-256 checksum
How to use checksums
599ebb46555caeb85b618b0e8b322f189df69d66b8d18a59065824a038042d92
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.0.1 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 19, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page