Add a Default Payment Instrument Using Instrument Identifier

This section shows you how add a default payment instrument using an instrument identifier.

Endpoint

Test:
POST
https://apitest.cybersource.com
/tms/v2/customers/
{customerTokenId}
/payment-instruments
Production:
POST
https://api.cybersource.com
/tms/v2/customers/
{customerTokenId}
/payment-instruments
Production in India:
POST
https://api.in.cybersource.com
/tms/v2/customers/
{customerTokenId}
/payment-instruments
The
{customerTokenId}
is the customer token ID returned in the
id
field when you created the customer token. For more information, see Create a Customer.

Required Fields for Adding a Default Payment Instrument Using Instrument Identifier Using the REST API

default
Set value to
true
.

Optional Fields for Adding a Default Payment Instrument Using Instrument Identifier Using the REST API

bankAccount.type
billTo.address1
billTo.address2
billTo.aminstrativeArea
billTo.company
billTo.country
billTo.email
billTo.firstName
billTo.lastName
billTo.locality
billTo.phoneNumber
billTo.postalCode
buyerInformation.companyTaxID
buyerInformation.currency
buyerInformation.dateOfBirth
buyerInformation.personalIdentification.id
buyerInformation.personalIdentification.issuedBy.administrativeArea
buyerInformation.personalIdentification.type
card.expirationMonth
card.expirationYear
card.issueNumber
card.startMonth
card.startYear
card.type
card.useAs
card.tokenizedInformation.requestorID
card.tokenizedInformation.transactionType
instrumentIdentifier.id
processingInformation.billPaymentProgramEnabled
merchantInformation.merchantDescriptor.alternateName

REST Example: Adding a Default Payment Instrument Using Instrument Identifier

Request
        
{ "default": true, "card": { "expirationMonth": "12", "expirationYear": "2031", "type": "001" }, "billTo": { "firstName": "John", "lastName": "Doe", "company": "Visa", "address1": "1 Market St", "locality": "san francisco", "administrativeArea": "CA", "postalCode": "94105", "country": "US", "phoneNumber": "4158880000", "email": " " }, "instrumentIdentifier": { "id": "7010000000016241111" } }
Response to a Successful Request
        
{ "_links": { "self": { "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF/payment-instruments/F45FD8DE542A9E9CE053A2598D0AFDFA" }, "customer": { "href": "/tms/v2/customers/F45FB3E443AC3C57E053A2598D0A9CFF" } }, "id": "F45FD8DE542A9E9CE053A2598D0AFDFA", "default": true, "state": "ACTIVE", "card": { "expirationMonth": "12", "expirationYear": "2031", "type": "001" }, "billTo": { "firstName": "John", "lastName": "Doe", "company": "Visa", "address1": "1 Market St", "locality": "san francisco", "administrativeArea": "CA", "postalCode": "94105", "country": "US", "email": " ", "phoneNumber": "4158880000" }, "instrumentIdentifier": { "id": "7030000000014911515" }, "metadata": { "creator": "testrest" }, "_embedded": { "instrumentIdentifier": { "_links": { "self": { "href": "/tms/v1/instrumentidentifiers/7030000000014911515" }, "paymentInstruments": { "href": "/tms/v1/instrumentidentifiers/7030000000014911515/paymentinstruments" } }, "id": "7030000000014911515", "object": "instrumentIdentifier", "state": "ACTIVE", "card": { "number": "489537XXXXXX1515" }, "issuer": { "paymentAccountReference": "V0010013019326121174070050420" }, "processingInformation": { "authorizationOptions": { "initiator": { "merchantInitiatedTransaction": { "previousTransactionId": "123456789619999" } } } }, "metadata": { "creator": "testrest" } } } }