PUT v1/Customers/Payment/Token

Adds new payment token for a customer, currently only Connected Payments, Credit Call, and FreedomPay are supported. Company has to support one of them to work. Otherwise use POST v1/Customers/{customerId}/Payments call

URI template

v1/Customers/Payment/Token

Request Information

URI Parameters

None.

Body Parameters

The token Id we are saving

CustomerCreditCardTokenHeader
NameDescriptionTypeAdditional information
CustomerId

CustomerId, not empty, customer has to exist

globally unique identifier

Required

ProviderType

Payment Provider Type. 2 - ConnectedPayments; 4 - CreditCall; 6 - FreedomPay

PaymentProviderType

Required

MaskedCardNumber

MaskedCardNumber, not empty, 123456******1234 for ConnectedPayments (Mask can be *, x, X, ●, other characters will be ignored)

string

Required

ExpirationDate

Expiration Date, not empty, MM/YY and yyyy-MM-dd are supported. (Currently MM/YY is supported only for this call)

string

Required

CardToken

CardToken/AccountNumber, not empty, for Connected Payments, TokenType:TokenValue format is required (example 201:1234567890123456)

string

Required

CardType

CardType, 0 - American Express; 3 - Discover; 5 - JCB; 6 - Master Card; 7 - Visa

CustomerPaymentMethodType

Required

CardHolderName

CardHolderName, required for FreedomPay

string

None.

Request Formats

application/json, text/json

Sample:
{
  "CustomerId": "82c6fdcb-534f-415a-9e28-87be989e461f",
  "ProviderType": 2,
  "MaskedCardNumber": "123456xxxxxx7890",
  "ExpirationDate": "2017-12-01",
  "CardToken": "201:1234567890123456",
  "CardType": 6,
  "CardHolderName": null
}

application/xml, text/xml

Sample:
<CustomerCreditCardTokenHeader xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/OnlineOrderingAPI.Models.v1">
  <CardHolderName i:nil="true" />
  <CardToken>201:1234567890123456</CardToken>
  <CardType>MasterCard</CardType>
  <CustomerId>82c6fdcb-534f-415a-9e28-87be989e461f</CustomerId>
  <ExpirationDate>2017-12-01</ExpirationDate>
  <MaskedCardNumber>123456xxxxxx7890</MaskedCardNumber>
  <ProviderType>ConnectedPayments</ProviderType>
</CustomerCreditCardTokenHeader>

Response Information

Resource Description

Known internal error is BadRequest, InternalServerError

globally unique identifier

Response Formats

application/json, text/json

Sample:
"93f5f620-ec93-47dd-ab24-c07bbf0b16bf"

application/xml, text/xml

Sample:
<guid xmlns="http://schemas.microsoft.com/2003/10/Serialization/">93f5f620-ec93-47dd-ab24-c07bbf0b16bf</guid>