# Create URL to update payment method

`POST https://app.shuttleglobal.com/c/api/instances/{instance_key}/contracts/{contract_id}/payment_method_url`

Generate an encoded URL to direct a browser to, allowing a user to modify their method of
payment on a recurring contract.

## Authentication

- basicAuth: Basic Authentication using secret key
- bearerAuth: OAuth 2.0 Bearer Token Authentication

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `contract_id` | path | string | yes | The contract's ID (`co_...`). |

## Request body (`application/json`), required

- `locale` (string): 2 letter language code or full locale (eg 'en' or 'en_US'). Uses browser locale if not specified

## Responses

### 200: Generated URL

```json
{
  "url": "string"
}
```

### 400: Bad request

```json
{
  "code": "string",
  "message": "string"
}
```

### 401: Unauthorised: the API key is missing or not valid

```json
{
  "code": "UNAUTHORIZED",
  "message": "Unauthorised"
}
```

## Example request

```sh
curl --request POST \
  --url https://app.shuttleglobal.com/c/api/instances/YOUR_INSTANCE_KEY/contracts/CONTRACT_ID/payment_method_url \
  --header 'Authorization: Basic <base64 of SECRET_KEY:>' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

Reference page: https://docs.shuttleglobal.com/platforms/reference/operations/createpaymentmethodurl/