# 請求書カード払い依頼

`PUT /v1/business_payments/request`

- operationId: `requestBusinessPayment`
- tags: 請求書カード払い

請求書カード払い依頼を行います。


## コードサンプル

### cURL

```bash
curl \
    -X PUT \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    -H "Tenant-Buyer-Id: b_***********" \
    -d '{
    "access_id": "bp_abcdefghijklmnopqrstuv",
}' \
'https://api.test.fincode.jp/v1/business_payments/request'
```

### Node.js

```javascript
const API_KEY = "<Secret API Key>";

(async () => {
  const response = await fetch(
    "https://api.test.fincode.jp/v1/business_payments/request",
    {
      method: "PUT",
      headers: {
        Authorization: `Bearer ${API_KEY}`,
        "Content-Type": "application/json",
        "Tenant-Buyer-Id": "b_***********",
      },
      body: JSON.stringify({
        access_id: "bp_abcdefghijklmnopqrstuv",
      }),
    },
  );

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

### Go

```go
package main

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

func main() {
    body := []byte(`{"access_id":"bp_abcdefghijklmnopqrstuv"}`)

    req, err := http.NewRequest(http.MethodPut, "https://api.test.fincode.jp/v1/business_payments/request", bytes.NewBuffer(body))
    if err != nil {
        panic(err)
    }

    req.Header.Set("Authorization", "Bearer <Secret API Key>")
    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Tenant-Buyer-Id", "b_***********")

    resp, err := http.DefaultClient.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    b, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(b))
}
```

### PHP

```php
<?php

$payload = json_encode([
    'access_id' => 'bp_abcdefghijklmnopqrstuv',
]);

$ch = curl_init('https://api.test.fincode.jp/v1/business_payments/request');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer <Secret API Key>',
    'Content-Type: application/json',
    'Tenant-Buyer-Id: b_***********'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
```

### Python 3

```python
import requests

api_key = '<Secret API Key>'

url = 'https://api.test.fincode.jp/v1/business_payments/request'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Tenant-Buyer-Id': 'b_***********'
    'Content-Type': 'application/json'
}
data = {
    'access_id': 'bp_abcdefghijklmnopqrstuv'
}

response = requests.put(url, headers=headers, json=data)
print(response.text)
```

### Ruby

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

uri = URI.parse("https://api.test.fincode.jp/v1/business_payments/request")
request = Net::HTTP::Put.new(uri)
request["Authorization"] = "Bearer <Secret API Key>"
request["Tenant-Buyer-Id"] = "b_***********"
request["Content-Type"] = "application/json"
request.body = {
  access_id: "bp_abcdefghijklmnopqrstuv"
}.to_json

response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
  http.request(request)
end

puts response.body
```

## パラメータ

| 名前 | 位置 | 必須 | 型 | 説明 |
| --- | --- | --- | --- | --- |
| `Tenant-Buyer-Id` | header | ✓ | schema | <span class="smallText color--red-400">※ バイヤープラットフォームのみ指定可</span> |

## リクエストボディ

Content-Type: `application/json`

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `access_id` | string | ✓ | 取引ID |

## レスポンス

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

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `redirect_url` | string |  | 認証開始URL |

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

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

