Skip to content

Latest commit

 

History

History
598 lines (541 loc) · 565 KB

README.md

File metadata and controls

598 lines (541 loc) · 565 KB

RapydSdk Python SDK 1.0.12

Welcome to the RapydSdk SDK documentation. This guide will help you get started with integrating and using the RapydSdk SDK in your project.

This SDK was generated by liblab

Versions

  • API version: 1.0.12
  • SDK version: 1.0.12

About the API

This is a Beta release of the Python SDK for Rapyd's API methods. It is recommended to initially run the methods in the sandbox environment. For the most up to date 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.webhook_methods.list_webhooks(
    from_created_at="from_created_at",
    limit=50,
    page="page",
    status="status",
    type_="type",
    to_created_at=7.84
)

print(result)

Services

The SDK provides various services to interact with the API.

Below is a list of all available services with links to their detailed documentation:
Name
PaymentMethodTypeService
PaymentService
CheckoutPageService
SubscriptionService
SubscriptionPlanService
SubscriptionProductService
SubscriptionSubscriptionItemService
SubscriptionInvoiceService
SubscriptionInvoiceItemService
PaymentLinkService
GroupPaymentService
EscrowService
RefundService
DigitalWalletService
DisputeService
CustomerService
PaymentAddressService
CustomerPaymentMethodService
SkuService
OrderService
OrderReturnService
CouponService
DisburseService
DisburseUploadDocumentsService
EWalletsService
IssuingService
PaymentCardTokenService
IssuingSimulationsService
VirtualAccountsService
FxService
LocalizationMethodsService
WebhookMethodsService
VerifyService
CardNetworkLookupServiceService

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 with links to their detailed documentation:
Name Description
InlineResponse_200
InlineResponse_200_1
InlineResponse_200_2
Customer customer
V1PaymentsBody
InlineResponse_200_3
PaymentsPaymentIdBody
PaymentIdCaptureBody
PaymentsCompletePaymentBody
InlineResponse_200_4
V1CheckoutBody
InlineResponse_200_5
PaymentsSubscriptionsBody
InlineResponse_200_6
SubscriptionsSubscriptionIdBody
InlineResponse_200_7
CheckoutSubscriptionsBody
InlineResponse_200_8
InlineResponse_200_9
InlineResponse_200_20
InlineResponse_200_10
V1PlansBody
InlineResponse_200_11
PlansPlanIdBody
InlineResponse_200_12
InlineResponse_200_13
V1ProductsBody
InlineResponse_200_14
ProductsProductsIdBody
InlineResponse_200_15
V1SubscriptionItemsBody
InlineResponse_200_16
SubscriptionItemsSubscriptionItemIdBody
InlineResponse_200_17
InlineResponse_200_18
SubscriptionItemIdUsageRecordsBody
InlineResponse_200_19
InlineResponse_200_21
V1InvoicesBody
InlineResponse_200_22
InvoicesInvoiceIdBody
InlineResponse_200_23
InvoiceIdPayBody
InlineResponse_200_24
V1InvoiceItemsBody
InvoiceItemsInvoiceItemBody
InlineResponse_200_25
InlineResponse_200_26
CollectPaymentsBody
PaymentsGroupPaymentsBody
InlineResponse_200_27
InlineResponse_200_28
EscrowEscrowReleasesBody
InlineResponse_200_29
InlineResponse_200_30
V1RefundsBody
InlineResponse_200_31
RefundsCompleteBody
RefundsGroupPaymentsBody
InlineResponse_200_32
RefundsRefundIdBody
ApplePayObject
InlineResponse_200_33
InlineResponse_200_34
GetDisputesListByOrgIdStatus
InlineResponse_200_35
InlineResponse_200_36
V1CustomersBody
InlineResponse_200_37
CustomerRequest
InlineResponse_200_38
InlineResponse_200_39
V1AddressesBody address associated with this specific Rapyd entity Payment/Customer etc...
InlineResponse_200_40
InlineResponse_200_41
Category
CustomerIdPaymentMethodsBody
InlineResponse_200_42
InlineResponse_200_43
InlineResponse_200_44
SkusSkuIdBody
InlineResponse_200_45
V1SkusBody
InlineResponse_200_46
V1OrdersBody
InlineResponse_200_47
OrdersOrderIdBody
OrderIdPayBody
OrderIdReturnsBody
InlineResponse_200_48
InlineResponse_200_49
InlineResponse_200_50
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.
InlineResponse_200_51
InlineResponse_200_52
InlineResponse_200_53
InlineResponse_200_54
V1PayoutsBody
InlineResponse_200_55
InlineResponse_200_56
PayoutsBeneficiaryBody
InlineResponse_200_57
PayoutsExtendedBeneficiaryBody
BeneficiaryValidateBody
InlineResponse_200_58
BeneficiaryBeneficiaryIdBody
InlineResponse_200_59
DisburseBeneficiaryBody
InlineResponse_200_60
PayoutsSenderBody
InlineResponse_200_61
InlineResponse_200_62
InlineResponse_200_63
PayoutsPayoutIdBody
InlineResponse_200_64
InlineResponse_200_65
InlineResponse_200_66
AccountTransferBody
InlineResponse_200_67
TransferResponseBody
AccountDepositBody
InlineResponse_200_68
AccountWithdrawBody
BalanceHoldBody
InlineResponse_200_69
InlineResponse_200_70
EwalletIdContactsBody
InlineResponse_200_71
Contact
InlineResponse_200_72
InlineResponse_200_73
InlineResponse_200_97
V1EwalletsBody
InlineResponse_200_98
EwalletsEwalletTokenBody
UpdateEwalletStatusStatus
AccountLimitsBody
InlineResponse_200_99
InlineResponse_200_100
InlineResponse_200_101
InlineResponse_200_102
InlineResponse_200_103
CardDetailsCardTokenBody
InlineResponse_200_74
InlineResponse_200_75
IssuingCardsBody
InlineResponse_200_76
InlineResponse_200_77
CardsActivateBody
InlineResponse_200_78
IssuingActivateCardBody
InlineResponse_200_79
IssuingPinBody
InlineResponse_200_80
CardsPersonalizeBody
CardsStatusBody
InlineResponse_200_81
InlineResponse_200_82
CardsPinBody
InlineResponse_200_83
CardTokensGooglePayBody
InlineResponse_200_84
IssuingBankaccountsBody
InlineResponse_200_107
BankaccountsBankaccounttransfertobankaccountBody
InlineResponse_200_108
InlineResponse_200_109
BankaccountsVirtualAccountIdBody
InlineResponse_200_93
InlineResponse_200_110
CollectCardBody
InlineResponse_200_85
CardsSimulateBlockBody
InlineResponse_200_86
CardsAuthorizationBody
InlineResponse_200_87
CardsReversalBody
InlineResponse_200_88
CardsClearingBody
InlineResponse_200_89
CardsRefundBody
CardsAdjustmentBody
V1VirtualAccountsBody
InlineResponse_200_90
VirtualAccountsTransactionsBody
InlineResponse_200_91
InlineResponse_200_92
VirtualAccountsVirtualAccountIdBody
InlineResponse_200_94
InlineResponse_200_95
InlineResponse_200_96
InlineResponse_200_104
InlineResponse_200_120
InlineResponse_200_121
InlineResponse_200_122
InlineResponse_200_105
InlineResponse_200_106
V1IdentitiesBody
InlineResponse_200_111
InlineResponse_200_112
InlineResponse_200_113
InlineResponse_200_114
ApplicationsHostedBody
InlineResponse_200_115
InlineResponse_200_116
HostedIdvBody
InlineResponse_200_117
CnlTerminationQueryBody
InlineResponse_200_118
InlineResponse_200_119
Status_1
PaymentMethodType A type of payment method that a customer can use for making payments.
PaymentAmountRangePerCurrencyInner
Field_1 Field Object
Field_1Conditions
PaymentMethodTypeRequiredFields Payment Method Type required fields - this is the response of GET required fields for Payment_Method_Type
Payment Collects money from a payment method and deposits it into one or more Rapyd Wallets
Address_1 address associated with this specific Rapyd entity Payment/Customer etc.
Dispute Describes the fields contained in REST messages and webhooks for disputes of payments.
PaymentEwallets
PaymentInstructions
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.
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
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: <BR> 1. Create Coupon, which returns a coupon ID. <BR>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
SubscriptionItems
SubscriptionItem
Plan Describes the pricing structure for the invoice item. For details of the fields in the plan object, see 'Create 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.
FxFee Describes the fees for processing the currency exchange. Relevant to payouts with FX.
TransactionFee Describes the fee for processing the transaction.
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.
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.
V1paymentssubscriptionsSubscriptionItems
InlineResponse_200_7Data
SubscriptionHostedPageReponse
SubscriptionHostedPageReponseCustomElements Description of the payment transaction.
SubscriptionHostedPageReponseMerchantCustomerSupport
InlineResponse_200_12Data
V1productsPackageDimensions Describes the physical size and weight of the product. Relevant when type is goods.
InlineResponse_200_17Data
InlineResponse_200_18Data
InvoiceResponse Invoice
InvoiceItemResponse Invoice item
Payout
InvoiceItemResponsePeriod Defines the start and end of the time period that this invoice item refers to. Relevant when the invoice item refers to more than one day. Contains the following fields:
Beneficiary
PayoutEwallets
PayoutInstructions
PayoutFees
Sender
PayoutStatus
EntityType
InlineResponse_200_23Data
InlineResponse_200_25Data
PaymentLink Retrieves details of a payment link.
GroupPayment Group Payment
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.
Refund
RefundEwallets
InlineResponse_200_32Data
ApplePayObjectResponse
CustomerRequestPaymentMethod The payment method that is used when the transaction does not specify a payment method. String starting with card_ or other_.
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: <BR> 1. Create Coupon, which returns a coupon ID. <BR>2. Add the coupon ID to the coupon field of the customer with Create Customer or Update Customer.
AddressResponse
InlineResponse_200_43Data
V1skusskuIdInventory inventory object {quantity, type, value}
V1skusskuIdPackageDimensions Physical attributes of the SKU item. Object containing the following fields - height, length, weight, width
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
InlineResponse_200_52Data
PayoutMethodTypeDetails
Status
PayoutRequiredFields
MassPayoutResponse
Gender Gender of the individual. Required when entity_type is individual.
InlineResponse_200_58Data
InlineResponse_200_59Data
V1hosteddisbursebeneficiaryBeneficiaryOptionalFields
HostedBeneficiaryTokenResponse
HostedBeneficiaryTokenResponseBeneficiaryOptionalFields
HostedBeneficiaryTokenResponseMerchantCustomerSupport
InlineResponse_200_62Data
PayoutMethodType
PayoutAmountRangePerCurrencyInner
PayoutReturned
PayoutReturnedStatus
InlineResponse_200_65Data
Transfer
InlineResponse_200_68Data
PutFundsOnHoldResponse
ContactBusiness
InlineResponse_200_72Data
InlineResponse_200_73Data
InlineResponse_200_73DataComplianceLevels
InlineResponse_200_73DataElements
Ewallet
Account
EwalletContacts
Limit
V1ewalletsContact
EwalletTransaction
EwalletTransactionDetails
InlineResponse_200_103Data
InlineResponse_200_103DataBankAccounts Array of objects with details of the virtual accounts. Each object contains the following fields
PaymentParams
CardIssuing
CardIssuingMasked
HostedPageActivateCardResponse
HostedPageCardPinResponse
CardTransaction
SetPinResponse
AddCardtoGooglePayResponse
AddCardtoGooglePayResponseUserAddress The base64 encoded string that contains the encrypted object for Push Provisioning. Required for adding the card to the Google Pay wallet by using the Google Pay pushTokenizeRequest method. For more information refer to the Google Pay Provisioning developer documentation .Details of an account funding transaction (AFT), which transfers funds from a card to a cardholder's wallet.
InlineResponse_200_107Data
InlineResponse_200_108Data
InlineResponse_200_93DataTransactions
InlineResponse_200_109Data
InlineResponse_200_93Data
InlineResponse_200_110Data
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.
SimulateBlockCardResponse
SimulateCardTransactionAuthorizationRequestEea
SimulateCardTransactionAuthorizationRequestEeaAuthResponse Response related to an authorization. Contains the following fields:
SimulateCardTransactionAuthorizationReversalEea
SimulateClearingCardTransactionEeaRemoteAuthResponse Response to a successful remote authorization request. Contains the following fields:
SimulateClearingCardTransactionEea
InlineResponse_200_90Data
InlineResponse_200_91Data
InlineResponse_200_91DataTransactions
VirtualAccountIssuing
VirtualAccountTransactionResponse
InlineResponse_200_94Data
InlineResponse_200_95Data
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.
ListSupportedLanguagesResponse
ListSupportedLanguagesResponseLanguages List of the languages supported for hosted pages.
ListCountriesResponse
ListCountriesResponseLanguages List of the supported countries.
ListCurrenciesResponse
ResendWebhookResponse
ListWebhooksResponseAttempts List of attempts at sending the webhook. Array of objects that contain the following fields:
ListWebhooksResponseAttemptsHttpResponseHeaders Headers of the HTTP response from the configured webhook destination, with the value received.
ListWebhooksResponse
InlineResponse_200_111Data
InlineResponse_200_112Data
InlineResponse_200_113Data
EntityTypeVerify
InlineResponse_200_114Data
VerifyHostedAppResponse
VerifyHostedAppResponseMerchantDetails Object containing information about the merchant.
VerifyHostedAppResponseMerchantDetailsMerchantCustomerSupport
InlineResponse_200_116Data
InlineResponse_200_116DataApplicationType
InlineResponse_200_116DataOrganizationDetails
InlineResponse_200_116DataRenewResult
InlineResponse_200_116DataOrganizationDetailsMerchantCustomerSupport
InlineResponse_200_117Data Retrieve the Rapyd ID and merchant reference ID.
InlineResponse_200_117DataMerchantCustomerSupport Contains details of the client’s customer support. To configure these fields, use the Client Portal.
V1cnlterminationQuerySearchCriteria Specifies search criteria for the query.
V1cnlterminationQueryQueriedMerchant Information about the merchant who is the subject of the query.
V1cnlterminationQueryQueriedMerchantAddress Details of the merchant's business address.
V1cnlterminationQueryQueriedMerchantPrincipals Details of the registered principal owners of the merchant.<BR> Maximum - 3.
V1cnlterminationQueryQueriedMerchantPrincipalsAddress Details of the owner's business address.
InlineResponse_200_118Data
InlineResponse_200_119Data
InlineResponse_200_119DataMatchStats Statistics about the query.
InlineResponse_200_119DataMatches Describes the results of the query.
InlineResponse_200_119DataQueryInfo asd
InlineResponse_200_119DataPrincipals Details of the registered principal owners of the merchant.<BR> Maximum - 3.
InlineResponse_200_119DataMatchedMerchant Data about the merchant on file in the database.
InlineResponse_200_119DataRegistrationInfo Registration information in the card network's termination database about the merchant and the acquirer that listed the merchant.
InlineResponse_200_119DataQueryInfoQueriedMerchant Details of the merchant who is the subject of the query.

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
ParamType = Union[TypeA, TypeB]

# Service Method
def service_method(param: ParamType):
...

## Usage
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.