On This Page
Capture Context API
The capture context request contains all of the merchant-specific parameters that tell the
front-end JavaScript library what to do within your payment experience.
The capture context is a signed JSON Web Token (JWT) containing this information:
- Merchant-specific parameters that dictate the customer payment experience for the current payment transaction.
- A one-time public key that secures the information flow during the current payment transaction.
The capture context request includes these fields:
- allowedCardNetworks
- allowedPaymentTypes
- clientVersion
- targetOrigins
For information on JSON Web Tokens, see JSON Web Tokens.
- Allowed Card Networks
- Use theallowedCardNetworksfield to define the card types.These card networks are available for card entry:
- American Express
- Cartes Bancaires
- Carnet
- China UnionPay
- Diners Club
- Discover
- EFTPOS
- ELO
- Jaywan
- JCB
- JCrew
- KCP
- mada
- Maestro
- Mastercard
- Meeza
- PayPak
- UATP
- Visa
To support dual-branded or co-badged cards, you must list your supported card type values for theallowedCardNetworksfield based on your preference for processing card numbers. For example, if a card is dual-branded as Visa and Cartes Bancaires, and Cartes Bancaires is listed first, the card type is set to Cartes Bancaires after the card number is entered in yourUnified Checkoutcard collection form. For information on dual-branded or co-badged cards, see Dual-Branded Cards.IMPORTANTSome card types, such as KCP and UATP, do not have security codes (CVV or CVN). If you include only card types that do not have security codes in theallowedCardNetworksfield,Unified Checkoutdoes not display the security code field in the UI.If you include card types that do not have security codes and cards types that do have security codes in theallowedCardNetworksfield,Unified Checkoutdisplays the security code field in the UI. The field is disabled in the UI when the cardholder enters a card number for a card type with no security code. - Target Origin
- The target origin is defined by the scheme (protocol), hostname (domain), and port number (if used).You must use the https:// protocol. Sub domains must also be included in the target origin.Any valid top-level domains, such as .com, .co.uk, and .gov.br, are supported. Wildcards are not supported.For example, if you are launchingUnified Checkouton example.com, the target origin could be any of the following:When you useUnified Checkoutin an iframe, you must include the domain for the URL that loads the iframe and the iframe URL in thetargetOriginsfield.
- Allowed Payment Types
- You can specify the type ofUnified Checkoutdigital payment methods that you want to accept in the capture context.
- Use theallowedPaymentTypesfield to define the payment type:
- AFTERPAY
- APPLEPAY
- BANCONTACT
- CHECK
- CLICKTOPAY
- DRAGONPAY
- GOOGLEPAY
- IDEAL
- KONBINI
- MULTIBANCO
- MYBANK
- P24
- PANENTRY
- PAZE
- TINKPAYBYBANK
IMPORTANTClick to Payaccepts American Express, Mastercard, and Visa for saved cards. Visa and Mastercard tokenize payment credentials using network tokenization for allClick to Payrequests.Click to PayusesClick to PayToken Requester IDs (TRIDs) rather than your existing TRIDs to generate network tokens.For more information on enabling and managing these digital payment methods, see these topics: - Capture Mandate
- The capture mandate enables you to define which fields are captured withinUnified Checkout. You must include the fields and set the values in the capture context based on the information that you wantUnified Checkoutto collect. This enables the cardholder to review and edit their details where the UI includes these fields. When the UI is used to capture cardholder information, all captured information is available within the payment details API response. When you want the cardholder to review existing address data, you can include the known customer data in the capture context and this information is pre-filled in theUnified CheckoutUI. For information about the payment details API, see Payment Details API.Capture Mandate Field Values and OutcomesCapture Mandate FieldValueOutcomebillingTypeFULLThese fields are shown in the UI to capture cardholder billing details. When you include the billing details in the capture context, these details are pre-filled in theUnified CheckoutUI.All information that is collected from these fields are tokenized in the transient token and sent for payment processing where the Complete Mandate is used.NONENo fields are shown in the UI to capture cardholder billing details.If you are using the Complete Mandate, you must provide billing details in the capture context. All information that is collected from these fields is tokenized in the transient token and sent for payment processing. For information about which fields are required for payment processing, see the Payments Developer Guide.PARTIALOnly the billing postal code and billing country are collected in the UI. Set to this value when you use relaxed address verification services (AVS). This includes markets where postal code and billing country are enough for successful payment processing.requestEmailtrueThe email address is shown and captured in the UI. If you are usingClick to Pay, this email address is used to find the cardholder'sClick to Payaccount.falseNo email address is shown in the UI.If you are usingClick to Pay, this email address is used to find the cardholder'sClick to Payaccount and it appears in the UI whenrequestEmailis set tofalse.requestPhonetrueThe phone number is shown and captured in the UI.falseNo phone number is shown or captured in the UI.requestShippingtrueShipping fields are shown in the UI and are collected byUnified Checkout. When you include the shipping details in the capture context, the information appears prefilled in the UI.falseNo shipping information is captured in the UI. When shipping details are required for payment processing and are used for follow on services such asDecision Manager, you can include these fields in the capture context. These details are tokenized and passed through.shipToCountriesISO country codeWhen therequestShippingfield is set totrue, only the countries that are included in this field can be selected by the cardholder for their shipping address.
- Complete Mandate
- The complete mandate feature provides service orchestration withinUnified Checkoutand simplifies your integration. Service orchestration enablesUnified Checkoutto orchestrate services on your behalf. The complete mandate feature provides instructions to theunifiedPayment.complete()method in the JavaScript. You must include both theunifiedPayment.complete()object in the Javascript and thecompleteMandatefield object in your capture context to enableUnified Checkoutto initiate services on your behalf from the browser.IMPORTANTIf you are updating an existingUnified Checkoutconfiguration to use the complete mandate, you must update your JavaScript to include theunifedPayment.complete()function.IMPORTANTWhen thebillingTypefield is set toNONEyou must include the required fields within the capture context request to ensure that the required fields are included for payment processing. For information about the fields that are required for payment services, see the Payments Developer Guide.The complete mandate feature is defined by these fields:
- completeMandate.type: This field is required to run the complete mandate and is used to indicate how a payment should be processed.Possible values:
- AUTH: Authorize the payment and capture the funds at a later date.
- CAPTURE: Perform a sale. A sale is a combined authorization and capture in a single request.
- PREFER_AUTH: Perform an authorization if possible. If a payment method requires the funds to be captured immediately, thenUnified Checkoutcaptures the payment.
- completeMandate.decisionManager: This field determines whetherDecision Manageris run. Set this field totrueand includecompleteMandate.typein your request to runDecision Managerand device fingerprinting services. WhenDecision Managerruns, it uses the associatedDecision Managerconfiguration based on the merchant ID that is included in the request.When this field is set tofalseor is not included in the request,Decision Managerand device fingerprinting services do not run.
- completeMandate.consumerAuthentication: This field determines whetherPayer Authenticationshould be used. Set this field totrueand includecompleteMandate.typein your request to runPayer Authentication. When this field set totrue,Payer Authenticationruns. When this field is set tofalseor is not included in the request,Payer Authenticationdoes not run.When you useUnified CheckoutwithPayer Authentication, device data is collected throughPayer Authenticationsetup andUnified Checkoutcompletes all calls that are associated withPayer Authentication.Unified Checkoutsupports the pass-through fields that are required forPayer Authenticationchallenge codes. For information about the required fields, see Unified Checkout Field Reference.For information about challenge codes, seeconsumerAuthenticationInformation.challengeCodein the REST API Field Reference. Unified Checkout supports3-D Securedata only when your payment processor supports it. For information see Visa Data Only in the.Payer AuthenticationDeveloper GuideTo testPayer Authentication, you must usePayer Authenticationtest cards. See Test Cases for 3-D Secure 2.x in the.Payer AuthenticationDeveloper GuideConsumer authentication is available for these card types:
- American Express
- Cartes Bancaires
- China UnionPay
- Diners Club
- Discover
- EFTPOS
- ELO
- Jaywan
- JCB
- mada
- Maestro
- Mastercard
- Visa
- Jaywan
Consumer authentication runs for these payment methods when they are supported in yourUnified Checkoutconfiguration:- PANENTRY
- CLICKTOPAYwhen the transaction is not authenticated withClick to Pay.
- GOOGLEPAYwhen the transaction is not authenticated with Google Pay.
Unified Checkoutdoes not attempt to authenticate forClick to Payand Google Pay if the transaction has already been authenticated when it is received byUnified Checkout. For information about testing authentication, see Test Authentication.
- completeMandate.tms.tokenCreate: This field determines if aTMStoken is created for the customer's selected payment method. When this field is set totrue, a token is created. When this field is set tofalseor not included in the request, a token is not created.
- completeMandate.tms.tokenTypes: This is an optional field that you can use to indicate the token type for the token that is created. When this field is not included in the request, a token is created based on yourTMSvault configuration. You can set this field to these values:
- customer
- instrumentIdentifier
- paymentInstrument
- shippingAddress
If you wantUnified Checkoutto capture the cardholder's consent to save the card before a request to create a token is completed, then you must setcaptureMandate.requestSaveCardtotrue. When this field is set totrue,Unified Checkoutpresents aSave card for future paymentscheckbox within the UI and enables the cardholder to give consent. Do not includecaptureMandate.requestSaveCardin your request if you have already gained cardholder consent to create aTMStoken or do not require consent.This table indicates if a token is created given the requested payment method:Payment MethodCapture ContextResultPAN Entry andClick to PaycompleteMandate.tms.tokenCreate=trueTMStoken is created at the token level(s) specified in the request or based on the default for the token vault.completeMandate.tms.tokenCreate=trueandcaptureMandate.requestSaveCard=trueCardholder can checkSave Payment InformationinUnified Checkout. The request to create a token is made when the cardholder checks this field in the UI. When it is not checked, ni token is created.Apple Pay, Google Pay, and PazecompleteMandate.tms.tokenCreate=trueTMStoken is created at the token level(s) specified in the request or based on the default for the token vault.completeMandate.tms.tokenCreate=trueandcaptureMandate.requestSaveCard=trueUnified Checkoutcannot obtain consent to create a token and no token is created when the customer completes the payment.EcheckcompleteMandate.tms.tokenCreate=trueTMStoken is created at the token level(s) specified in the request or based on the default for the token vault.completeMandate.tms.tokenCreate=trueandcaptureMandate.requestSaveCard=trueUnified Checkoutcannot obtain consent to create a token and no token is created when the customer completes the payment.
- Include Card Prefix
- You can control the length of the card number prefix to be received in the response to the capture context/sessionsrequest:
- Six digits
- Eight digits
- No prefix
transientTokenResponseOptions.includeCardPrefixfield in the capture context/sessionsrequest. - To receive a six-digit card number prefix in the response, follow this step:Do notinclude thetransientTokenResponseOptions.includeCardPrefixfield in the capture context/sessionsrequest.This example shows how a six-digit card number prefix411111is returned in the transient token response:"maskedValue" : "XXXXXXXXXXXX1111”, "bin" : "411111"
- To receive an eight-digit card number prefix in the response, follow this step:Include thetransientTokenResponseOptions.includeCardPrefixfield in the capture context request, and set the value totrue.This example shows how an eight-digit card prefixIMPORTANTThis PCI DSS requirement applies only to card numbers longer than 15 digits and only for Discover,JCB,Mastercard,UnionPay,and Visa brands.
- If the card type entered is not part of these brands, a six-digit card number prefix is returned instead.
- If the card type entered is not part of these brands but isco-brandedwith these brands, an eight-digit card number prefix is returned.
41111102is returned in the transient token response:"maskedValue" : "XXXXXXXXXXXX1111”, "prefix" : "41111102" - To not receive a card number prefix in the response, follow this step:Include thetransientTokenResponseOptions.includeCardPrefixfield in the capture context request, and set the value tofalse.This example shows how a card number is returned without a card number prefix in the transient token response:"maskedValue" : "XXXXXXXXXXXX1111"
- Best practice:If your application does not require card number prefix information for routing or identification,Cybersourcerecommends that you include thetransientTokenResponseOptions.includeCardPrefixfield in the capture context request and set its value tofalse. Doing so limits the exposure of payment data to only what is necessary for your processing needs.For more information about PCI DSS, seeFrequently Asked Questionson the PCI Security Standards Council site.
IMPORTANT
Cybersource
recommends
that you dynamically parse the response for the fields that you are looking for when you
integrate with Cybersource
APIs. Cybersource
may add
additional fields in the future. You must ensure that your integration can handle new
fields that are returned in the response. Even though the underlying data structures do
not change, you must also ensure that your integration can handle changes to the order
in which the data is returned.
Cybersource
uses semantic versioning
practices, which enables you to retain backwards compatibility as new fields are
introduced in minor version updates.