# Update Default Payment

## Endpoint Details <a href="#search-catalog" id="search-catalog"></a>

<mark style="color:green;">`GET`</mark> `/users/payments/updateDefault/{userId}/{paymentId}`

### Headers

<table><thead><tr><th width="393">Header</th><th>Value</th></tr></thead><tbody><tr><td>Content-Type</td><td><code>application/json</code></td></tr><tr><td>Authorization</td><td><code>Bearer &#x3C;YOUR_ACCESS_TOKEN></code></td></tr></tbody></table>

### Path Parameters

<table><thead><tr><th>Name</th><th width="175" align="center">Type</th><th width="247">Description</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td><code>userId</code></td><td align="center">string</td><td>Existing user identifier, returned upon session creation or update</td><td>true</td></tr><tr><td><code>paymentId</code></td><td align="center">string</td><td>Default payment identifier of the user</td><td>true</td></tr></tbody></table>

### Response Details

<table><thead><tr><th width="226">Field</th><th width="168">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>statusCode</code></td><td>number</td><td>HTTP status code of the response</td></tr><tr><td><code>message</code></td><td>string</td><td>A brief message describing the result of the API call</td></tr><tr><td><code>metadata</code></td><td><a href="#metadata-object">metaDataObject</a></td><td>Contains metadata about the API call</td></tr><tr><td><code>auth</code></td><td><a href="../../../authentication-api-integration/get-access-token#auth-object">authObject</a></td><td>Authentication object, only when refresh in <code>true</code></td></tr><tr><td><code>data</code></td><td>boolean</td><td>Updating the payment to isDefault</td></tr></tbody></table>

#### Metadata Object

<table><thead><tr><th width="144">Field</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>languages</code></td><td>Array&#x3C;string></td><td>List of supported languages for the response, e.g. ["en"]</td></tr><tr><td><code>timestamp</code></td><td>string</td><td>Unix timestamp (in milliseconds) when the response was generated</td></tr><tr><td><code>timezone</code></td><td>string</td><td>Timezone used for the response, always "UTC"</td></tr><tr><td><code>requestId</code></td><td>string</td><td>Unique identifier for the API request. Used for debugging and support</td></tr><tr><td><code>path</code></td><td>string</td><td>API path</td></tr><tr><td><code>version</code></td><td>string</td><td>API version used for the request</td></tr></tbody></table>

### Sample Request and Response

```bash
curl --location 'https://staging.api.liquidcommerce.cloud/users/payments/updateDefault' \
--header 'Authorization: Bearer <YOUR_ACCESS_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
    "customerId": "usrid_123abc456def",
    "paymentMethodId": "paymentid_123abc456def",
    "isDefault": false
}'
```

```json
{
    "statusCode": 200,
    "message": "Updating default payment method succeeded",
    "metadata": {
        "languages": [
            "en"
        ],
        "timestamp": 1731600946784,
        "timezone": "UTC",
        "requestId": "reqid_123abc45def",
        "path": "/api/users/payments/updateDefault/usr_123abc456def/paymentid_123abc456def",
        "version": "1.7.0"
    },
    "data": true
}
```
