# API Basics source: https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md ## API Basics {#api-basics} This page covers everything you need to call the Mastercard Cross-Border Services APIs: client authentication, transport encryption, the project keys used to access the service, the environments available to you, the step-by-step flows for connecting with either OAuth 1.0a or OAuth 2.0, and how to receive push notifications from Mastercard. ## Client Authentication {#client-authentication} | Authentication Protocol | Details | |------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [OAuth 1.0a](https://oauth.net/core/1.0a/) | * Mastercard uses OAuth 1.0a with a body hash extension for authenticating the API clients. * OAuth 1.0a is an authentication and authorization protocol that guarantees the integrity and authenticity of incoming API calls and allows for non-repudiation of requests.. | | [OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc6749) | * Customers contracted with **MTS EU** or **MTS UK** use OAuth 2.0 to meet the jurisdiction-based Regulatory Technical Standards derived from PSD2. * Cross-Border services has implemented custom authentication protocols to meet PSD2 regulations. Refer to the [Getting Started with the APIs using OAuth 2.0](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#getting-started-with-the-apis-using-oauth-20) section for more details. | OAuth requires every request that you send to Mastercard to be signed with an RSA private key. A private-public RSA key pair must be generated, consisting of: 1. A **private key** used for the OAuth signature on API requests. It is recommended to keep the private key in a password-protected or hardware keystore. The private key is used to encrypt the signature base string hash, which is decrypted using the public key at the server. 2. A **public key** that is shared with Mastercard during the project setup process through either a Certificate Signing Request (CSR) or the API Key Generator. Mastercard uses the public key to verify the OAuth signature provided on every API call. * Requests with a body must be signed using the [Google Request Body Hash](https://datatracker.ietf.org/doc/id/draft-eaton-oauth-bodyhash-00.html) extension for OAuth. * The OAuth keys for your project can be set up on your [Developer Dashboard](https://developer.mastercard.com/dashboard) after you create a project. Tip: Do you want to learn more about the authentication scheme and Authorization Header that Mastercard uses? For details, read the [Using OAuth 1.0a to Access Mastercard APIs](https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis/) guide. ## Transport Encryption {#transport-encryption} The transport between client applications and Mastercard is secured using [TLS/SSL](https://en.wikipedia.org/wiki/Transport_Layer_Security), which means data is encrypted by default when transmitted across networks. In addition, Mastercard uses end-to-end payload encryption to protect sensitive data such as personally identifiable information (PII). For more background, see [Securing Sensitive Data Using Payload Encryption](https://developer.mastercard.com/platform/documentation/security-and-authentication/securing-sensitive-data-using-payload-encryption/). All request payloads sent to Mastercard must be encrypted, and you must decrypt any payloads received from Mastercard. Expand the section below for full payload encryption and decryption details. ### Introduction {#introduction} Mastercard APIs are secured through an authentication process where only authorized clients, with a valid digital signature are granted access. Payload encryption provides an additional layer of security. The encrypted payload is structured in JSON Web Encryption (JWE) format, the plain text JSON body is encrypted to form a JWE encrypted payload that is inserted into the request body(replacing the plain text data). The encryption process uses the appropriate public encryption key for the environment. For further details, refer to the [JWE IETF standard - (RFC 7516)](https://tools.ietf.org/html/rfc7516#section-3.1) ### How to Enable Encryption {#how-to-enable-encryption} Customers may set up payload encryption for partner-initiated transactions (such as for Quotes, Payment and Retrieve Payment APIs) on their own by following these steps: **Step 1:** Create Encryption keys. See the **How to Create Encryption Keys** sub-section below. **Step 2:** Provide encrypted payload. See the **How to Encrypt Payload** sub-section below. **Step 3:** Include the **x-encrypted: true** HTTP Header. See the **HTTP Header Parameters** sub-section below. ### How to Create Encryption Keys {#how-to-create-encryption-keys} Once you log into your Mastercard Developers account on [Mastercard Developer site](https://developer.mastercard.com/account/log-in), there are two ways to create encryption keys. **Option 1:** Create keys with new project creation: The [Quick Start Guide](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md) provides detailed information about creating a project and the project keys in Sandbox/MTF environment. For creating encryption keys in production, refer to [Quick Start Guide → Step 6: Promote the same project to Production](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md#step-6-promote-the-same-project-to-production). **Option 2:** Add Keys to existing project: To add keys to an existing project, simply click "Add Key" (next to the Client Encryption Keys) ### How to Encrypt Payload {#how-to-encrypt-payload} Please follow the below steps to encrypt the payload as per above format: **Step 1:** Construct the original JSON or XML Request per the API specification. **Step 2:** Use JWE to encrypt the original request in compact serialized form using the below JOSE headers: | JOSE Header | Value | Description | |--------------------|-------------------------------------|-----------------------------------------------------------------------------------------------------------------| | enc | A256GCM | Content encryption algorithm. | | alg | RSA-OAEP-256 | Key encryption algorithm. | | cty (content type) | Application/JSON or Application/XML | The application can use this value to disambiguate among the different kinds of objects that might be present. | | kid | Public Fingerprint ID | The Public Fingerprint ID or client key will be used to identify the private key needed to decrypt the message. | **Kid example:** ![client-encryption-key](https://static.developer.mastercard.com/content/cross-border-services/uploads/EncryptionKidExample.PNG) **Step 3:** Construct payload with below HTTP header parameters, and payload structure.
#### HTTP Header Parameters {#http-header-parameters} | Param Name | Example Value | Description | |----------------|--------------------------------------|------------------------------------------------------------------------------------------| | Content-Type | application/json | This is the format of the request content being submitted. | | Content-Length | 380 | This is the length of the request content body in octets. | | Accept | application/ JSON | This is the acceptable format for response content. | | x-encrypted | TRUE | Flag to indicate the request body content is encrypted. This must be always set to true. | | Authorization | Please see: The Authorization Header | OAuth authorization header. | ### Request Structure {#request-structure} The following structure is needed when encrypting a payload. ```JSON { "encrypted_payload": { "data": "JWE encrypted payload" } } ``` or JWE encrypted payload #### Sample Request Payload {#sample-request-payload} Encrypted Request Body Example: ```JSON { "encrypted_payload": { "data": "eyJhbGciOiJSU0EtT0FFUC0yNTYiLCJlbmMiOiJBMjU2R0NNIiwiY3R5IjoiYXBwbGljYXRpb24veG1sIiwia2lkIjoiODI2NTk3YzQ2MTRlMWY2ODZhOTllNmY5MTAzYmYxNmJhNTVjNDhmMDU3MmE1YTlkNmI5MmY5YzJiNDA3NDZhNiJ9.fLRDis0rBPUp-YSB4CmKemGZhxiQ2Bzk1F73_vjn2nrf9LF223EBqppto6RgoSdTUyEzCblSMT94r2ipsJ7h_mNFvsv-POcxqKJncYyrmQCvkuYrY-P8BhHun-HATY7OUzeYW2VQdcmVIFOHFWVSznqZ3Db6UcYNC3GSys0q8n-_oV0VcWLHYBopF0oo3nuPKOMUM68Hr9TU8mHQzMYxaclDjOTlX4y0a04OzuWXsWHEkmAtT7eC7Z7SUdtNb6Fh81qHXpEfGy880vCVJE91ymfTCutQXKdL6bykxv4rNM4Db1aWuZbrHj5ffmNo-1yzb6shBBNRHNPNc7hclZcuaA" } } ``` ### Decrypting Response Payload {#decrypting-response-payload} Mastercard Cross-Border Service will respond with an encrypted response for all encrypted requests which are able to be processed. #### Response Structure {#response-structure} The following Response payload structure will be used for encrypted responses. ```JSON { "encrypted_payload": { "data": "JWE encrypted payload" } } ``` or JWE encrypted payload The below HTTP header parameters content type application/json or application/xml will be specified, additionally **x-encrypted: true** header will be returned in HTTP Response header. | HTTP Header Parameters | Example Value | Description | |------------------------|------------------|----------------------------------------------------------------------| | Content-Type | application/json | This is the format of the response content. | | x-encrypted | TRUE | Value would be 'true' to indicate the response content is encrypted. | Mastercard will set the kid property to a value of the fingerprint displayed under Mastercard Encryption Keys when sending their encrypted response. In turn, the kid property on the JWE JOSE header can be used to identify the correct private key for decryption. #### Mastercard Encryption Key example {#mastercard-encryption-key-example} ![mc-encryption-key](https://static.developer.mastercard.com/content/cross-border-services/uploads/MA_EncryptionKeyExample.PNG) #### Sample Response Payload {#sample-response-payload} Encrypted Response Body Example: ```JSON { "encrypted_payload": { "data": "eyJlbmMiOiJBMTI4R0NNIiwiYWxnIjoiUlNBLU9BRVAtMjU2In0.g8iwx7vrRYJJ9EzJnOvlwM0e3RceeYK7M9dST56HVi36MjmhW2a2Ap-h2MtRHALzpYA6BWbfT0QhV4QUz5PWfVjRsCr2Zw1gC8zEIKNSKQWOqDcnAntT-h3F7DRccdXXTdQli1WJJXLUR9DkbkNzuJDpj16bBnHghtXTEEJpznMpaJmDXIL9ItYjZv1Iz-WK90SdFJ9Iv-oXVMHSCXjgTyPwwjQk6TLNufOKsWCuztXC6SaMBZuAHy9TAPO2aDLMYq2BfoXJCWDS_-jidiL-HfTJw8u2s6UvcUMAbIRp57R_r-eycysVsa7CAG-mRuLlQFa0JHD3e7O-b3ER8dFDrg.0O2AuD6mL__dfB0e.ps2uDrU9wt7Nk9Cmt9sq3vPwJjoMOuLahHwaDe3Km38b5IKMNpIKe_mG5tpWm7cm9uGKXYc4RlPMMproZ-hDXks70BGCs5O0aBMM4AOl4sBFa4xRxa8B99cIBebYssRaJXxcoulU7FAUc6Ol0ShxN8pA7D--FpCMW4bnaKpXgHM9YNh9HWPTJLJKguGDm2qrqkSoKnWQS3J6XrW9VOV97lezAvYV4dLWOzU0IVxipF-RfvMoXK6XI-1sP3rgv2gIkObwho6yD2gcBO1A9uKi-kOCkvJaD7ouw5o67VwPjdF3ye-hTRSn9raq018ICW1cJPhE9auIWaKbI9EguqlMHfhF6grp2GHDcNilwVikPStEZAEisnUBMxR0nGmmQsW4foNDvWTXz8Adz0fC7h-zMgDmV0WUv1jKR2oa565K3WiYYb8Jx6Ymz1YI-Om6InbKkHvizkcFh8hAGXAGrID_sbGvcPjDguzutL_6LNy7hV4Zud9DOtSRyQJzLXHqEE77tKGR7NJw-QWoGI6YDSvYB3Mw6v-vC4lKNxgAAP5X3ysYIPtUXli31kzYkvwQxwjDnfRDFBLo9yS8XenYLNaCP089_kjb4tZy4G7rb4O9_vgTrs2iBZ2zdjHVam0eKJoOF3gOIIdLAAzJmn3RzdQa.te6ngAa6zahgREnOQeUhyg" } } ``` ### Error Handling {#error-handling} Error message responses, including Rejected payments, are not encrypted. The exact error structure documented from the original API will be provided in response. #### HTTP Header Parameters {#http-header-parameters-1} | Param Name | Example Value | Description | |--------------|------------------|---------------------------------------------| | Content-Type | application/json | This is the format of the response content. | #### Sample Error Response Payload {#sample-error-response-payload} Response Body: ```JSON { "Errors": { "Error": { "Description": "Value contains invalid character", "Details": { "Detail": { "Name": "ErrorDetailCode", "Value": "062000" } }, "ReasonCode": "INVALID_INPUT_FORMAT", "Recoverable": "false", "RequestId": null, "Source": "Encrypted Payload" } } } ``` #### Testing Encrypted Payload {#testing-encrypted-payload} **Live customers** wanting to test API payload encryption for partner-initiated transactions (such as Quotes, Payment and Retrieve payment APIs) can self-validate in the MTF and production environments by following the above steps then confirming: 1. Successful Response 2. X-encrypted field set to True in HTTP header. If support is needed, live customers should reach out to their Mastercard Customer Support team. **New customers** will test basic API payload encryption in Sandbox environment. Specialized testing scenarios will be performed with the Customer Implementation Services (CIS) team during onboarding. #### Encrypted Push Notifications {#encrypted-push-notifications} **Live** and **New customers** wanting to set up encryption for push notifications (such as Status change and Carded rates) will need to coordinate MTF/Production testing with the Customer Implementation Services team by opening a project. The CIS Team will ask for the Open API Client ID for both MTF and Production when setting up the encrypted push notifications. Test accounts to initiate push transactions will be provided if necessary. ## Environment Descriptions {#environment-descriptions} The following table describes the environments available for Mastercard Cross-Border Services. The environment you reach depends on your onboarding status: customers who are not yet onboarded receive simulated responses from Sandbox, while onboarded customers receive valid, end-to-end responses from MTF. ![mastercard-environments](https://static.developer.mastercard.com/content/cross-border-services/uploads/Send_environments.png) ### Sandbox {#sandbox} * An open, self-service test environment where developers can experiment with API calls without affecting real data or systems, so any errors or issues can be safely identified and resolved. * To access Sandbox, select `Mastercard Cross-Border Services` when creating a project and generating your project keys. ### MTF (Market Test Facility) {#mtf-market-test-facility} * A pre-production environment that mirrors Production behavior, returning valid, end-to-end responses using your own contracted data. * Requires additional onboarding and is intended for integration and acceptance testing once you have a contract in place. * Provides access to more powerful testing tools, such as payments test harnesses, so you can validate real transaction flows before going live. ### Production {#production} * The live environment where the API interacts with actual users and data. * To access Production, select [**Request Production Access**](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md#step-6-promote-the-same-project-to-production) in the Reference Service project you have set up. | Environment | Base URL | EU / UK Base URL | |----------------------------|-------------------------------------------|-------------------------------------------------------------------------------------------| | Sandbox | `https://sandbox.api.mastercard.com/send` | `https://sandbox.api.xbs.mastercard.eu/send` `https://sandbox.api.xbs.mastercard.uk/send` | | MTF (Market Test Facility) | `https://sandbox.api.mastercard.com/send` | `https://mtf.api.xbs.mastercard.eu/send` `https://mtf.api.xbs.mastercard.uk/send` | | Production | `https://api.mastercard.com/send` | `https://api.xbs.mastercard.eu/send` `https://api.xbs.mastercard.uk/send` | Note: Customers contracted with **MTS EU** or **MTS UK** must use the corresponding EU or UK base URL to comply with the jurisdiction-based Regulatory Technical Standards derived from PSD2. All other customers use the global base URL. ## Getting Started with the APIs using OAuth 1.0a {#getting-started-with-the-apis-using-oauth-10a} Alert: If you are a Customer contracted with MTS EU or MTS UK, you must use [OAuth 2.0 Authorization Code flow](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-access-token-based-authentication-details/index.md) for Balance APIs and [OAuth 2.0 Request Token based flow](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-request-token-based-authentication-details/index.md) for all APIs (except Balance API) as the authentication mechanism to ensure compliance with the relevant jurisdiction-based Regulatory Technical Standards (either EU or UK) derived from the Revised Payment Services Directive (PSD2). Proceed to the [Getting Started with the APIs using OAuth 2.0](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#getting-started-with-the-apis-using-oauth-20) section below for step-by-step setup instructions. Follow these step-by-step instructions to connect to the Cross-Border Services APIs. **Expand the following section for the full OAuth 1.0a setup**. ### Step 1: Create Project and Project Keys {#step-1-create-project-and-project-keys} To start using the Cross-Border Service APIs, you must create a [Mastercard Developers account](https://developer.mastercard.com/account/sign-up) and then create a project choosing the **Mastercard Cross-Border Services** API service. The project will generate the project keys required to use the APIs in each of the environments. The [Quick Start Guide](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md) provides detailed information about creating a project and downloading the project keys. In case, if you have an existing project, refer [Adding a new service to an existing project](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md#adding-a-new-service-to-an-existing-project). Note: Project keys are subject to annual renewal. Mastercard recommends that you use a group email address when creating your project to ensure that team members can access the Mastercard Developers account used for testing and production. For more details, see [Credential Management](https://developer.mastercard.com/platform/documentation/credential-management/) ### Step 2: Connect to the API {#step-2-connect-to-the-api} You start connecting to the API in the **sandbox** environment, where you access API stubs that return simulated, static responses. See the [Environment Descriptions](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#environment-descriptions) section for details. The Cross-Border Service APIs are RESTful APIs with OAuth security. So for all environments, your API requests must have an OAuth 1.0a Authorization Header for authentication and your request payload must be encrypted. For more detailed information on payload **Encryption/Decryption** , see the [Transport Encryption](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#transport-encryption) section above. Note: API error responses are not encrypted. ### Step 3: Generating your own API client {#step-3-generating-your-own-api-client} * Create customizable API clients from the Cross-Border Services API specification and let the Mastercard open-source client libraries handle the authentication for you. This approach offers more flexibility and is strongly recommended. * Follow the [Generating and Configuring a Mastercard API Client](https://developer.mastercard.com/platform/documentation/developer-tools/generating-and-configuring-a-mastercard-api-client/) tutorial using the [cross_border-swagger.yaml](https://static.developer.mastercard.com/content/cross-border-services/swagger/cross_border-swagger.yaml) (399KB) API specifications. * Cross-Border Services exposes REST APIs: you are free to use the REST/HTTP client of your choice and can still leverage the Mastercard open-source [client libraries](https://developer.mastercard.com/platform/documentation/authentication/using-oauth-1a-to-access-mastercard-apis/#client-libraries) for signing your requests and the Mastercard [client encryption libraries](https://github.com/Mastercard?&q=client-encryption) for payload encryption and decryption. For the API specification, refer to [API Reference](https://developer.mastercard.com/cross-border-services/documentation/api-ref/index.md). There is a detailed tutorials with step-by-step guidance to help you integrate with our APIs. Explore the [Tutorials and Guides](https://developer.mastercard.com/cross-border-services/documentation/tutorials/index.md) and to see a working integration you can inspect and reuse refer to the [Reference Application](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/index.md). ## Getting Started with the APIs using OAuth 2.0 {#getting-started-with-the-apis-using-oauth-20} If you are a Customer contracted with **MTS EU** or **MTS UK**, follow the step-by-step instructions below to connect to the Cross-Border Services APIs using OAuth 2.0 as an authentication mechanism. ### Step 1: Set up mTLS via the Key Management Portal (KMP) {#step-1-set-up-mtls-via-the-key-management-portal-kmp} To make a successful Cross-Border Services API call, you must first establish mTLS connectivity between your application and Mastercard's Cross-Border Services APIs. Expand the sections below for how to obtain KMP access, set up mTLS, and renew your certificate. The Key Management Portal (KMP) is an application available in [Mastercard Connect](https://mastercardconnect.com) as a self-service portal for Mastercard customers, which allows them to request and exchange keys and certificates with Mastercard. The portal provides guided workflows to create and manage requests for key and certificate exchange, as well as an inventory of all PKI for Business Partners keys and certificates that have been exchanged between you and Mastercard using KMP. This access is required for both the initial mTLS setup and for certificate renewal. #### Obtain access to the Key Management Portal (KMP) {#obtain-access-to-the-key-management-portal-kmp} ##### Pre-Requisite {#pre-requisite} To access KMP, you must be signed up to [Mastercard Connect](https://mastercardconnect.com). Please contact your Mastercard representative to get help with Mastercard Connect Signup. ##### How to request access to KMP {#how-to-request-access-to-kmp} * Sign in to [Mastercard Connect](https://mastercardconnect.com). * Click Store in the top menu. * Search for Key Management Portal. You can also select Administration under Business capabilities to narrow down the results. ![kmp-tile](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_01.png) * On the Key Management Portal card, select Request. * Select Security Officer Level 1 access. * Click Request access. ##### Ensure complete setup in KMP {#ensure-complete-setup-in-kmp} * Your company must have at least 2 active Security Officers on the Key Management Portal to be permitted to create new requests in KMP. If you see the following message when logging into KMP then your company needs to have at least 1 additional Security Officer registered on the Key Management Portal application in Mastercard Connect. ![security-officer-required](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_40.png) * Furthermore, if not already done, a Certificate Management Group email must be added to your company profile. ##### How to add a Certificate Management Group email {#how-to-add-a-certificate-management-group-email} Your Certificate Management Group email is an alternative means of communication which the Mastercard Key Management Delivery team will use for crucial communication with your organization and in case there is no longer an active user on the Key Management Portal. Follow below steps to add a Certificate Management Group email: 1. Click **My Company** ![my-company](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_03.png) 2. Click on the pencil icon next to Certificate Management Group Email ![edit-group-email](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_04.png) 3. Enter your Certificate Management Group email and click Save ![save-grou-email](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_05.png) ##### Login to the Key Management Portal {#login-to-the-key-management-portal} 1. Sign in to [Mastercard Connect](https://mastercardconnect.com). 2. Click My Items. ![kmp-sign-in](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_02.png) 3. Click on the Key Management Portal card to Open it. Once you have obtained access to the Key Management Portal (KMP), follow the below steps to set up your mTLS certificate for the first time. #### Step 1: Generate CSR {#step-1-generate-csr} There are multiple tools that you can use to create a CSR, such as Java keytool, OpenSSL etc. Here, we will be using OpenSSL's req utility to generate both the private key and CSR in one command. Generating the private key in this way will ensure that you will be prompted for a pass phrase to protect the private key. The OpenSSL command below will generate a 2048-bit RSA private key and CSR: ```OpenSSL_Command openssl req -newkey rsa:2048 -keyout PRIVATEKEY.key -out MYCSR.csr ``` where ```Where * openssl is the command for running OpenSSL. * req is the OpenSSL utility for generating a CSR. * -newkey rsa:2048 tells OpenSSL to generate a new 2048-bit RSA private key. If you would prefer a 4096-bit key, you can change this number to 4096. * -keyout PRIVATEKEY.key specifies where to save the private key file. * -out MYCSR.csr specifies where to save the CSR file. Note: Replace the filenames shown in ALL CAPS with the actual paths and filenames you want to use. ``` After typing the command, press enter and you will be presented with a series of prompts: First create and verify a pass phrase. Remember this pass phrase because you will need it again to access your private key. * You will now be prompted to enter the information which will be included into your CSR. This information is also known as the Distinguished Name, or DN. \*The Common Name field is required, when submitting your CSR, but the others are optional. (If you would like to skip an optional item, simply type enter when it appears) * The Country Name takes a two-letter country code. * The Locality Name field is for your city or town. * The Organization Name field is for the name of your company or organization. * The Organizational Unit Name (eg, section):\ * The Common Name field is used for the Fully Qualified Domain Name (FQDN) of the website this certificate will protect. Please use "MTF XBS" for MTF environment and "PROD XBS" for Prod environment. * Email Address Upon completion of this process, you will be returned to the command prompt. The newly created CSR file can be found within the specified folder in the OpenSSL command. Please ensure to store the generated private key securely for future use. For your reference, here's a sample CSR (represented as a Base64 encoded): ```Sample_CSR ----BEGIN CERTIFICATE REQUEST----- MIICzDCCAbQCAQAwgYYxCzAJBgsdfsdNVBAYTAkVOMQ0wCwYDVQQIDARub25lMQ0wCwYD VQQHDARub25lMRIwEAYDVQsdfQKDAlXaWtpcGVkaWExDTALBgNVBAsMBG5vbmUxGDAW BgNVBAMMDyoud2lraXBlZGlhLm9yZzEcMBoGCSqGSIb3DQEJARYNbm9uZUBub25l LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMP/U8RlcCD6E8AL PT8LLUR9ygyygPCaSmIEC8zsdfXsdfGJung3ykElXFRz/Jc/bu0hxCxi2YDz5IjxBBOpB/ kieG83HsSmZZtR+drZIQ6vsdfOsr/ucvpnB9z4XzKuabNGZ5ZiTSQ9L7Mx8FzvUTq5y /ArIuM+FBeuno/IV8zvwAe/sdfVRa8i0QjFXT9vBBp35aeatdnJ2ds50yKCsHHcjvtr 9/8zPVqqmhl2XFS3Qdqlsprzsdfbgksom67OobJGjaV+fNHNQ0o/rzP//Pl3i7vvaEG 7Ff8tQhEwR9nJUR1T6Z7ln7S6cOr23YozgWVkEJ/dSr6LAopb+cZ88FzW5NszU6i 57HhA7ECAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4IBAQBn8OCVOIx+n0AS6WbEmYDR SspR9xOCoOwYfamB+2sdfBpmtsdf82R01zJ/kaqzUtZUjaGvQvAaz5lUwoMdaO0X7I5Xfl sllMFDaYoGD4Rru4s8gz2qG/QHWA8uPXzJVAj6X0olbIdLTEqTKsnBj4Zr1AJCNy /YcG4ouLJr140o26MhsdfwBpoCsdfRpPjAgdYMH60BYfnc4/DILxMVqR9xqK1s98d6Ob/+ 3wHFK+S7BRWrJQXcsdfM8veAexXuk9lHQ+FgGfD0eSYGz0kyP26Qa2pLTwumjt+nBPl rfJxaLHwTQ/1988G0Hsdf35ED0sdff9Md5fzoKi5evU1wG5WRxdEUPyt3QUXxdQ69i0C+7 ----END CERTIFICATE REQUEST----- ``` #### Step 2: Request certificate in KMP using CSR {#step-2-request-certificate-in-kmp-using-csr} To request certificate in KMP using your CSR, please follow the below steps: 1. Login to the Key Management Portal. 2. On the Certificates page or on the Certificate Requests page, click Start New Request. 3. Select Crossborder Services API-MTLS Application. 4. Select the Request Type, Environment, Certificate Profile and Mastercard Project Contact email, if prompted. The email must have the @mastercard.com domain. ![cert-request-form](https://static.developer.mastercard.com/content/cross-border-services/uploads/reqcertkmp.png) 5. The DN Requirements appear to indicate you must adhere to the DN requirements in your CSR. 6. Upload your CSR file generated and click Next. ![upload-csr-file](https://static.developer.mastercard.com/content/cross-border-services/uploads/csr.png) 7. Review the CSR values to ensure they adhere to the DN requirements. ![review-csr-values](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_18.png) 8. Enter Subject Alternate Names (SAN) if necessary (domain names need to be comma-separated) and Click Submit. At this stage, the Mastercard's Key management Security officer will receive the request. Once your certificate has been approved, you will get an email notification that the certification has been approved and then you may proceed to download the signed certificate from KMP. #### Step 3: Download the certificate from KMP {#step-3-download-the-certificate-from-kmp} Once you receive the approval on your certificate generation request, you need to go to KMP to download the certificate. **How to download certificate on KMP:** 1. Login to KMP 2. On the Detail screen, click Actions, then Download. ![download-button](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_11.png) 3. If you're downloading a certificate or a CA Chain, select a Format from list. ![choose-format](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_12.png) 4. Select the preferred ordering of Root CA (unless you select the DER format in which case the Root Chain cannot be included). ![choose-chain-order](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_13.png) 5. Click Download. Now, the downloaded file will be saved in the default download folder of your browser. Following are the several different outcomes that may be observed: 1. For any certificate or CA chain being downloaded in the PEM (PKCS #8), PEM (Open SSL) or PKCS #7 format, the root chain is always included in the downloaded file containing the certificate and chaining: i) For PEM (PKCS #8), PEM (Open SSL), the downloaded file is a .pem file ii) For PKCS #7, the downloaded file is a .p7b file 2. Where the user is downloading a certificate for an application which requires mutual authentication, an extra CA Chain is delivered along with the certificate chaining inside a zip file 3. Where the DER format was selected, only the end entity certificate is provided in a .cer file, the CA chain (Sub and Root CA) is not included. #### Step 4: Create trust store for the downloaded certificate and private key {#step-4-create-trust-store-for-the-downloaded-certificate-and-private-key} For your convenience, here's a sample on creating trust store using Open SSL command: ```OpenSSL openssl pkcs12 -export -out cert.p12 -in cert.pem -inkey key.pem -passin pass:root -passout pass:root ``` where pkcs12: This option combines a PEM certificate file and a private key to PKCS#12 file format export: This option exports the file out: It creates an output file as cert.p12, this name can be anything but the extension must be .p12 in: It takes an input file, this is a pem file which you get from the above steps inkey: This is the private key file which was obtained from above steps passin: pass phrase source to decrypt any input private keys with passout: pass phrase source to encrypt any output private keys with You will need the above .p12 file to connect to Cross-Border Services APIs. #### Step 5: Trust Mastercard's certificate {#step-5-trust-mastercards-certificate} To obtain Mastercard's certificate, please contact your Mastercard representative to create a new request on your behalf. Once available, add the certificate to your trust store. Note: Well Done! You have successfully completed the mTLS setup required to connect to the Mastercard Cross-Border Services API. You may initiate the certificate renewal process in KMP before the certificate expires. Ensure you have obtained access to the Key Management Portal (KMP) and then follow the below steps. #### Step 1: Locate the certificate requiring renewal {#step-1-locate-the-certificate-requiring-renewal} 1. Login to the Key Management Portal. 2. Find the certificate of interest in the Certificates Inventory. ![Certificates-Inventory](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_06.png) 3. Open the certificate by clicking the Reference link. ![open-certificate](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_07.png) 4. On the Certificate Details screen, select Actions \> Renew Certificate. ![renew-certificate](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_09.png) #### Step 2: Initiate Certificate Renewal {#step-2-initiate-certificate-renewal} **If the expiring certificate already exists in KMP** 1. The request form appears already prepopulated with information contained in the expiring certificate record in KMP ![pre-populated-form](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_39.png) 2. Upload your CSR file generated in compliance with the DN requirements which can be found in the Support Page 3. Click Next 4. Review the CSR values to ensure they match the Expiring Certificate DN Details and adhere to the DN Requirements. 5. Enter Subject Alternate Names (SAN) if necessary (domain names need to be comma-separated) 6. Click Submit **If the certificate is not in the Certificate listing in KMP** 1. Enter the Expiring Certificate Serial Number 2. The Expiring Certificate DN and the DN Requirements appear ![dn-requirements](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_37.png) 3. Upload your CSR file generated in compliance with the DN requirements which can be found in the Support Page 4. Click Next 5. Review the CSR values to ensure they match the DN Requirements. ![review-csr](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_38.png) 6. Enter Subject Alternate Names (SAN) if necessary (domain names need to be comma-separated) 7. Click Submit Note: Note: If you are viewing a certificate which has been renewed in the portal, you will not be able to download it. KMP allows you to download only the latest version of a given certificate. To find the latest version of the certificate you're viewing, click the Renewed By link to open the next version. ![find-latest-version-of-cert](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_10.png) Note: For Sandbox EU/UK domain testing, an mTLS certificate is not needed. APIs can be accessed directly using the REQUEST and ACCESS tokens. ### Step 2: Create project to generate signing and encryption keys {#step-2-create-project-to-generate-signing-and-encryption-keys} Generate your credentials on the Mastercard Developers website by creating a project that uses the **Mastercard Cross-Border Services** API service. For detailed steps, see the [Quick Start Guide](https://developer.mastercard.com/cross-border-services/documentation/quick-start-guide/index.md). Note: * The Quick Start Guide steps through the OAuth 1.0a key creation. Follow the same steps, because OAuth 2.0 uses the same project keys as OAuth 1.0a. * Project keys are subject to **annual** renewal. Mastercard recommends that you use a group email address when creating your project so that team members can access the Mastercard Developers account used for testing and production. For more details, see [Credential Management](https://developer.mastercard.com/platform/documentation/credential-management/). ### Step 3: Prepare authentication header {#step-3-prepare-authentication-header} The Cross-Border Services APIs are RESTful APIs with OAuth security in conformity with the Regulatory Technical Standards (either EU or UK) derived from the Revised Payment Services Directive (PSD2). Generate the OAuth 2.0 authentication header using the appropriate token flow: | | | |-----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | All APIs except Balance API | [Use OAuth 2.0 Request Token based flow](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-request-token-based-authentication-details/index.md) | | Balance API | [Use OAuth 2.0 Authorization Code flow](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-access-token-based-authentication-details/index.md) | Note: A `Host` header must be passed with every API request. Set its value based on the target environment: * **Sandbox** : `sandbox.api.xbs.mastercard.eu` or `sandbox.api.xbs.mastercard.uk` * **MTF** : `mtf.api.xbs.mastercard.eu` or `mtf.api.xbs.mastercard.uk` Production `Host` header values are provided once your project is onboarded for Production access. ### Step 4: Payload Encryption/Decryption {#step-4-payload-encryptiondecryption} Create encryption/decryption keys to encrypt the request payload and decrypt the response payload. All request payloads sent by you to Mastercard must be encrypted, and you must decrypt the response payloads sent by Mastercard. For more detailed information on payload **encryption/decryption** , see the [Transport Encryption](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#transport-encryption) section. Note: API error responses are not encrypted. ### Step 5: Connect with Cross-Border Services REST APIs over the API Gateway {#step-5-connect-with-cross-border-services-rest-apis-over-the-api-gateway} You start connecting to the API in the **sandbox** environment, where you access API stubs that return simulated, static responses. See the [Environment Descriptions](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#environment-descriptions) section for details. Connect to the Cross-Border Services APIs according to the [API specification](https://developer.mastercard.com/cross-border-services/documentation/api-ref/index.md), using either of the options below. #### Option 1: Direct Integration with APIs (using any REST client) {#option-1-direct-integration-with-apis-using-any-rest-client} For your convenience, Mastercard provides reference applications that demonstrate how to connect to the Cross-Border Services APIs using a REST client. Download the [OAuth 2.0 Authorization Code flow and Request Token based flow sample reference applications](https://github.com/Mastercard/crossborder-services-reference-app-oauth2). Note: The reference applications are for reference purposes only. Your production application does not need to function the same way. For step-by-step guidance, see the [OAuth 2.0 Authorization Code flow Reference Tutorial](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-reference-app-tutorial-access-token/index.md) and the [OAuth 2.0 Request Token based flow Reference Tutorial](https://developer.mastercard.com/cross-border-services/documentation/developer-tools/ref-app/oauth2-reference-app-tutorial-request-token/index.md). #### Option 2: Generate SDK to integrate with APIs {#option-2-generate-sdk-to-integrate-with-apis} Alternatively, generate a simple client using the [OpenAPI Generator](https://openapi-generator.tech/docs/integrations/) along with the [Mastercard libraries for authentication](https://github.com/Mastercard?utf8=%E2%9C%93&q=oauth), and use the client to connect to the Mastercard Cross-Border Services APIs. ## Getting started with Push Notifications {#getting-started-with-push-notifications} In addition to the request/response APIs described earlier, Mastercard Cross-Border Services can send you push notifications for status changes, carded rate updates, requests for information (RFI) and account validation results. Push notifications are opt-in and delivered to a webhook endpoint you host, secured with mutual TLS (mTLS). Expand the section below for the list of available push notifications, webhook setup steps and certificate exchange options. Mastercard Cross-Border Services offers the following push notifications as opt-in Services: 1. [Status Change Push](https://developer.mastercard.com/cross-border-services/documentation/api-ref/transaction-apis/status-change-api/index.md) 2. [Carded Rate Push](https://developer.mastercard.com/cross-border-services/documentation/api-ref/transaction-apis/carded-rate-api/index.md) 3. [RFI Push](https://developer.mastercard.com/cross-border-services/documentation/api-ref/value-added-services/rfi-apis/notification/index.md) 4. [Account Validation Push](https://developer.mastercard.com/cross-border-services/documentation/api-ref/value-added-services/account-validation-apis/account-validation-api/index.md) Mastercard Cross-Border Services expects HTTP Response Code 200 for all push notifications. In the event of a timeout or error, Mastercard Cross-Border Services will resend the notification with a maximum of three retries. This would unknowingly cause duplicate notifications. So Mastercard Cross-Border Services recommends Customer to build logic in their systems to identify the `eventRef` and ignore any duplicate notifications with the same `eventRef`. ### Push Notification Setup {#push-notification-setup} * Push APIs involve a Mutual Secure Connection to be established between Mastercard and the External partner server which exposes the webhook endpoint (URL). This is achieved through Mutual TLS (mTLS) authentication method. #### Step 1: Provide Push API Notification Webhook URL {#step-1-provide-push-api-notification-webhook-url} You will provide the Webhook URL for both the MTF and the PROD environments. The Webhook URLs must be active on your network. Mastercard API Gateway (APIGW) does not perform any connectivity check explicitly after onboarding your Webhook. You should confirm your domain is getting pinged from the internet before submitting Webhook URL. **Follow the below guidelines for the endpoint URL.** * You should provide endpoint URL. * The URL needs to be public and reachable on internet. * It needs to be FQDN (Fully Qualified Domain Name) and HTTPS. * The domain name should be resolvable and webhook should not be created with IP. * The URL should end with /Webhook -- no other query parameter in URL or header is allowed/required. Ex: Not accepted: api.fakecompany.com/?id=xxx. Ex: Accepted : api.fakecompany.com/xbs/status/webhook. * You should not create a webhook expecting Oauth token to be sent. * You should not create a webhook waiting for a POST parameter containing the api-key (fixed value). * Mastercard supports different destination paths for push notifications in both mtf and production environments. Note: * Mastercard does not recommend using IP address allow-listing as a security measure for inbound or outbound services. This method is not seen as robust or scalable for securing webhook communications or API integrations. * However, if your organization needs the list of outbound IP addresses used by the API Gateway for firewall configuration, your Mastercard Customer Implementation Services (CIS) Representative can provide these details upon request. #### Step 2: Exchange certificate {#step-2-exchange-certificate} ##### Configuration Details {#configuration-details} Note: * Use these configuration details only with options 1 and 2 when a Mastercard-issued client certificate is used in the MTLS flow for push notifications. * For option 3, you must define the Distinguished Name (DN) and Mastercard creates the CSR according to those requirements, as the client certificate will be issued by your Certificate Authority (CA). Partners and customers using Mastercard products or services via push notifications to partner webhook endpoints should refer to the following certificate Distinguished Name (DN): * Member-Test-Facility_(MTF) * Production ```Member-Test-Facility_(MTF) CN=CrossborderServicesNotification-mtf.mastercard.com, OU=admin, O=MasterCard International Incorporated, L=O'Fallon, ST=Missouri, C=US ``` ```Production CN=CrossborderServicesNotification-prod.mastercard.com, OU=admin, O=MasterCard International Incorporated, L=O'Fallon, ST=Missouri, C=US ``` ##### Option 1: CA Trust method for the MTLS {#option-1-ca-trust-method-for-the-mtls} Mastercard certificate authority (CA) is DigiCert. If you trust all certificates issued by DigiCert as CA, there are no action required by you. In this case, you should already be trusting the DigiCert CA Chain that has signed Mastercard domain certificate. You can download the outbound DigiCert CA certificates directly from the [CA website](https://www.digicert.com/kb/digicert-root-certificates.htm#roots:~:text=0F%3AFA%3AE1%3AF3%3A1A%3A2B%3A43%3A3C%3A3D%3A9A%3AE1%3A6D%3A64%3A3B%3A58%3A8B): * /C=US/O=DigiCert Inc/CN=DigiCert Assured ID Client CA G2 * /C=US/O=DigiCert Inc/OU=www.digicert.com/CN= DigiCert Assured ID Root G2 Note: * If necessary, Mastercard can also share the CA certificates with you through the Key Management Portal in Mastercard Connect. * As pre-requisite, you must have access to the Key management portal (KMP) in Mastercard Connect and must have registered the KMP security officers through the same application. * The Inbound and Outbound CA certificates are different. Inbound CA certificates are used for services initiated by the customer to Mastercard, while Outbound CA certificates are used for services initiated by Mastercard to the customer. The DigiCert CA certificates used by Mastercard are: * **Inbound**: DigiCert Global G2 TLS RSA SHA256 2020 CA1 and DigiCert Global Root G2 * **Outbound**: DigiCert Assured ID Client CA G2 and DigiCert Assured ID Root G2 1 ##### Option 2: Non-standard MTLS validation {#option-2-non-standard-mtls-validation} Note: Mastercard recommends using option 1 from the given options for the issued certificate. A non-standard MTLS validation such as certificate pinning or to locally store the end-entity client certificate for infrastructure requirement, requires Mastercard to share the full CA chain with the customer including the Mastercard client leaf certificate. 1. The CIS implementation representative initiates the request for the key exchange process to the Mastercard Key Management team only after ensuring that the customer can access the KMP portal and can register their KMP security officers. 2. After the key exchange over KMP, you need to download and configure the CA certificates in addition to the Mastercard client certificate in your server trust store for a successful mTLS authentication for outbound services. 3. Follow the instructions in the [mTLS on-boarding steps (Option 2)](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#mtls-on-boarding-steps-option-2) section to complete the API Notification Mutual TLS setup. ###### mTLS on-boarding steps (Option 2) {#mtls-on-boarding-steps-option-2} This section details the APIGW Client CA/Certificate exchange process required when a Mastercard-issued client certificate is used in the mTLS flow for outbound push notifications. It applies only if you selected Option 2: Non-standard MTLS validation. * You should give confirmation that you will be able to trust Mastercard DigiCert Client CA * CA chain or the client certificate should be shared with you via Key Management Portal. Your registered security officers will get notified by email about the availability of the files. They can access KMP application in Mastercard Connect to download the CA/Cert files. * Once your registered security officers get notified by email, follow the steps that follow. ###### Step 1: Obtain access to Key Management Portal and ensure complete setup {#step-1-obtain-access-to-key-management-portal-and-ensure-complete-setup} For instructions on obtaining KMP access and completing your company profile setup, see the [Key Management Portal (KMP)](https://developer.mastercard.com/cross-border-services/documentation/api-basics/index.md#obtain-access-to-the-key-management-portal-kmp) section. Once your certificate management group is set up, the Mastercard team will initiate the cert generation process. As soon as your certificates are ready to download, your security officer will receive email notifications from Mastercard for each certificate shared. ###### Step 2: Download the certificate from KMP {#step-2-download-the-certificate-from-kmp} **How to download certificate on KMP:** 1. Once your security officer receives email from the Mastercard team, they may click the links in the emails they receive to go straight to the request in the KMP so they can download the certificates. Or they may navigate to it by logging into the KMP and "How to view certificates" and download the certificates. There will be 4 certificates shared with you (2 for Production and 2 for MTF environment). ![download-cert](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_44.png) 2. On the Certificate Detail screen, click Actions, then Download. 3. If you're downloading a certificate or a CA Chain, select a Format from list. You may select PEM (PKCS #8) or PEM(Open SSL) or PKCS #7 per your preference. ![choose-cert-format](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_12.png) 4. Select the preferred ordering of Root CA (unless you select the DER format in which case the Root Chain cannot be included). ![choose-chain-order](https://static.developer.mastercard.com/content/cross-border-services/uploads/kmp_13.png) 5. Click Download. Now, the downloaded file will be saved in the default download folder of your browser. Several different outcomes may be observed: 1. For any certificate or CA chain being downloaded in the PEM (PKCS #8), PEM (Open SSL) or PKCS #7 format, the root chain is always included in the downloaded file containing the certificate and chaining: i) For PEM (PKCS #8), PEM (Open SSL), the downloaded file is a .pem file ii) For PKCS #7, the downloaded file is a .p7b file 2. Where the user is downloading a certificate for an application which requires mutual authentication, an extra CA Chain is delivered along with the certificate chaining inside a zip file ###### Step 3: Trust Mastercard's certificate {#step-3-trust-mastercards-certificate} Please add the certificate that you downloaded in the previous step to your trust store. ##### Option 3: Third-Party certificates handling process {#option-3-third-party-certificates-handling-process} If your infrastructure does not support external Certificate Authorities (CAs) like DigiCert for inclusion in your trust store, and instead relies on your own designated CAs to authenticate server connections for outbound communication, then follow these steps for handling the third-party certificates: 1. Reach out to the Mastercard implementation representative with a request to allow own preferred CAs for authentication. 2. The representative works internally to request handling of the third party client certificates. 3. Once approved, you will get an email from the Key Management team within Mastercard to proceed. 4. Login to KMP and download the CSR. 5. Provide the client certificate signed by your Third-Party CA in the same KMP portal.
Once the configuration is completed, your Mastercard implementation representative informs you to proceed with the testing phase. ### Partner Server CA/Certificate Requirements {#partner-server-cacertificate-requirements} * The validation of the server certificate provided by the "External Partner" platform doesn't require an exchange of CA/Certificates to be installed in the APIGW. * The requirement will be for the "External Partner" server which is hosting the webhook endpoint to use a TLS certificate that is signed by an industry standard CA and is accepted by Mastercard. You cannot use a Self-signed Server Certificate. * Mastercard representative will ask the "External Partner" to share their server cert's CA, so that Mastercard representative can confirm the CA used by you is supported by Mastercard. Note: \* In the event where you are using a CA that is not recognized by Mastercard, Mastercard representative will have to inform you that you need to submit the Root and intermediates CAs in Base64 .pem file via KMP portal using "Other" as the application and indicating in the comment that the key exchange is for the MTLS CA trust addition in API Gateway for Cross-Border Outbound API services. ### How to identify {#how-to-identify} Contact your organization technical team (IT support or operations) that support your servers or APIs that Mastercard connects to and ask them to confirm whether your middleware is configured for the CA Trust method of validating mutually authenticated transport layer security (mTLS) for API's, or if the existing certificates are located in the trust store of your servers. If your middleware does require end-entity certificates to be stored in the trust store, then add (import) the new previously mentioned certificates into your trust store as additional valid certificates. ## API Conventions {#api-conventions} 1. URLs are case-sensitive and must be lowercase, except where resource identifiers explicitly require a different case. 2. Use hyphens (`-`) to separate words in URL path elements that contain multiple words. 3. Input parameter names and resource member names are case-sensitive. 4. Escape special characters in submitted XML using the following substitutions: * `<` → `<` * `&` → `&` * `>` → `>` * `"` → `"` * `'` → `'` 5. The `Transaction Reference` request parameter accepts all ASCII characters, except `{ } | ~ \ , ;`. 6. URL-encode query parameter values that contain any of the following characters: `! " # $ % & ' ( ) + , / : ; < = > ? @ [ \ ] \` { \| }\` 7. All times and timestamps returned by the API are expressed in UTC. Refer to [Date and Time Formats](https://developer.mastercard.com/cross-border-services/documentation/additional-resources/common-datetime-format/index.md) for details. 8. Do not include data field names when the corresponding value is empty. 9. Alphanumeric special fields accept UTF-8 characters, except `{ } | ~ \`. 10. Unicode fields accept all Unicode characters, except `{ } | ~ \`. 11. Do not include control characters or escape sequences (for example, `\n` for newline or `\r` for carriage return) in field values. ### Next Steps {#next-steps} Now that you have an understanding of the service's authentication and encryption, proceed to the [Use Cases](https://developer.mastercard.com/cross-border-services/documentation/use-cases/index.md) section to learn how to access the API and generate your credentials.