# Update Service Provider
source: https://developer.mastercard.com/carbon-calculator/documentation/testing/testcase/test_case_update_service_provider/index.md

Allows a registered Service Provider to update its configuration on the server.

## Pre-requisites {#pre-requisites}

Refer to the [Update Service Provider Details](https://developer.mastercard.com/carbon-calculator/documentation/use-cases/update_service_provider_details/index.md) use case.


API Reference: `PUT /service-providers`

<br />

## Test Cases {#test-cases}

### Test Case: Success-Update Service Provider {#test-case-success-update-service-provider}

##### Request {#request}

```json
{
  "customerName": "ABC Bank New",
  "supportedAccountRange": "534403, 518145, 518152, 5403, 5424",
  "cardHolderBase": "1221"
}
```

##### Response {#response}

```json
{
  "clientId": "fjl2fxzsYl1OpvxkBItC9nVw1PSQc_b-eQMcmQFg011ab4b5",
  "customerId": "customer1",
  "customerName": "ABC Bank New",
  "supportedAccountRange": "534403, 518145, 518152, 5403, 5424",
  "status": "ACTIVE",
  "cardHolderBase": "1221"
}
```

### Test Case: Fail-Invalid Request parameter {#test-case-fail-invalid-request-parameter}

##### Request {#request-1}

```json
{
  "customerName": "",
  "supportedAccountRange": "534403, 518145, 518152, 5403, 5424"
}
```

##### Response {#response-1}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "Service-Provider-Mgmt",
        "ReasonCode": "INVALID_REQUEST_PARAMETER",
        "Description": "One of the request parameters is invalid, try again with correct request.",
        "Recoverable": false,
        "Details": "customerName must match \"^(?!\\s*$)[\\w]{1,200}(?:\\s[\\w]+)*$\""
      },
      {
        "Source": "Service-Provider-Mgmt",
        "ReasonCode": "INVALID_REQUEST_PARAMETER",
        "Description": "One of the request parameters is invalid, try again with correct request.",
        "Recoverable": false,
        "Details": "customerName size must be between 1 and 200"
      }
    ]
  }
}
```

### Test Case: Fail-Service Provider Not Found {#test-case-fail-service-provider-not-found}

##### Request {#request-2}

```json
{
  "customerName": "ABC Bank",
  "supportedAccountRange": "534403, 518145, 518152, 5403, 5424"
}
```

##### Response {#response-2}

```json
{
  "Errors": {
    "Error": [
      {
        "Source": "Service-Provider",
        "ReasonCode": "ACCOUNT_NOT_FOUND",
        "Description": "We cannot find the account which you are using to access this service. Kindly register your account or contact your Mastercard associate if you have already registered with us earlier.",
        "Recoverable": false,
        "Details": ""
      }
    ]
  }
}
```

