Skip to content

Latest commit

 

History

History
166 lines (111 loc) · 3.88 KB

File metadata and controls

166 lines (111 loc) · 3.88 KB

delete

Delete a customer source

Delete a specified source for a given customer.

API Endpoint: DELETE /v1/customers/{customer}/sources/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.delete(customer="string", id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.delete(customer="string", id="string")

list

GET /v1/customers/{customer}/sources

List sources for a specified customer.

API Endpoint: GET /v1/customers/{customer}/sources

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.list(customer="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.list(customer="string")

get

GET /v1/customers/{customer}/sources/{id}

Retrieve a specified source for a given customer.

API Endpoint: GET /v1/customers/{customer}/sources/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.get(customer="string", id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.get(customer="string", id="string")

create

Create a card

When you create a new credit card, you must specify a customer or recipient on which to create it.

If the card’s owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should update the customer to have a new default_source.

API Endpoint: POST /v1/customers/{customer}/sources

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.create(customer="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.create(customer="string")

update

POST /v1/customers/{customer}/sources/{id}

Update a specified source for a given customer.

API Endpoint: POST /v1/customers/{customer}/sources/{id}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.update(customer="string", id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.update(customer="string", id="string")

verify

Verify a bank account

Verify a specified bank account for a given customer.

API Endpoint: POST /v1/customers/{customer}/sources/{id}/verify

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.customer.source.verify(customer="string", id="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.customer.source.verify(customer="string", id="string")