# ショップ決済手段 削除

`DELETE /v1/shops/payment_methods/{id}`

- operationId: `deleteShopPaymentMethod`
- tags: ショップ決済手段

IDで指定したショップ決済手段を削除します。


## コードサンプル

### cURL

```bash
curl \
    -X DELETE \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    'https://api.test.fincode.jp/v1/shops/payment_methods/pm_xxxxxxxxxxxxxxxxxxxxxx?pay_type=Payeeaccount'
```

### Node.js

```javascript
import fetch from "node-fetch";

const BASE_URL = "https://api.test.fincode.jp";
const API_KEY = "<Secret API Key>";

(async () => {
    const id = "<Shop Payment Method ID>";
    const endpoint = `${BASE_URL}/v1/shops/payment_methods/${id}?pay_type=Payeeaccount`;

    const response = await fetch(endpoint, {
        method: "DELETE",
        headers: {
            Authorization: `Bearer ${API_KEY}`,
            "Content-Type": "application/json",
        },
    });

    if (!response.ok) {
        console.error(`Error: ${response.statusText}`);
        return;
    }

    const data = await response.json();
    console.log(data);
})();
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"log"
	"net/http"
)

func main() {
	apiKey := "<Secret API Key>"
	id := "<Shop Payment Method ID>"
	url := fmt.Sprintf("https://api.test.fincode.jp/v1/shops/payment_methods/%s?pay_type=Payeeaccount", id)

	req, err := http.NewRequest("DELETE", url, nil)
	if err != nil {
		log.Fatalf("リクエスト作成エラー: %v", err)
	}
	req.Header.Set("Authorization", "Bearer "+apiKey)
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Fatalf("リクエスト送信エラー: %v", err)
	}
	defer resp.Body.Close()

	respBody, _ := io.ReadAll(resp.Body)
	fmt.Println(string(respBody))
}
```

### PHP

```php
<?php

$apiKey = '<Secret API Key>';
$id = "<Shop Payment Method ID>";
$baseUrl = "https://api.test.fincode.jp";
$endpoint = "/v1/shops/payment_methods/{$id}?pay_type=Payeeaccount";
$headers = [
    "Authorization: Bearer " . $apiKey,
    "Content-Type: application/json"
];

$session = curl_init();
curl_setopt($session, CURLOPT_URL, $baseUrl . $endpoint);
curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($session, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($session);
if ($response === false) {
    echo "cURL Error: " . curl_error($session);
} else {
    var_dump($response);
}
curl_close($session);
```

### Python 3

```python
import requests

api_key = '<Secret API Key>'
id = '<Shop Payment Method ID>'
url = f'https://api.test.fincode.jp/v1/shops/payment_methods/{id}?pay_type=Payeeaccount'

headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

try:
    response = requests.delete(url, headers=headers)
    if response.status_code == 200:
        print(f"Success: {response.json()}")
    else:
        print(f"Error: {response.json()}")
except requests.RequestException as e:
    print(f"通信エラー: {e}")
```

### Ruby

```ruby
require 'net/http'
require 'uri'
require 'json'

API_KEY = '<Secret API Key>'
BASE_URL = 'https://api.test.fincode.jp'

def main
  id = '<Shop Payment Method ID>'
  endpoint = "/v1/shops/payment_methods/#{id}?pay_type=Payeeaccount"
  uri = URI.parse(BASE_URL + endpoint)

  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Delete.new(uri.request_uri)
  request['Authorization'] = "Bearer #{API_KEY}"
  request['Content-Type'] = 'application/json'

  response = http.request(request)
  puts response.body
end

main
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `id` | path | ✓ | ShopPaymentMethodId_schema | ショップ決済手段ID |
| `Tenant-Shop-Id` | header |  | schema | <span class="smallText color--red-400">※ プラットフォームのメインショップのみ指定可</span> |
| `pay_type` | query | ✓ | string |  |

## レスポンス

### 200 リクエストに成功

##### 銀行振込（指定口座）

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `id` | string |  | ショップ決済手段ID |
| `pay_type` | enum(Payeeaccount) |  | 決済種別 |
| `process_date` | string(date-time) |  | 処理日時 形式：`yyyy/MM/dd HH:mm:ss.SSS` |
| `status` | enum(ACTIVATED) |  | ステータス |
| `display_flag` | enum(0 | 1) |  | 表示フラグ |
| `display_number` | enum(1 | 2 | 3) |  | 表示順序 |
| `payee_account` | object |  | 銀行口座情報 |
| `client_field_1` | string |  | 加盟店向け自由項目 1 |
| `client_field_2` | string |  | 加盟店向け自由項目 2 |
| `client_field_3` | string |  | 加盟店向け自由項目 3 |
| `delete_flag` | enum(0 | 1) |  | 削除フラグ |
| `created` | string(date-time) |  | 作成日時 形式：`yyyy/MM/dd HH:mm:ss.SSS` |
| `updated` | string(date-time) |  | 更新日時 形式：`yyyy/MM/dd HH:mm:ss.SSS` |

### 400 不正なリクエスト

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `errors` | array<FincodeAPIError> |  |  |

