This is a Beta release of the OpenAPI specification for Rapyd's API methods. It is recommended to initially run the methods in the sandbox environment. For the most uptodate documentation of Rapyd's methods, see the [online API Reference](https://docs.rapyd.net/en/index-en.html).
Project description
RapydSdk Python SDK 1.0.9
Welcome to the RapydSdk SDK documentation. This guide will help you get started with integrating and using the RapydSdk SDK in your project.
Versions
- API version:
1.0.9
- SDK version:
1.0.9
About the API
This is a Beta release of the OpenAPI specification for Rapyd's API methods. It is recommended to initially run the methods in the sandbox environment. For the most uptodate documentation of Rapyd's methods, see the online API Reference.
Table of Contents
Setup & Configuration
Supported Language Versions
This SDK is compatible with the following versions: Python >= 3.7
Installation
To get started with the SDK, we recommend installing using pip
:
pip install rapyd-sdk
Environments
The SDK supports different environments for various stages of development and deployment.
Here are the available environments:
DEFAULT = "https://sandboxapi.rapyd.net"
SANDBOX = "https://sandboxapi.rapyd.net"
PRODUCTION = "https://api.rapyd.net"
Setting an Environment
To configure the SDK to use a specific environment, you can set the base URL as follows:
from rapyd_sdk import Environment
sdk.set_base_url(Environment.Sandbox.value)
Environment Variables
These are the environment variables for the SDK:
Name | Description |
---|---|
ACCESS_KEY | Access Key parameter |
SECRET_KEY | Secret Key parameter |
Environment variables are a way to configure your application outside the code. You can set these environment variables on the command line or use your project's existing tooling for managing environment variables.
If you are using a .env
file, a template with the variable names is provided in the .env.example
file located in the same directory as this README.
Setting a Custom Timeout
You can set a custom timeout for the SDK's HTTP requests as follows:
from rapyd_sdk import RapydSdk
sdk = RapydSdk(timeout=10000)
Sample Usage
Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:
from rapyd_sdk import RapydSdk, Environment
sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)
result = sdk.e_wallets.get_users(
phone_number="phone_number",
email="email",
ewallet_reference_id="ewallet_reference_id",
page_number=3,
page_size=1.02,
type_="type",
min_balance=2.45,
currency="currency"
)
print(result)
Services
The SDK provides various services to interact with the API.
Below is a list of all available services:
Name |
---|
e_wallets |
virtual_accounts |
disburse |
fx |
issuing |
checkout_page |
coupon |
customer |
customer_payment_method |
digital_wallet |
dispute |
escrow |
group_payment |
subscription_invoice |
order |
order_return |
payment_method_type |
payment_link |
payment_card_token |
payment |
payment_address |
subscription |
subscription_plan |
subscription_product |
refund |
subscription_subscription_item |
sku |
verify |
Models
The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.
Below is a list of all available models:
Name | Description |
---|---|
AccountTransferBody | |
InlineResponse200 | |
TransferResponseBody | |
InlineResponse200_1 | |
EwalletIdContactsBody | |
InlineResponse200_2 | |
Contact | |
InlineResponse200_3 | |
InlineResponse200_4 | |
InlineResponse200_21 | |
V1EwalletsBody | |
InlineResponse200_22 | |
EwalletsEwalletTokenBody | |
InlineResponse200_23 | |
UpdateEwalletStatusStatus | |
AccountLimitsBody | |
InlineResponse200_24 | |
InlineResponse200_25 | |
InlineResponse200_26 | |
InlineResponse200_27 | |
InlineResponse200_28 | |
V1VirtualAccountsBody | |
InlineResponse200_5 | |
VirtualAccountsTransactionsBody | |
InlineResponse200_6 | |
InlineResponse200_7 | |
VirtualAccountsVirtualAccountIdBody | |
InlineResponse200_8 | |
InlineResponse200_9 | |
InlineResponse200_10 | |
InlineResponse200_11 | |
V1PayoutsBody | |
InlineResponse200_12 | |
PayoutsBeneficiaryBody | |
InlineResponse200_13 | |
PayoutsExtendedBeneficiaryBody | |
BeneficiaryValidateBody | |
InlineResponse200_14 | |
InlineResponse200_15 | |
PayoutsSenderBody | |
InlineResponse200_16 | |
InlineResponse200_17 | |
InlineResponse200_18 | |
PayoutsPayoutIdBody | |
InlineResponse200_19 | |
InlineResponse200_20 | |
IssuingBankaccountsBody | |
InlineResponse200_29 | |
BankaccountsBankaccounttransfertobankaccountBody | |
InlineResponse200_30 | |
InlineResponse200_31 | |
BankaccountsVirtualAccountIdBody | |
InlineResponse200_32 | |
InlineResponse200_33 | |
InlineResponse200_34 | |
V1CheckoutBody | |
InlineResponse200_35 | |
Coupon | The coupon can be applied to the following objects - _ Subscription - All charges in the subscription are subject to the discount described in the coupon. To add a coupon to a subscription, first use Create Coupon. Then add the coupon ID to the coupon field of the subscription with Create Subscription or Update Subscription. _ Customer - The discount applies to all charges to the customer. To add a coupon to a customer, first use Create Coupon. Then add the coupon ID to the coupon field of the customer with Create Customer or Update Customer. * Order - The discount applies to a single order. To add a coupon to an order, first use Create Coupon. The duration field of the coupon must be set to repeating, and the duration_in_months and discount_duration_in_uses fields must be set to 1. Then add the coupon ID to the coupon field of the order with Create an Order or Update Order. A coupon can be applied to one or more customers or subscriptions. However, a subscription can have only one coupon, and the only way to assign two or more coupons to a customer is to assign them to separate subscriptions. If there is a coupon for the customer and another coupon for the customer's subscription, the subscription coupon takes precedence. |
InlineResponse200_36 | |
InlineResponse200_37 | |
InlineResponse200_38 | |
V1CustomersBody | |
InlineResponse200_39 | |
CustomerRequest | |
InlineResponse200_40 | |
InlineResponse200_41 | |
InlineResponse200_42 | |
InlineResponse200_43 | |
Category | |
CustomerIdPaymentMethodsBody | |
InlineResponse200_44 | |
CustomerPaymentMethod | Describes the fields contained in REST messages and webhooks for payment methods saved to a customer profile |
InlineResponse200_45 | |
ApplePayObject | |
InlineResponse200_46 | |
InlineResponse200_47 | |
GetDisputesListByOrgIdStatus | |
InlineResponse200_48 | |
InlineResponse200_49 | |
EscrowEscrowReleasesBody | |
InlineResponse200_50 | |
PaymentsGroupPaymentsBody | |
InlineResponse200_51 | |
InlineResponse200_52 | |
Customer | customer |
InlineResponse200_53 | |
InvoicesInvoiceIdBody | |
InvoiceIdPayBody | |
InlineResponse200_54 | |
V1OrdersBody | |
InlineResponse200_55 | |
OrdersOrderIdBody | |
OrderIdPayBody | |
OrderIdReturnsBody | |
InlineResponse200_56 | |
InlineResponse200_57 | |
InlineResponse200_58 | |
InlineResponse200_59 | |
InlineResponse200_60 | |
CollectPaymentsBody | |
CollectCardBody | |
InlineResponse200_61 | |
InlineResponse200_62 | |
V1PaymentsBody | |
InlineResponse200_63 | |
PaymentsPaymentIdBody | |
Address | address associated with this specific Rapyd entity Payment/Customer etc... |
InlineResponse200_64 | |
InlineResponse200_65 | |
PaymentsSubscriptionsBody | |
InlineResponse200_66 | |
SubscriptionsSubscriptionIdBody | |
InlineResponse200_67 | |
InlineResponse200_68 | |
InlineResponse200_82 | |
InlineResponse200_69 | |
V1PlansBody | |
InlineResponse200_70 | |
PlansPlanIdBody | |
InlineResponse200_71 | |
InlineResponse200_72 | |
V1ProductsBody | |
InlineResponse200_73 | |
ProductsProductsIdBody | |
InlineResponse200_74 | |
V1RefundsBody | |
InlineResponse200_75 | |
RefundsCompleteBody | |
RefundsGroupPaymentsBody | |
InlineResponse200_76 | |
RefundsRefundIdBody | |
InlineResponse200_77 | |
V1SubscriptionItemsBody | |
InlineResponse200_78 | |
SubscriptionItemsSubscriptionItemIdBody | |
InlineResponse200_79 | |
InlineResponse200_80 | |
SubscriptionItemIdUsageRecordsBody | |
InlineResponse200_81 | |
InlineResponse200_83 | |
SkusSkuIdBody | |
InlineResponse200_84 | |
V1SkusBody | |
V1IdentitiesBody | |
InlineResponse200_85 | |
InlineResponse200_86 | |
InlineResponse200_87 | |
InlineResponse200_88 | |
ApplicationsHostedBody | |
InlineResponse200_89 | |
InlineResponse200_90 | |
Transfer | |
Status | |
ContactBusiness | |
InlineResponse200_3Data | |
InlineResponse200_4Data | |
InlineResponse200_4DataComplianceLevels | |
InlineResponse200_4DataElements | |
Ewallet | |
Account | |
EwalletContacts | |
Limit | |
V1ewalletsContact | |
EwalletTransaction | |
EwalletTransactionDetails | |
DailyRate | Describes currency conversion for payments and payouts. Rapyd uses a snapshot of daily foreign exchange rates fetched at 9 PM UTC. The rate returned includes the FX markup fees. |
InlineResponse200_5Data | |
Status1 | |
CardTransaction | |
InlineResponse200_6Data | |
InlineResponse200_6DataTransactions | |
VirtualAccountIssuing | |
VirtualAccountTransactionResponse | |
InlineResponse200_8Data | |
PayoutMethodTypeDetails | |
EntityType | |
PayoutRequiredFields | |
Payout | |
Beneficiary | |
PayoutEwallets | |
PayoutInstructions | |
PayoutFees | |
Sender | |
PayoutStatus | |
FxFee | Describes the fees for processing the currency exchange. Relevant to payouts with FX. |
TransactionFee | Describes the fee for processing the transaction. |
Gender | Gender of the individual. Required when entity_type is individual. |
InlineResponse200_14Data | |
InlineResponse200_15Data | |
InlineResponse200_17Data | |
PayoutMethodType | |
PayoutAmountRangePerCurrencyInner | |
InlineResponse200_29Data | |
InlineResponse200_30Data | |
InlineResponse200_30DataTransactions | |
InlineResponse200_31Data | |
InlineResponse200_32Data | |
InlineResponse200_33Data | |
CheckoutPageResponse | |
MerchantCustomerSupport | Contains details of the client’s customer support. To configure these fields, use the Client Portal. |
HostedPageStatus | Status of the hosted page. One of the following: NEW - The hosted page was created. DON - Done. The card was added to the customer profile. EXP - The hosted page expired. |
HostedPageAdditionalResponseCartItems | Describes the cart items that the customer is purchasing. These items are displayed at the checkout page. |
HostedPageAdditionalResponseCustomElements | Description of the payment transaction. |
InlineResponse200_37Data | |
Address1 | address associated with this specific Rapyd entity Payment/Customer etc... |
Discount | Describes the fields relating to discounts in REST messages and webhooks for customer profiles and subscriptions Contains information about the coupon that applies to the customer. Read-only field. Adding a discount is a 2-step process: 1. Create Coupon, which returns a coupon ID. 2. Add the coupon ID to the coupon field of the customer with Create Customer or Update Customer. |
CustomerPaymentMethods | An object containing the following fields - _ data - A list of up to three payment methods. For more information, see Customer Payment Method Object. _ has_more - Indicates whether there are more than three payment methods for this customer. _ total_count - Total number of payment methods for this customer. _ url - URL for requesting all of the payment methods for this customer.. |
Subscription | |
NextAction | Indicates the next action for completing the payment. Response only. One of the following values are - _ 3d_verification - The next action is 3DS authentication. To simulate 3DS authentication in the sandbox, see Simulating 3DS Authentication. Relevant only to card payments. _ pending_capture - The next action is pending the capture of the amount. Relevant only to card payments when the amount is not zero. _ pending_confirmation - The next action is pending the confirmation for the payment. Relevant to all payment methods excluding card payment. _ not_applicable - The payment has completed or the next action is not relevant. |
SubscriptionItems | |
SubscriptionItem | |
Plan | |
PlanTiers | |
PlanTransformUsage | Defines the transformation that is applied to the reported usage before the billed price is computed. The transformation divides the quantity by the divisor specified in divide_by, then rounds up or down according to the setting in round. Relevant when billing_scheme is set to per_unit. |
Product | |
ProductPackageDimensions | Describes the physical size and weight of the product. Contains the following fields: _ height _ length _ weight _ width These fields are represented as numbers, but it is the responsibility of the merchant to define and interpret the relevant units of length and weight. |
Sku | |
SkuPackageDimensions | Physical attributes of the SKU item. Contains the following fields, height length weight width These fields are represented as numbers, but it is the responsibility of the merchant to define and interpret the relevant units of length and weight. |
CustomerRequestPaymentMethod | The payment method that is used when the transaction does not specify a payment method. String starting with card_ or other_. |
Field1 | Field Object |
FieldConditions | |
InlineResponse200_40Data | |
DiscountCustomerResponse | Describes the fields relating to discounts in REST messages and webhooks for customer profiles and subscriptions Contains information about the coupon that applies to the customer. Read-only field. Adding a discount is a 2-step process: 1. Create Coupon, which returns a coupon ID. 2. Add the coupon ID to the coupon field of the customer with Create Customer or Update Customer. |
PaymentMethodType | A type of payment method that a customer can use for making payments. |
PaymentAmountRangePerCurrencyInner | |
InlineResponse200_45Data | |
ApplePayObjectResponse | |
Dispute | Describes the fields contained in REST messages and webhooks for disputes of payments. |
EscrowResponse | |
EscrowResponseEscrowReleases | Array of objects that describe individual releases. |
EscrowResponseEscrowReleasesData | Array of objects that describe individual escrow releases. |
EscrowEwallets | Describes the wallets and the releases from escrow. |
GroupPayment | Group Payment |
InvoiceResponse | Invoice |
Payment | Collects money from a payment method and deposits it into one or more Rapyd Wallets |
InvoiceItem | Invoice item |
PaymentEwallets | |
PaymentInstructions | |
Outcome | The outcome object describes the outcome of the Rapyd Protect risk assessment |
Fee | |
PaymentRefunds | Refunds object |
PaymentStatus | |
PaymentSteps | |
PaymentOptions | A payment method type is a type of payment method that any customer can use, for example, eemastercard_card, Mastercard for Estonia. When it is added to a customer profile, it becomes a payment method that is specific to that one customer. The name of the payment method type starts with a prefix for the country, the 2-letter ISO 3166-1 alpha-2 code. If the payment method is valid in multiple countries, the prefix is xx. The payment method type has a suffix with one of the following values - _bank - Bank transfer or bank redirect _card - Credit card, debit card or other card _cash - Cash _ewallet - Local eWallet |
BinDetails | Bank Identification Number (BIN) details. Read-only. Object containing the following fields - _ bin_number - BIN number _ country - The two-letter ISO 3166-1 ALPHA-2 code for the country. Uppercase. _ funding - Type of card funding. One of the following [credit, debit, prepaid, unknown] _ bank - Name of the issuing bank. Relevant to cards |
Condition | |
InvoiceItemPeriod | |
OrderResponse | |
OrderItemResponse | |
OrderReturnedItemResponse | |
OrderResponseStatusTransitions | Indicates the last time in Unix time that the order transitioned to one of the following statuses. A zero value for a status indicates that the order has never transitioned to it. |
V1ordersItems | |
V1ordersorderIdreturnsItems | |
OrderReturnedResponse | |
PaymentMethodTypeRequiredFields | Payment Method Type required fields - this is the response of GET required fields for Payment_Method_Type |
PaymentLink | Retrieves details of a payment link. |
V1hostedcollectcardCardFields | Contains details about the card. |
CardTokenResponse | |
CardTokenResponseCardFields | Contains details about the card. |
CardTokenResponsePaymentParams | Contains the following fields. When these fields do not include values, the user is redirected to the hosted page, and a related status message appears at the top of the page. |
ClientDetailsObject | Describes the fields in the client_details object in REST messages for payments. The client_details object describes the browser that the customer is using. The client collects this information and sends it as part of the Create Payment request. This information is used for processing the 3DS version 2 authentication of the customer. Note that Client Details information is not returned in the API response and it does not appear in any webhooks. |
AddressResponse | |
V1paymentssubscriptionsSubscriptionItems | |
InlineResponse200_67Data | |
InlineResponse200_71Data | |
V1productsPackageDimensions | Describes the physical size and weight of the product. Relevant when type is goods. |
Refund | |
RefundEwallets | |
InlineResponse200_76Data | |
InlineResponse200_79Data | |
InlineResponse200_80Data | |
V1skusskuIdInventory | inventory object {quantity, type, value} |
V1skusskuIdPackageDimensions | Physical attributes of the SKU item. Object containing the following fields - height, length, weight, width |
InlineResponse200_85Data | |
InlineResponse200_86Data | |
InlineResponse200_87Data | |
EntityTypeVerify | |
InlineResponse200_88Data | |
VerifyHostedAppResponse | |
VerifyHostedAppResponseMerchantDetails | Object containing information about the merchant. |
VerifyHostedAppResponseMerchantDetailsMerchantCustomerSupport | |
InlineResponse200_90Data | |
InlineResponse200_90DataApplicationType | |
InlineResponse200_90DataOrganizationDetails | |
InlineResponse200_90DataRenewResult | |
InlineResponse200_90DataOrganizationDetailsMerchantCustomerSupport |
Using Union Types
Union types allow you to specify that a variable can have more than one type. This is particularly useful when a function can accept multiple types of inputs. The Union type hint is used for this purpose.
Example Function with Union Types
You can call service method with an instance of TypeA
, TypeB
, or a dictionary that can be converted to an instance of either type.
# Model Definition<a id="model-definition"></a>
ParamType = Union[TypeA, TypeB]
# Service Method<a id="service-method"></a>
def service_method(param: ParamType):
...
## Usage<a id="usage"></a>
type_a = TypeA(key="value")
type_b = TypeB(key="value")
sdk.service.service_method(type_a)
sdk.service.service_method(type_b)
sdk.service.service_method({"key": "value"})
You cannot create an instance of a Union
type itself. Instead, pass an instance of one of the types in the Union
, or a dictionary that can be converted to one of those types.
Project details
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
File details
Details for the file rapyd_sdk-1.0.9.tar.gz
.
File metadata
- Download URL: rapyd_sdk-1.0.9.tar.gz
- Upload date:
- Size: 366.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38ae9b1d639a64f61c70c5a410be01314b44c5ef3a441a752814708a4dbd697b |
|
MD5 | 14e405b55e8c7965f8917e9546377c0c |
|
BLAKE2b-256 | 4d089bf0240dff01376d99ac8879e24c85d5844516978d2b7435757d4dccb566 |
File details
Details for the file rapyd_sdk-1.0.9-py3-none-any.whl
.
File metadata
- Download URL: rapyd_sdk-1.0.9-py3-none-any.whl
- Upload date:
- Size: 474.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ee981537a8428e54adbf229c11117a0a1abbd0f502d2618404ac15fd70f8ba8 |
|
MD5 | dc40e0e149ba04389fd1c918ce106c2c |
|
BLAKE2b-256 | d1c3cbd38ab9fcc273971b46336bee500110e526cb32b2ab55888c06fa834429 |