Strike API
Accounts
- strike_api.accounts.get_account(account_id: Optional[str] = None, handle: Optional[str] = None) Account [source]
Fetch public account profile info by id or handle
- Parameters
account_id (Optional[str]) – Account id
handle (Optional[str]) – Handle attached to the account to fetch
- Returns
account schema
- Return type
Base
- strike_api.base.call_api(method: str, url: str, headers: Optional[Dict[str, str]] = None, params: Optional[Union[Dict[str, Any], str]] = None, data: Optional[Union[Dict[str, str], str]] = None) Union[Dict[str, Any], List[Dict[str, Any]]] [source]
Generic method to interact with strike API endpoints
- Parameters
method (str) – HTTP Method
url (str) – Fully qualifed url to interact with a strike endpoint
headers (Optional[Dict[str, str]], optional) – HTTP Headers. Defaults to None.
params (Optional[Union[Dict[str, Any], str]], optional) – params to pass to Strike as query string. Defaults to None.
data (Optional[Union[Dict[str, str], str]], optional) – Data to pass to Strike as body. Defaults to None.
- Returns
response from api call
- Return type
Union[ Dict[str, Any], List[Dict[str, Any]] ]
- strike_api.base.set_default_headers(headers: Optional[Dict[str, str]] = None) Dict[str, str] [source]
Sets the default headers for strike api HTTP requests
- Parameters
headers (Optional[Dict[str, str]], optional) – HTTP Headers. Defaults to None.
- Raises
EnvironmentError – When STRIKE_API_KEY is not found in system environment variables
- Returns
headers with default headers included
- Return type
Dict[str, str]
Events
- strike_api.events.get_event(event_id: str) Event [source]
Finds an event by event id.
- Parameters
event_id (str) – id of the event
- Returns
an event object
- Return type
- strike_api.events.get_events(filter_: Optional[str] = None, orderby: Optional[str] = None, skip: Optional[int] = None, top: Optional[int] = None) EventItems [source]
Gets a list of events matching optional search criteria. Required scopes: partner.webhooks.manage OData filtering syntax can be seen here. Ordering syntax can be seen here.
- Parameters
filter (Optional[str], optional) – Filter the results using OData syntax. Supported properties: created, eventType, deliverySuccess.. Defaults to None.
orderby (Optional[str], optional) – Order the results using OData syntax. Supported properties: created.. Defaults to None.
skip (Optional[int], optional) – Skip the specified number of entries.. Defaults to None.
top (Optional[int], optional) – Get the top X number of records. Default value: 50. Max value: 100.. Defaults to None.
- Returns
list of events and the count
- Return type
Invoices
- strike_api.invoices.cancel_invoice(invoice_id: str) Invoice [source]
Cancel an unpaid invoice
- Parameters
invoice_id (str) – Id of invoice for which the cancellation is requested
- Returns
invoice
- Return type
- strike_api.invoices.get_invoice(invoice_id: str) Invoice [source]
Gets an invoice by it’s id
- Parameters
invoice_id (str) – An invoice id
- Returns
invoice
- Return type
- strike_api.invoices.get_invoices(filter_: Optional[str] = None, orderby: Optional[str] = None, skip: Optional[int] = None, top: Optional[int] = None) InvoiceItems [source]
Get invoices with optional search criteria. Required scopes: partner.webhooks.manage OData filtering syntax can be seen here. Ordering syntax can be seen here.
- Parameters
filter (Optional[str], optional) – Filter the results using OData syntax. Supported properties: invoiceId, created, currency, state, issuerId, receiverId, payerId, correlationId.. Defaults to None.
orderby (Optional[str], optional) – Order the results using OData syntax. Supported properties: created. Defaults to None.
skip (Optional[int], optional) – Skip the specified number of entries. Defaults to None.
top (Optional[int], optional) – Get the top X number of records. Default value: 50. Max value: 100. Defaults to None.
- Returns
List of invoices and a count
- Return type
- strike_api.invoices.issue_invoice(handle: Optional[str] = None, correlation_id: Optional[str] = None, description: Optional[str] = None, currency: Optional[str] = None, amount: Optional[str] = None) Invoice [source]
- Issue a new invoice
Only currencies which are invoiceable for the caller’s account can be used. Invoiceable currencies can be found using get account profile endpoint.
- Parameters
handle (Optional[str], optional) – handle, if specifying a receiver. Defaults to None.
correlation_id (Optional[str], optional) – Invoice correlation id. Must be a unique value. Can be used to correlate the invoice with an external entity. Defaults to None.
description (Optional[str], optional) – Invoice description. Defaults to None.
currency (Optional[str], optional) – Currency code [BTC, USD, EUR, USDT, GBP]. Defaults to None.
amount (Optional[str], optional) – Currency amount in decimal format. Defaults to None.
- Returns
_description_
- Return type
Rates
Subscriptions
- strike_api.subscriptions.create_subscription(webhook_url: str, webhook_version: str, secret: str, enabled: bool, event_type: List[str]) Subscription [source]
Creates a new subscription. You can create at most 50 subscriptions.
- Parameters
webhook_url (str) – Webhook HTTPS endpoint url.
webhook_version (str) – Version that will be used when formatting the webhook payload.
secret (str) – Webhook secret that will be used for signing the request.
enabled (bool) – Flag for enabling/disabling the subscription. If subscription is disabled the webhook won’t be triggered for the respective event types.
event_type (List[str]) – List of event types for the subscription. Each time that some event type from the list occurs, the webhook will be triggered.
- Returns
The created subscription.
- Return type
- strike_api.subscriptions.delete_subscription(subscription_id: str) None [source]
Delete a subscription
- Parameters
subscription_id (str) – Id of subscription to delete
- Returns
None
- strike_api.subscriptions.get_subscription(subscription_id: str) Subscription [source]
Get subscription by id
- Parameters
subscription_id (str) – id of subscription
- Returns
subscription
- Return type
- strike_api.subscriptions.get_subscriptions() Subscriptions [source]
Get subscriptions
- Returns
list of subscriptions
- Return type
- strike_api.subscriptions.update_subscription(subscription_id: str, webhook_url: str, webhook_version: str, secret: str, enabled: bool, event_type: List[str]) Subscription [source]
Update a subscription.
- Parameters
subscription_id (str) – Id of subscription to update.
webhook_url (str) – Webhook HTTPS endpoint url.
webhook_version (str) – Version that will be used when formatting the webhook payload.
secret (str) – Webhook secret that will be used for signing the request.
enabled (bool) – Flag for enabling/disabling the subscription. If subscription is disabled the webhook won’t be triggered for the respective event types.
event_type (List[str]) – List of event types for the subscription. Each time that some event type from the list occurs, the webhook will be triggered.
- Returns
The updated subscription.
- Return type