Retrieving sources
Learn how to manage payment sources.
For more information on payment options, see Retrieving sources under Payments.
Creating shopper payment options
Create the payment options as described in Payment options.
Updating the shopper's payment options
Use the POST /v1/shoppers/me/payment-options/{paymentOptionId}
request with the payment options identifier (paymentOptionId
) to update the shopper's payment options. See Payment options query parameters for a description of the query parameters.
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/payment-options/{paymentOptionid}' \
--header 'authorization: bearer ***\
...
--data-raw '{
"paymentOption": {
"nickName": "DRBank",
"isDefault": "true",
"sourceId": "{{sourceId}}"
},
"shopper": {
"ipAddress": "192.168.100.102"
}
}
{
"uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options/740865108",
"id": 740865108,
"nickName": "Default",
"isDefault": "true",
"type": "creditCard",
"sourceId": "{{sourceId}}",
"sourceClientSecret": "{{clientSecret}}",
"creditCard": {
"expirationYear": "2030",
"lastFourDigits": "0000",
"clientSecret": "{{clientSecret}}",
"expirationMonth": "08",
"fundingSource": "debit",
"brand": "Visa",
"reusable": "true"
}
}
Getting the shopper's payment options
Use GET /v1/shoppers/me/payment-options
request to retrieve all payment options configured for a shopper. See Payment options query parameters for a description of the query parameters.
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/payment-options' \
--header 'authorization: bearer ***\
...
{
"paymentOptions": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options",
"paymentOption": [
{
"sourceId": "{{sourceId}}",
"uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options/740865108",
"id": 15699113789,
"nickName": "Default",
"isDefault": "true"
}
]
}
}
Getting the shopper's payment option
Use GET /v1/shoppers/me/payment-options/{paymentOptionId}
request with the payment options identifier (paymentOptionId
) to retrieve all payment options configured for a shopper. See Payment options query parameters for a description of the query parameters.
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/payment-options/{paymentOptionId}' \
--header 'authorization: bearer ***\
...
{
"paymentOption": {
"sourceId": "{{sourceId}}",
"sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
"uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options/740865108",
"id": 740865108,
"nickName": "Default",
"isDefault": "true",
"type": "CreditCardMethod",
"creditCard": {
"expirationMonth": "1",
"expirationYear": "2030",
"brand": "Visa",
"lastFourDigits": "1234"
}
}
}