All URIs are relative to https://apitest.cybersource.com
Method | HTTP request | Description |
---|---|---|
delete_customer_payment_instrument | DELETE /tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId} | Delete a Customer Payment Instrument |
get_customer_payment_instrument | GET /tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId} | Retrieve a Customer Payment Instrument |
get_customer_payment_instruments_list | GET /tms/v2/customers/{customerId}/payment-instruments | List Payment Instruments for a Customer |
patch_customers_payment_instrument | PATCH /tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId} | Update a Customer Payment Instrument |
post_customer_payment_instrument | POST /tms/v2/customers/{customerId}/payment-instruments | Create a Customer Payment Instrument |
delete_customer_payment_instrument(customer_id, payment_instrument_id, profile_id=profile_id)
Delete a Customer Payment Instrument
| | | | | --- | --- | --- | |Customer Payment Instrument
A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.
A Customer can have one or more Payment Instruments, with one allocated as the Customers default for use in payments.
A Payment Instrument token does not store the card number. A Payment Instrument is associated with an Instrument Identifier that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.
| |Deleting a Customers Payment Instrument
Your system can use this API to delete an existing Payment Instrument for a Customer.
Any Instrument Identifiers representing the card number will also be deleted if they are not associated with any other Payment Instruments.
If a customer has more than one Payment Instrument then the default Payment Instrument cannot be deleted without first selecting a new default Payment Instrument.
from __future__ import print_function
import time
import CyberSource
from CyberSource.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = CyberSource.CustomerPaymentInstrumentApi()
customer_id = 'customer_id_example' # str | The Id of a Customer.
payment_instrument_id = 'payment_instrument_id_example' # str | The Id of a payment instrument.
profile_id = 'profile_id_example' # str | The Id of a profile containing user specific TMS configuration. (optional)
try:
# Delete a Customer Payment Instrument
api_instance.delete_customer_payment_instrument(customer_id, payment_instrument_id, profile_id=profile_id)
except ApiException as e:
print("Exception when calling CustomerPaymentInstrumentApi->delete_customer_payment_instrument: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
customer_id | str | The Id of a Customer. | |
payment_instrument_id | str | The Id of a payment instrument. | |
profile_id | str | The Id of a profile containing user specific TMS configuration. | [optional] |
void (empty response body)
No authorization required
- Content-Type: application/json;charset=utf-8
- Accept: application/json;charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostCustomerPaymentInstrumentRequest get_customer_payment_instrument(customer_id, payment_instrument_id, profile_id=profile_id)
Retrieve a Customer Payment Instrument
| | | | | --- | --- | --- | |Customer Payment Instrument
A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.
A Customer can have one or more Payment Instruments, with one allocated as the Customers default for use in payments.
A Payment Instrument token does not store the card number. A Payment Instrument is associated with an Instrument Identifier that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.
| |Retrieving a Customer Payment Instrument
Your system can use this API to retrieve an existing Payment Instrument for a Customer.
To perform a payment with a particular Payment Instrument simply specify the Payment Instrument Id in the payments request.
from __future__ import print_function
import time
import CyberSource
from CyberSource.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = CyberSource.CustomerPaymentInstrumentApi()
customer_id = 'customer_id_example' # str | The Id of a Customer.
payment_instrument_id = 'payment_instrument_id_example' # str | The Id of a payment instrument.
profile_id = 'profile_id_example' # str | The Id of a profile containing user specific TMS configuration. (optional)
try:
# Retrieve a Customer Payment Instrument
api_response = api_instance.get_customer_payment_instrument(customer_id, payment_instrument_id, profile_id=profile_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling CustomerPaymentInstrumentApi->get_customer_payment_instrument: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
customer_id | str | The Id of a Customer. | |
payment_instrument_id | str | The Id of a payment instrument. | |
profile_id | str | The Id of a profile containing user specific TMS configuration. | [optional] |
PostCustomerPaymentInstrumentRequest
No authorization required
- Content-Type: application/json;charset=utf-8
- Accept: application/json;charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaymentInstrumentList get_customer_payment_instruments_list(customer_id, profile_id=profile_id, offset=offset, limit=limit)
List Payment Instruments for a Customer
| | | | | --- | --- | --- | |Customer Payment Instrument
A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.
A Customer can have one or more Payment Instruments, with one allocated as the Customers default for use in payments.
A Payment Instrument token does not store the card number. A Payment Instrument is associated with an Instrument Identifier that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.
| |Retrieving all Customer Payment Instruments
Your system can use this API to retrieve all existing Payment Instruments for a Customer.
from __future__ import print_function
import time
import CyberSource
from CyberSource.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = CyberSource.CustomerPaymentInstrumentApi()
customer_id = 'customer_id_example' # str | The Id of a Customer.
profile_id = 'profile_id_example' # str | The Id of a profile containing user specific TMS configuration. (optional)
offset = 0 # int | Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. (optional) (default to 0)
limit = 20 # int | The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (optional) (default to 20)
try:
# List Payment Instruments for a Customer
api_response = api_instance.get_customer_payment_instruments_list(customer_id, profile_id=profile_id, offset=offset, limit=limit)
pprint(api_response)
except ApiException as e:
print("Exception when calling CustomerPaymentInstrumentApi->get_customer_payment_instruments_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
customer_id | str | The Id of a Customer. | |
profile_id | str | The Id of a profile containing user specific TMS configuration. | [optional] |
offset | int | Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. | [optional] [default to 0] |
limit | int | The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. | [optional] [default to 20] |
No authorization required
- Content-Type: application/json;charset=utf-8
- Accept: application/json;charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PatchCustomerPaymentInstrumentRequest patch_customers_payment_instrument(customer_id, payment_instrument_id, patch_customer_payment_instrument_request, profile_id=profile_id, if_match=if_match)
Update a Customer Payment Instrument
| | | | | --- | --- | --- | |Customer Payment Instrument
A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.
A Customer can have one or more Payment Instruments, with one allocated as the Customers default for use in payments.
A Payment Instrument token does not store the card number. A Payment Instrument is associated with an Instrument Identifier that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.
| |Updating a Customers Payment Instrument
Your system can use this API to update an existing Payment Instrument for a Customer, including selecting a default Payment Instrument for use in payments.
from __future__ import print_function
import time
import CyberSource
from CyberSource.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = CyberSource.CustomerPaymentInstrumentApi()
customer_id = 'customer_id_example' # str | The Id of a Customer.
payment_instrument_id = 'payment_instrument_id_example' # str | The Id of a payment instrument.
patch_customer_payment_instrument_request = CyberSource.PatchCustomerPaymentInstrumentRequest() # PatchCustomerPaymentInstrumentRequest |
profile_id = 'profile_id_example' # str | The Id of a profile containing user specific TMS configuration. (optional)
if_match = 'if_match_example' # str | Contains an ETag value from a GET request to make the request conditional. (optional)
try:
# Update a Customer Payment Instrument
api_response = api_instance.patch_customers_payment_instrument(customer_id, payment_instrument_id, patch_customer_payment_instrument_request, profile_id=profile_id, if_match=if_match)
pprint(api_response)
except ApiException as e:
print("Exception when calling CustomerPaymentInstrumentApi->patch_customers_payment_instrument: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
customer_id | str | The Id of a Customer. | |
payment_instrument_id | str | The Id of a payment instrument. | |
patch_customer_payment_instrument_request | PatchCustomerPaymentInstrumentRequest | ||
profile_id | str | The Id of a profile containing user specific TMS configuration. | [optional] |
if_match | str | Contains an ETag value from a GET request to make the request conditional. | [optional] |
PatchCustomerPaymentInstrumentRequest
No authorization required
- Content-Type: application/json;charset=utf-8
- Accept: application/json;charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PostCustomerPaymentInstrumentRequest post_customer_payment_instrument(customer_id, post_customer_payment_instrument_request, profile_id=profile_id)
Create a Customer Payment Instrument
| | | | | --- | --- | --- | |Customer Payment Instrument
A Customer Payment Instrument represents tokenized customer payment information such as expiration date, billing address & card type.
A Customer can have one or more Payment Instruments, with one allocated as the Customers default for use in payments.
A Payment Instrument token does not store the card number. A Payment Instrument is associated with an Instrument Identifier that represents either a payment card number, or in the case of an ACH bank account, the routing and account number.
Creating a Customer Payment Instrument
It is recommended you create a Customer Payment Instrument via a Payment Authorization, this can be for a zero amount.
In Europe: You should perform Payer Authentication alongside the Authorization.| |Payment Network Tokens
Network tokens perform better than regular card numbers and they are not necessarily invalidated when a cardholder loses their card, or it expires.
A Payment Network Token will be automatically created and used in future payments if you are enabled for the service.
A Payment Network Token can also be provisioned for an existing Instrument Identifier.
For more information about Payment Network Tokens see the Developer Guide.
Payments with Customers Payment Instrument
To perform a payment with a particular Payment Instrument or Shipping Address specify the Payment Instrument in the payment request.
from __future__ import print_function
import time
import CyberSource
from CyberSource.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = CyberSource.CustomerPaymentInstrumentApi()
customer_id = 'customer_id_example' # str | The Id of a Customer.
post_customer_payment_instrument_request = CyberSource.PostCustomerPaymentInstrumentRequest() # PostCustomerPaymentInstrumentRequest |
profile_id = 'profile_id_example' # str | The Id of a profile containing user specific TMS configuration. (optional)
try:
# Create a Customer Payment Instrument
api_response = api_instance.post_customer_payment_instrument(customer_id, post_customer_payment_instrument_request, profile_id=profile_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling CustomerPaymentInstrumentApi->post_customer_payment_instrument: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
customer_id | str | The Id of a Customer. | |
post_customer_payment_instrument_request | PostCustomerPaymentInstrumentRequest | ||
profile_id | str | The Id of a profile containing user specific TMS configuration. | [optional] |
PostCustomerPaymentInstrumentRequest
No authorization required
- Content-Type: application/json;charset=utf-8
- Accept: application/json;charset=utf-8
[Back to top] [Back to API list] [Back to Model list] [Back to README]