PaySecure Pinless Web Services 2023:07:03:07

<back to all web services

WICSubstitutionRequest

The following routes are available for this service:
POST/WICSubstitution
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InOutTimes:
    pass


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RequestTimestamps:
    app_layer: Optional[InOutTimes] = None
    parent_lookup: Optional[InOutTimes] = None
    retry_lookup: Optional[InOutTimes] = None
    get_card_data: Optional[InOutTimes] = None
    card_tokenize: Optional[InOutTimes] = None
    card_encrypt: Optional[InOutTimes] = None
    db_insert: Optional[InOutTimes] = None
    backend_process: Optional[InOutTimes] = None
    db_update: Optional[InOutTimes] = None
    parent_update: Optional[InOutTimes] = None
    network: Optional[InOutTimes] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PaysecureResponseInternal:
    timestamps: Optional[RequestTimestamps] = None


class CardInfoType(str, Enum):
    CARD_NUMBER = 'CardNumber'
    TOKEN = 'Token'
    TRACK = 'Track'
    EMV = 'EMV'
    ENCRYPTED = 'Encrypted'
    DPAN = 'DPAN'
    APPLE_PAY = 'ApplePay'
    GOOGLE_PAY = 'GooglePay'
    SAMSUNG_PAY = 'SamsungPay'
    CP_TOKEN = 'CPToken'
    ENCRYPTED_ENHANCED = 'EncryptedEnhanced'
    ENCRYPTED_J_W_E = 'EncryptedJWE'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CardAccountUpdaterDescriptor:
    card_data_type: Optional[CardInfoType] = None
    card_number_info: Optional[str] = None
    expiry_date: Optional[str] = None
    status: Optional[str] = None
    error_code: Optional[str] = None
    card_token: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ExtendedResponse:
    card_account_updater: Optional[CardAccountUpdaterDescriptor] = None
    product_id: Optional[str] = None
    network_response_code: Optional[str] = None
    network_transaction_id: Optional[str] = None
    ch_email_addr_result: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PaysecureVersion(PaysecureResponseInternal):
    local_date_time: Optional[str] = None
    token: Optional[str] = None
    extended_data: Optional[ExtendedResponse] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WICBalance:
    wic_category: Optional[str] = None
    wic_subcategory: Optional[str] = None
    wic_quantity: int = 0


class WICProductCodeInd(IntEnum):
    PLU = 1
    UPC = 2


class WICActionCode(str, Enum):
    APPROVED = 'Approved'
    CATEGORY_NOT_PRESCRIBED = 'CategoryNotPrescribed'
    SUBCATEGORY_NOT_PRESCRIBED = 'SubcategoryNotPrescribed'
    INSUFFICIENT_UNITS = 'InsufficientUnits'
    PRODUCE_CODE_NOT_SUBSCRIBED = 'ProduceCodeNotSubscribed'
    APPROVED_LOWER_PRICE = 'ApprovedLowerPrice'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WICProduct:
    product_code_ind: Optional[WICProductCodeInd] = None
    product_code: Optional[str] = None
    item_price: int = 0
    item_quantity: int = 0
    action_code: Optional[WICActionCode] = None
    original_item_price: int = 0
    original_item_quantity: int = 0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WICSubstitution(PaysecureVersion):
    approval_code: Optional[str] = None
    tran_id: Optional[str] = None
    error_message: Optional[str] = None
    error_code: Optional[str] = None
    approved_amount: int = 0
    discount_amount: int = 0
    network: Optional[str] = None
    earliest_benefit_expiration_date: Optional[str] = None
    wic_balances: Optional[List[WICBalance]] = None
    wic_products: Optional[List[WICProduct]] = None
    response_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RequestorCredentials:
    # @Required()
    merchant_id: Optional[str] = None

    # @Required()
    user_name: Optional[str] = None

    # @Required()
    password: Optional[str] = None

    # @Required()
    version: Optional[str] = None


class TelephoneType(str, Enum):
    D = 'D'
    H = 'H'
    N = 'N'
    W = 'W'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Avs:
    address: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    zip: Optional[str] = None
    country: Optional[str] = None
    email: Optional[str] = None
    ip_address: Optional[str] = None
    telephone_number: Optional[str] = None
    telephone_type: Optional[TelephoneType] = None
    delivery_method: int = 0
    first_name: Optional[str] = None
    middle_name: Optional[str] = None
    last_name: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MerchantDataElements:
    refund_settlement_type_details: int = 0
    send_recurring_p_o_s_entry_mode_feature: bool = False
    use_org_p_o_s_code: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MerchantDescriptorBase:
    data_elements: Optional[MerchantDataElements] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class MerchantDescriptor(MerchantDescriptorBase):
    name: Optional[str] = None
    address: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    zip: Optional[str] = None
    country: Optional[str] = None
    customer_service_number: Optional[str] = None
    mcc: Optional[str] = None
    fn_snum: Optional[str] = None
    email: Optional[str] = None


class FundingSourceType(str, Enum):
    DEPOSIT_ACCOUNT = 'DepositAccount'
    CREDIT = 'Credit'
    DEBIT = 'Debit'
    PREPAID = 'Prepaid'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SenderInfo:
    reference_number: Optional[str] = None
    account_number: Optional[str] = None
    name: Optional[str] = None
    """
    Name Format FirstName{Space}LastName. For Example :- Alvaro Morata
    """

    address: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    country: Optional[str] = None
    date_of_birth: Optional[str] = None
    """
    DateOfBirth Format MMDDYYYY. For Example :- 05051960
    """

    zip: Optional[str] = None
    phone_number: Optional[str] = None
    funding_source: Optional[FundingSourceType] = None


class NetworkName(str, Enum):
    DEFAULT = 'Default'
    NYCE = 'NYCE'
    C_U24 = 'CU24'
    XCEL = 'XCEL'
    STAR = 'STAR'
    PULS = 'PULS'
    SHZM = 'SHZM'
    VISA = 'VISA'
    MAST = 'MAST'
    DISC = 'DISC'
    AMEX = 'AMEX'
    ALIP = 'ALIP'
    UPIN = 'UPIN'
    STAC = 'STAC'
    STNE = 'STNE'
    MAES = 'MAES'
    INTL = 'INTL'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ReceiverInfo:
    reference_number: Optional[str] = None
    account_number: Optional[str] = None
    name: Optional[str] = None
    """
    Name Format FirstName{Space}LastName. For Example :- Alvaro Morata
    """

    address: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    country: Optional[str] = None
    zip: Optional[str] = None
    phone_number: Optional[str] = None


class BillPayGroup(str, Enum):
    DEFAULT = 'Default'
    SINGLE = 'Single'
    RECURRING = 'Recurring'
    INSTALLMENT = 'Installment'
    DEFERRED = 'Deferred'


class DigitalWalletInfo(str, Enum):
    DEFAULT = 'Default'
    STAGED = 'Staged'
    PASSTHROUGH = 'Passthrough'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WalletDescriptor:
    type: Optional[str] = None
    encrypted_data: Optional[str] = None
    application_data_hash: Optional[str] = None
    ephemeral_public_key: Optional[str] = None
    public_key_hash: Optional[str] = None
    transaction_id: Optional[str] = None
    signature: Optional[str] = None
    version: Optional[str] = None
    application_data: Optional[str] = None
    merchant_identifier: Optional[str] = None
    special_payment: Optional[str] = None
    digital_wallet_indicator: Optional[DigitalWalletInfo] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class SecureDescriptor:
    cavv: Optional[str] = None
    secure_transaction_id: Optional[str] = None


class TaxIndicator(str, Enum):
    DEFAULT = 'Default'
    NO_TAX_INFO_PROVIDED = 'NoTaxInfoProvided'
    TAX_INFO_PROVIDED = 'TaxInfoProvided'
    TAX_EXEMPT_ITEM = 'TaxExemptItem'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Level2Descriptor:
    tax_details: Optional[TaxIndicator] = None
    merchant_reference_number: Optional[str] = None
    merchant_tax_id: Optional[str] = None
    order_number: Optional[str] = None
    tax_amount: int = 0
    destination_postal_code: Optional[str] = None
    product_description: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PaymentFacilitatorDescriptor:
    payment_facilitator_indicator: Optional[str] = None
    pf_phone_number: Optional[str] = None
    sub_merch_i_d: Optional[str] = None
    seller_i_d: Optional[str] = None


class TokenTypes(str, Enum):
    DEFAULT = 'Default'
    UCAF = 'UCAF'
    DSRP = 'DSRP'
    UCAFDSRP = 'UCAFDSRP'
    VISA_VERIFIED = 'VisaVerified'
    DIGITAL_WALLET = 'DigitalWallet'
    VISA_VERIFIED_DIGITAL_WALLET = 'VisaVerifiedDigitalWallet'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TokenDescriptor:
    token_type: Optional[TokenTypes] = None
    token_cryptogram_data1: Optional[str] = None
    token_cryptogram_data2: Optional[str] = None


class CardonFileInfo(str, Enum):
    DEFAULT = 'Default'
    SUPPORTED = 'Supported'
    NOT_SUPPORTED = 'NotSupported'


class StoredCredentialIndicatorInfo(str, Enum):
    DEFAULT = 'Default'
    INITIAL = 'Initial'
    SUBSEQUENT = 'Subsequent'


class TransactionInitiateInfo(str, Enum):
    DEFAULT = 'Default'
    MERCHANT = 'Merchant'
    TERMINAL = 'Terminal'
    CUSTOMER = 'Customer'


class ScheduleIndicatorInfo(str, Enum):
    DEFAULT = 'Default'
    SCHEDULED = 'Scheduled'
    UNSCHEDULED = 'Unscheduled'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class CardonFileIndicatorDescriptor:
    cardon_file: Optional[CardonFileInfo] = None
    stored_credential_indicator: Optional[StoredCredentialIndicatorInfo] = None
    transaction_initiate: Optional[TransactionInitiateInfo] = None
    schedule_indicator: Optional[ScheduleIndicatorInfo] = None
    network_transaction_id: Optional[str] = None


class CardAccountUpdaterInfo(str, Enum):
    DEFAULT = 'Default'
    SUPPORTED = 'Supported'
    NOT_SUPPORTED = 'NotSupported'


class OrderTypeInfo(str, Enum):
    DEFAULT = 'Default'
    STANDING = 'Standing'
    SUBSCRIPTION = 'Subscription'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class BillPayGroupIndicator:
    mit_total_payment_count: Optional[str] = None
    mit_amount_type: Optional[str] = None
    mit_amount: Optional[str] = None
    mit_unique_i_d: Optional[str] = None
    mit_frequency: Optional[str] = None
    mit_validation_flag: Optional[str] = None
    mit_validation_reference: Optional[str] = None
    mit_sequence_indicator: Optional[str] = None


class ChargeTypeInfo(str, Enum):
    DEFAULT = 'Default'
    PARTIAL_SHIPMENT = 'PartialShipment'
    DELAYED = 'Delayed'
    NO_SHOW = 'NoShow'
    RESUBMISSION = 'Resubmission'


class SAFEligibleFlag(str, Enum):
    DEFAULT = 'Default'
    TRUE = 'True'
    FALSE = 'False'


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ExtendedData:
    track2_data_for_e_m_v_transaction: Optional[str] = None
    sender_info: Optional[SenderInfo] = None
    cashback_amount: int = 0
    network: Optional[NetworkName] = None
    receiver_info: Optional[ReceiverInfo] = None
    bill_pay_group: Optional[BillPayGroup] = None
    wallet_data: Optional[WalletDescriptor] = None
    secure_data: Optional[SecureDescriptor] = None
    level2_data: Optional[Level2Descriptor] = None
    payment_facilitator_data: Optional[PaymentFacilitatorDescriptor] = None
    token_data: Optional[TokenDescriptor] = None
    otp_tran_id: Optional[str] = None
    current_shipment: int = 0
    total_shipments: int = 0
    is_token_requested: bool = False
    cardon_file_indicator: Optional[CardonFileIndicatorDescriptor] = None
    card_account_updater: Optional[CardAccountUpdaterInfo] = None
    retry_attempt_count: int = 0
    total_auth_amount: int = 0
    signature_hash_version: Optional[str] = None
    order_type_detail: Optional[OrderTypeInfo] = None
    bill_pay_group_indicator: Optional[BillPayGroupIndicator] = None
    charge_type_detail: Optional[ChargeTypeInfo] = None
    saf_eligible: Optional[SAFEligibleFlag] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WICSubstitutionRequest:
    credentials: Optional[RequestorCredentials] = None
    amount: int = 0
    discount_amount: int = 0
    tran_id: Optional[str] = None
    reference_key: Optional[str] = None
    currency_code: Optional[str] = None
    delivery_address: Optional[Avs] = None
    merchant_details: Optional[MerchantDescriptor] = None
    wic_products: Optional[List[WICProduct]] = None
    custom1: Optional[str] = None
    custom2: Optional[str] = None
    custom3: Optional[str] = None
    custom4: Optional[str] = None
    custom5: Optional[str] = None
    signature_hash: Optional[str] = None
    extended_data: Optional[ExtendedData] = None

Python WICSubstitutionRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /WICSubstitution HTTP/1.1 
Host: api.paysecure.acculynk.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Credentials: 
	{
		MerchantId: String,
		UserName: String,
		Password: String,
		Version: String
	},
	Amount: 0,
	DiscountAmount: 0,
	TranId: String,
	ReferenceKey: String,
	CurrencyCode: String,
	DeliveryAddress: 
	{
		Address: String,
		City: String,
		State: String,
		Zip: String,
		Country: String,
		Email: String,
		IPAddress: String,
		TelephoneNumber: String,
		TelephoneType: D,
		DeliveryMethod: 0,
		FirstName: String,
		MiddleName: String,
		LastName: String
	},
	MerchantDetails: 
	{
		Name: String,
		Address: String,
		City: String,
		State: String,
		Zip: String,
		Country: String,
		CustomerServiceNumber: String,
		MCC: String,
		FNSnum: String,
		Email: String,
		DataElements: 
		{
			RefundSettlementTypeDetails: 0,
			SendRecurringPOSEntryModeFeature: False,
			UseOrgPOSCode: False
		}
	},
	WICProducts: 
	[
		{
			ProductCodeInd: PLU,
			ProductCode: String,
			ItemPrice: 0,
			ItemQuantity: 0,
			ActionCode: Approved,
			OriginalItemPrice: 0,
			OriginalItemQuantity: 0
		}
	],
	Custom1: String,
	Custom2: String,
	Custom3: String,
	Custom4: String,
	Custom5: String,
	SignatureHash: String,
	ExtendedData: 
	{
		Track2DataForEMVTransaction: String,
		SenderInfo: 
		{
			ReferenceNumber: String,
			AccountNumber: String,
			Name: String,
			Address: String,
			City: String,
			State: String,
			Country: String,
			DateOfBirth: String,
			Zip: String,
			PhoneNumber: String,
			FundingSource: DepositAccount
		},
		CashbackAmount: 0,
		Network: Default,
		ReceiverInfo: 
		{
			ReferenceNumber: String,
			AccountNumber: String,
			Name: String,
			Address: String,
			City: String,
			State: String,
			Country: String,
			Zip: String,
			PhoneNumber: String
		},
		BillPayGroup: Default,
		WalletData: 
		{
			Type: String,
			EncryptedData: String,
			ApplicationDataHash: String,
			EphemeralPublicKey: String,
			PublicKeyHash: String,
			TransactionId: String,
			Signature: String,
			Version: String,
			ApplicationData: String,
			MerchantIdentifier: String,
			SpecialPayment: String,
			DigitalWalletIndicator: Default
		},
		SecureData: 
		{
			CAVV: String,
			SecureTransactionId: String
		},
		Level2Data: 
		{
			TaxDetails: Default,
			MerchantReferenceNumber: String,
			MerchantTaxId: String,
			OrderNumber: String,
			TaxAmount: 0,
			DestinationPostalCode: String,
			ProductDescription: String
		},
		PaymentFacilitatorData: 
		{
			PaymentFacilitatorIndicator: String,
			PFPhoneNumber: String,
			SubMerchID: String,
			SellerID: String
		},
		TokenData: 
		{
			TokenType: Default,
			TokenCryptogramData1: String,
			TokenCryptogramData2: String
		},
		OTPTranId: String,
		CurrentShipment: 0,
		TotalShipments: 0,
		IsTokenRequested: False,
		CardonFileIndicator: 
		{
			CardonFile: Default,
			StoredCredentialIndicator: Default,
			TransactionInitiate: Default,
			ScheduleIndicator: Default,
			NetworkTransactionId: String
		},
		CardAccountUpdater: Default,
		RetryAttemptCount: 0,
		TotalAuthAmount: 0,
		SignatureHashVersion: String,
		OrderTypeDetail: Default,
		BillPayGroupIndicator: 
		{
			MITTotalPaymentCount: String,
			MITAmountType: String,
			MITAmount: String,
			MITUniqueID: String,
			MITFrequency: String,
			MITValidationFlag: String,
			MITValidationReference: String,
			MITSequenceIndicator: String
		},
		ChargeTypeDetail: Default,
		SAFEligible: Default
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ApprovalCode: String,
	TranId: String,
	ErrorMessage: String,
	ErrorCode: String,
	ApprovedAmount: 0,
	DiscountAmount: 0,
	Network: String,
	EarliestBenefitExpirationDate: String,
	WICBalances: 
	[
		{
			WICCategory: String,
			WICSubcategory: String,
			WICQuantity: 0
		}
	],
	WICProducts: 
	[
		{
			ProductCodeInd: PLU,
			ProductCode: String,
			ItemPrice: 0,
			ItemQuantity: 0,
			ActionCode: Approved,
			OriginalItemPrice: 0,
			OriginalItemQuantity: 0
		}
	],
	ResponseCode: String,
	LocalDateTime: String,
	Token: String,
	ExtendedData: 
	{
		CardAccountUpdater: 
		{
			CardDataType: CardNumber,
			CardNumberInfo: String,
			ExpiryDate: String,
			Status: String,
			ErrorCode: String,
			CardToken: String
		},
		ProductId: String,
		NetworkResponseCode: String,
		NetworkTransactionId: String,
		CHEmailAddrResult: String
	},
	Timestamps: 
	{
		AppLayer: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		ParentLookup: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		RetryLookup: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		GetCardData: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		CardTokenize: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		CardEncrypt: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		DBInsert: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		BackendProcess: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		DBUpdate: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		ParentUpdate: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		},
		Network: 
		{
			InTime: 0001-01-01,
			OutTime: 0001-01-01
		}
	}
}