Skip to main content

CustomerPaymentMethodService

A list of all methods in the CustomerPaymentMethodService service. Click on the method name to view detailed information about that method.

MethodsDescription
get_customer_payment_methodsRetrieve payment methods for a customer
create_customer_payment_methodAdd a payment method to a customer profile
get_customer_payment_methodRetrieve a payment method for a specific customer
update_customer_payment_methodChange or modify a payment method that was stored in a customer profile
delete_customer_payment_methodThis method triggers the Webhook - Payment Method Canceled webhook. This webhook contains more information than the response.

get_customer_payment_methods

Retrieve payment methods for a customer

  • HTTP Method: GET
  • Endpoint: /v1/customers/{customerId}/payment_methods

Parameters

NameTypeRequiredDescription
customer_idstrcustomer Id
categoryCategory
starting_afterstrThe ID of the coupon created before the first coupon you want to retrieve
ending_beforestrThe ID of the coupon created after the last coupon you want to retrieve
limitstrThe maximum number of coupons to return. Range is 1-100. Default is 10
type_strThe type of payment method to find.

Return Type

InlineResponse200_37

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import Category

sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)

result = sdk.customer_payment_method.get_customer_payment_methods(
customer_id="customerId",
category="bank",
starting_after="starting_after",
ending_before="ending_before",
limit="limit",
type_="type"
)

print(result)

create_customer_payment_method

Add a payment method to a customer profile

  • HTTP Method: POST
  • Endpoint: /v1/customers/{customerId}/payment_methods

Parameters

NameTypeRequiredDescription
request_bodyCustomerIdPaymentMethodsBodyThe request body.
customer_idstrcustomer Id

Return Type

InlineResponse200_38

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import CustomerIdPaymentMethodsBody

sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)

request_body = CustomerIdPaymentMethodsBody(
data={
"amount_range_per_currency": [
{
"maximum_amount": 8.96,
"minimum_amount": 8.01,
"currency": "GBP"
}
],
"category": "bank",
"country": "GB",
"currencies": [
"GBP"
],
"image": "image",
"is_cancelable": False,
"is_expirable": False,
"is_online": False,
"is_refundable": True,
"is_tokenizable": False,
"is_virtual": True,
"maximum_expiration_seconds": 6.94,
"minimum_expiration_seconds": 2.06,
"multiple_overage_allowed": False,
"name": "name",
"payment_flow_type": "direct",
"payment_options": [
{
"code": "code",
"is_required": False,
"is_updatable": True,
"instructions": "instructions",
"name": "name",
"numeric_code": "numeric_code",
"required_fields": [
{
"code": "code",
"is_required": False,
"is_updatable": True,
"instructions": "instructions",
"name": "name",
"numeric_code": "numeric_code",
"type_": "boolean",
"regex": "regex",
"conditions": [
{
"description": "description",
"element_name": "element_name",
"operator": "operator",
"threshold_value": "adnon"
}
],
"description": "description"
}
],
"type_": "boolean",
"regex": "regex",
"conditions": [
{
"description": "description",
"element_name": "element_name",
"operator": "operator",
"threshold_value": "adnon"
}
],
"description": "description"
}
],
"status": "status",
"supported_digital_wallet_providers": [
"supported_digital_wallet_providers"
],
"type_": "type",
"virtual_payment_method_type": "virtual_payment_method_type",
"is_restricted": True,
"supports_subscription": False
}
)

result = sdk.customer_payment_method.create_customer_payment_method(
request_body=request_body,
customer_id="customerId"
)

print(result)

get_customer_payment_method

Retrieve a payment method for a specific customer

  • HTTP Method: GET
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

NameTypeRequiredDescription
customer_idstrcustomer Id
pmt_idstrPmt Id

Return Type

InlineResponse200_39

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)

result = sdk.customer_payment_method.get_customer_payment_method(
customer_id="customerId",
pmt_id="pmtId"
)

print(result)

update_customer_payment_method

Change or modify a payment method that was stored in a customer profile

  • HTTP Method: POST
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

NameTypeRequiredDescription
request_bodyCustomerPaymentMethodThe request body.
customer_idstrcustomer Id
pmt_idstrPmt Id

Return Type

InlineResponse200_39

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment
from rapyd_sdk.models import CustomerPaymentMethod

sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)

request_body = CustomerPaymentMethod(
category="bank",
fingerprint_token="fingerprint_token",
id_="id",
image="image",
last4="4487",
metadata={},
name="name",
network_reference_id="network_reference_id",
next_action="3d_verification",
redirect_url="redirect_url",
supporting_documentation="supporting_documentation",
token="token",
type_="type",
webhook_url="webhook_url"
)

result = sdk.customer_payment_method.update_customer_payment_method(
request_body=request_body,
customer_id="customerId",
pmt_id="pmtId"
)

print(result)

delete_customer_payment_method

This method triggers the Webhook - Payment Method Canceled webhook. This webhook contains more information than the response.

  • HTTP Method: DELETE
  • Endpoint: /v1/customers/{customerId}/payment_methods/{pmtId}

Parameters

NameTypeRequiredDescription
customer_idstrcustomer Id
pmt_idstrPmt Id

Return Type

InlineResponse200_40

Example Usage Code Snippet

from rapyd_sdk import RapydSdk, Environment

sdk = RapydSdk(
base_url=Environment.DEFAULT.value,
timeout=10000
)

result = sdk.customer_payment_method.delete_customer_payment_method(
customer_id="customerId",
pmt_id="pmtId"
)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →