# How to call the Update Issuer API source: https://developer.mastercard.com/priceless-planet-carbon-tracker/tutorial/test-cases/step7/index.md ### Allow issuers to update configuration details for better user experience {#allow-issuers-to-update-configuration-details-for-better-user-experience} The **Update Issuer** service allows the issuer to update the issuer details in the Carbon Calculator Experience platform. ## Pre-requisites {#pre-requisites} Before executing the test cases, acquaint yourself with the endpoint use case and parameters: * [Update Issuer](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/use-cases/update_issuer/index.md) * [Update Issuer Parameters](https://developer.mastercard.com/priceless-planet-carbon-tracker/documentation/parameters/index.md#update-issuer/) ## Update Issuer Details {#update-issuer-details} 1. To update issuer details on the Carbon Calculator Experience platform, send a PUT request. 2. To create a PUT request, fill out the details as shown in the request. ```py PUT https://sandbox.api.mastercard.com/cts/issuers ``` ```json { "supportedAccountRange": "534403,518145,518152,5403,5424", "privacyNoticeURL": "https://www.issuer.privacy-policy-url.html", "termsAndConditionURL": "https://www.issuer.term-and-conditions.html", "optOutURL": "https://www.issuer.opt-out-url.html", "preferredTheme": { "backgroundColor": "#FFFFFF", "widgetBackgroundColor": "#FFFFFF", "fontColor": "#000000", "buttonColor": "#999999", "barGraphColor": "#111111", "buttonTextColor": "#FFFFFF", "titleFontType": "Mark Offc For MC", "titleFontSize": "28px", "subTitleFontType": "Mark Offc For MC", "subTitleFontSize": "20px", "paragraphFontType": "Mark Offc For MC", "paragraphFontSize": "15px", "buttonTextFontType": "Mark Offc For MC", "buttonTextFontSize": "15px", "linkFontType": "Mark Offc For MC", "linkFontSize": "15px" } } ``` 3. A successful request returns the `HTTP 200 Success` status code with the client ID, customer ID, and the latest updated information of the issuer. ```json { "clientId": "fjl2fxzsYl1OpvxkBItC9nVw1PSQc_b-eQMcmQFg011ab4b5", "customerId": "12345", "supportedAccountRange": "534403, 518145, 518152, 5403, 5424", "status": "ACTIVE", "termsAndConditionURL": "https://www.issuer.term-and-conditions.html", "privacyNoticeURL": "https://www.issuer.privacy-policy-url.html", "optOutURL": "https://www.issuer.opt-out-url.html", "preferredTheme": { "backgroundColor": "#FFFFFF", "widgetBackgroundColor": "#FFFFFF", "fontColor": "#000000", "buttonColor": "#999999", "barGraphColor": "#111111", "buttonTextColor": "#FFFFFF", "titleFontType": "Mark Offc For MC", "titleFontSize": "28px", "subTitleFontType": "Mark Offc For MC", "subTitleFontSize": "20px", "paragraphFontType": "Mark Offc For MC", "paragraphFontSize": "15px", "buttonTextFontType": "Mark Offc For MC", "buttonTextFontSize": "15px", "linkFontType": "Mark Offc For MC", "linkFontSize": "15px" } } ``` ## Failed scenarios {#failed-scenarios} This section discusses some of the failed scenarios and the error messages expected. ### Update issuer details with an invalid BIN Range {#update-issuer-details-with-an-invalid-bin-range} 1. To update issuer details on the Carbon Calculator Experience platform, send a PUT request with an invalid account range. ```py PUT https://sandbox.api.mastercard.com/cts/issuers ``` ```json { "supportedAccountRange":"5051A" } ``` 2. This request fails with the error code `HTTP 400 Bad Request` as the response. ```json { "Errors": { "Error": [ { "Source": "CARBON CALCULATOR EXPERIENCE", "ReasonCode": "INVALID_REQUEST_PARAMETER", "Description": "One of the request parameters is invalid, try again with correct request.", "Recoverable": false, "Details": "Each value in supportedAccountRange must be numeric and size should be between 4 and 8" } ] } } ``` Note: The above test case can also be replicated to test for invalid font, hex code for color preference, font size, missing font type, and missing request body. ### Update issuer details when the Issuer ID is not found {#update-issuer-details-when-the-issuer-id-is-not-found} 1. To update issuer details on the Carbon Calculator Experience platform, send a PUT request. ```py PUT https://sandbox.api.mastercard.com/cts/issuers ``` ```json { "clientId": "fjl2fxzsYl1OpvxkBItC9nVw1PSQc_b-eQMcmQFg011ab4b5", "customerId": "12345", "supportedAccountRange": "534403, 518145, 518152, 5403, 5424", "status": "ACTIVE", "termsAndConditionURL": "https://www.issuer.term-and-conditions.html", "privacyNoticeURL": "https://www.issuer.privacy-policy-url.html", "optOutURL": "https://www.issuer.opt-out-url.html", "preferredTheme": { "backgroundColor": "#FFFFFF", "widgetBackgroundColor": "#FFFFFF", "fontColor": "#000000", "buttonColor": "#999999", "barGraphColor": "#111111", "buttonTextColor": "#FFFFFF", "titleFontType": "Mark Offc For MC", "titleFontSize": "28px", "subTitleFontType": "Mark Offc For MC", "subTitleFontSize": "20px", "paragraphFontType": "Mark Offc For MC", "paragraphFontSize": "15px", "buttonTextFontType": "Mark Offc For MC", "buttonTextFontSize": "15px", "linkFontType": "Mark Offc For MC", "linkFontSize": "15px" } } ``` 2. This request fails with the error code `HTTP 404 Bad Request` as the response. ```json { "Errors": { "Error": [ { "Source": "CARBON CALCULATOR EXPERIENCE", "ReasonCode": "SERVICE_PROVIDER_NOT_FOUND", "Description": "Service provider clientId is not Identified", "Recoverable": false, "Details": "Client not found." } ] } } ```