# 請求書カード払い登録

`POST /v1/business_payments`

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

請求書カード払い情報を登録します。


## コードサンプル

### cURL

```bash
curl \
    -X POST \
    -H "Authorization:Bearer <Secret API Key>" \
    -H "Content-Type: application/json" \
    -H "Tenant-Buyer-Id: b_***********" \
    -d '{
    "receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"
}' \
'https://api.test.fincode.jp/v1/business_payments'
```

### Node.js

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

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

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

### Go

```go
package main

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

func main() {
    body := []byte(`{"receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"}`)

    req, err := http.NewRequest(http.MethodPost, "https://api.test.fincode.jp/v1/business_payments", 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([
    'receipt_id' => 'rc_-RcdyjisQl-Uk5D7Q12f0A',
]);

$ch = curl_init('https://api.test.fincode.jp/v1/business_payments');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
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'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
    'Tenant-Buyer-Id': 'b_***********'
}
data = {
    "receipt_id": "rc_-RcdyjisQl-Uk5D7Q12f0A"
}

response = requests.post(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 = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <Secret API Key>"
request["Content-Type"] = "application/json"
request["Tenant-Buyer-Id"] = "b_***********"
request.body = {
  receipt_id: "rc_-RcdyjisQl-Uk5D7Q12f0A"
}.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`

| パラメータ | 型 | 必須 | 説明 |
| --- | --- | --- | --- |
| `receipt_id` | string |  | 支払ID。 |

## レスポンス

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

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

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

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

