LogoLogo
Shopper APIs reference
Shopper APIs reference
  • Shopper APIs reference
  • OAuth
    • Tokens
    • Access tokens
  • Shoppers
    • Shoppers
    • Addresses
    • Payment options
  • Browse (product discovery)
    • Categories
    • Products
    • Product variations
    • Pricing
    • Inventory status
    • Financing
    • Offers
    • Purchase plan
    • Find a purchase plan
    • Authorize a purchase plan
  • Cart
    • Apply a shopper to a cart
    • Line items
    • Billing address
    • Shipping address
    • Payment methods
    • Shipping options
    • Web checkout
    • Submit a cart
    • Apply or detach payment methods
    • Apply a shipping option
    • Carts
    • Cart offers
    • API trigger offer
    • Resume cart
    • Third-party subscription engine
    • Tax registration
    • Price override
  • Orders
    • Orders
    • Order lookup
    • Order address
    • Returns
  • Subscriptions
    • Manage a subscription
    • Manage the subscription's renewal plan
    • Immediate midterm change
    • Payment
    • Address
    • Orders
    • Pending actions
    • Retrieve subscriptions
    • Subscription billing and shipping addresses
Powered by GitBook
On this page
  1. Shoppers

Payment options

PreviousAddressesNextCategories

Last updated 11 months ago

Get the shopper payment option

get

Get a payment option by the ID specified in the URI path parameter.

Path parameters
paymentOptionIdstringRequired

Payment Option ID.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

Use the expand query parameter when you want additional fields to appear in the response. The expand query parameter provides more fields in the response. Expanding resources reduces the number of API calls required to accomplish a task.

fieldsstringOptional

Specify the fields that you want to appear in the response. Filtering the fields returned in the response can conserve bandwidth and accelerate response time.

Responses
200
Successful response.
application/json
Responseone of
or
or
or
401
* Invalid Token
application/json
404
* Not Found
application/json
get
GET /v1/shoppers/me/payment-options/{paymentOptionId} HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "paymentOption": {
    "sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
    "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"
    }
  }
}
  • GETGet the shopper payment options
  • POSTCreate the shopper payment options
  • GETGet the shopper payment option
  • POSTUpdate the shopper payment options

Get the shopper payment options

get

Retrieve all of the payment options configured for a shopper.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

Use the expand query parameter when you want additional fields to appear in the response. The expand query parameter provides more fields in the response. Expanding resources reduces the number of API calls required to accomplish a task.

fieldsstringOptional

Specify the fields that you want to appear in the response. Filtering the fields returned in the response can conserve bandwidth and accelerate response time.

Responses
200
Successful response.
application/json
Responseone of
or
or
or
401
* Invalid Token
application/json
get
GET /v1/shoppers/me/payment-options HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "paymentOptions": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options",
    "paymentOption": [
      {
        "sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
        "uri": "https://api.digitalriver.com/v1/shoppers/me/payment-options/740865108",
        "id": 15699113789,
        "nickName": "Default",
        "isDefault": "true"
      }
    ]
  }
}

Create the shopper payment options

post

Create a payment options for a shopper.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

Use the expand query parameter when you want additional fields to appear in the response. The expand query parameter provides more fields in the response. Expanding resources reduces the number of API calls required to accomplish a task.

fieldsstringOptional

Specify the fields that you want to appear in the response. Filtering the fields returned in the response can conserve bandwidth and accelerate response time.

Body
one ofOptional
or
Responses
201
Created (Payment Source, contact your Digital River team to set up)
application/json
204
* No Content (Legacy Payment) * No Content (Payment Source)
400
* Bad Request
application/json
401
* Invalid Token
application/json
409
* The Payment Option with a nickname already exists * The PaymentSource is not valid * The PaymentSource with a Source ID already exists * invalid-state-code * invalid-postal-code
application/json
post
POST /v1/shoppers/me/payment-options HTTP/1.1
Host: api.digitalriver.com
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "paymentOption": {
    "nickName": "DRBank",
    "isDefault": "true",
    "sourceId": "c25fcccc-6e57-4d93-bafb-a6765510a422"
  },
  "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": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
  "sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
  "creditCard": {
    "expirationYear": "2030",
    "lastFourDigits": "0000",
    "clientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
    "expirationMonth": "08",
    "fundingSource": "debit",
    "brand": "Visa",
    "reusable": "true"
  }
}

Update the shopper payment options

post

Update a payment options for a shopper.

Path parameters
paymentOptionIdstringRequired

Payment Option ID.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

Gives additional details about resources.

Body
one ofOptional
or
Responses
201
Created (Payment Source, contact your Digital River team to set up)
application/json
204
* No Content (Legacy Payment) * No Content (Payment Source)
400
* Bad Request
application/json
401
* Invalid Token
application/json
409
* The PaymentSource is not valid * invalid-state-code * invalid-postal-code
application/json
post
POST /v1/shoppers/me/payment-options/{paymentOptionId} HTTP/1.1
Host: api.digitalriver.com
Content-Type: application/json
Accept: */*
Content-Length: 150

{
  "paymentOption": {
    "nickName": "DRBank",
    "isDefault": "true",
    "sourceId": "c25fcccc-6e57-4d93-bafb-a6765510a422"
  },
  "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": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
  "sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
  "creditCard": {
    "expirationYear": "2030",
    "lastFourDigits": "0000",
    "clientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
    "expirationMonth": "08",
    "fundingSource": "debit",
    "brand": "Visa",
    "reusable": "true"
  }
}