> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.orderupb2b.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.orderupb2b.com/_mcp/server.

# 查詢付款方式清單

GET https://api.example.com/v1/payment-methods

列出貴租戶可以指派給客戶的付款方式，用於取得 POST／PUT /v1/companies 的 `paymentMethods` 能填的 key。不分頁——一個租戶的付款方式少且固定，建議只查一次並在你端快取。

內建的付款方式有三種：`BankTransfer`（匯款）、`ECPayAtm`（綠界 ATM 虛擬帳號）、`ECPayCreditOneTime`（綠界信用卡一次付清）；租戶自訂的線下付款方式 key 以 `Custom_` 開頭，例如 `Custom_k3x9m2qa`。「月結」不在清單裡，它是客戶的結帳條件，由 `settlementType` 決定。

清單只包含租戶已設定過的付款方式，依租戶在後台設定的順序排列。`isEnabled` 為 false 的付款方式仍會列出、也仍可指派給客戶，但客戶的 `Specify` 清單實際生效的是「清單」與「租戶目前已啟用」兩者的交集，所以這種付款方式要等租戶啟用後，採購方才看得到。內建付款方式即使不在清單裡（租戶從未設定過），寫入客戶時仍然合法，只是同樣要等租戶設定並啟用後才會生效。

Reference: https://docs.orderupb2b.com/api-規格/payment-methods/list-payment-methods

## Authentication

- `X-Signature` header (required) — 每個 /v1 請求都必須帶 `X-Client-Id`、`X-Timestamp`、`X-Nonce` 與 `X-Signature` 四個標頭。`X-Signature` 是以 client secret 對 canonical string 做 HMAC-SHA256 後的 Base64。 canonical string 的組成、可複製的簽章範例與 401 排查步驟，請參閱[「驗證與簽章」](/authentication)。

## Response

### 200

OK

- `data` (list of PaymentMethodResponse, optional, nullable) — 這個租戶可以指派給客戶的完整付款方式清單，每一筆為一筆付款方式資料。

## Errors

### 401 Unauthorized Error

Unauthorized

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 403 Forbidden Error

Forbidden

- `error` (string, optional, nullable) — 錯誤代碼，固定為 snake_case 字串，依代碼判斷失敗原因。

### 500 Internal Server Error

Internal Server Error

- `code` (string, optional, nullable) — 錯誤代碼字串。
- `message` (string, optional, nullable) — 對應的錯誤說明文字。

## Types

### PaymentMethodResponse

一個可以指派給客戶的付款方式，是 GET /v1/payment-methods 清單裡的一筆。

- `key` (string, optional, nullable) — 付款方式的識別值，寫入客戶 `paymentMethods` 時就填這個值。內建方式為 `BankTransfer`、`ECPayAtm`、`ECPayCreditOneTime`；租戶自訂的線下付款方式為 `Custom_` 加 8 個小寫英數字元。
- `name` (string, optional, nullable) — 結帳頁顯示的付款方式名稱。租戶沒有另外命名的內建方式，會用預設名稱：`BankTransfer` 為「匯款」、`ECPayAtm` 為「綠界 ATM 虛擬帳號」、`ECPayCreditOneTime` 為「綠界信用卡一次付清」。
- `isCustom` (boolean, optional) — 是否為租戶自訂的線下付款方式（key 以 `Custom_` 開頭）。內建方式為 false。
- `isEnabled` (boolean, optional) — 租戶目前是否對採購方開放這個付款方式。false 的付款方式仍可指派給客戶。客戶的付款方式模式為 `Specify` 時，採購方只會看到「指派給該客戶」且「租戶已啟用」的付款方式，所以在租戶啟用之前，指派不會生效；模式為 `Inherit` 時，採購方看到的是租戶所有已啟用的付款方式。

## Examples

**Response**

```json
{
  "data": [
    {
      "key": "string",
      "name": "string",
      "isCustom": true,
      "isEnabled": true
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.example.com/v1/payment-methods"

headers = {"X-Signature": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.example.com/v1/payment-methods';
const options = {method: 'GET', headers: {'X-Signature': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "https://api.example.com/v1/payment-methods"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-Signature", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

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

url = URI("https://api.example.com/v1/payment-methods")

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

request = Net::HTTP::Get.new(url)
request["X-Signature"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.example.com/v1/payment-methods")
  .header("X-Signature", "<apiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.example.com/v1/payment-methods', [
  'headers' => [
    'X-Signature' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.example.com/v1/payment-methods");
var request = new RestRequest(Method.GET);
request.AddHeader("X-Signature", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["X-Signature": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/payment-methods")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```