Api v2icon Fordevelopers
NAV Navbar
curl PHP Ruby Python Go Node.JS

Money Forward Kessai API v2

ここに選択した言語タブ向けのコードサンプルや、リクエスト・レスポンス例が表示されます。

本APIはMoney Forward Kessai APIのversion 2となります。
SEIKYU+ powered by Biz Forwardの売り手様も同様にご利用いただけます。

はじめに

本APIはMoney Forward Kessaiのサービスをご利用いただくためのAPIです。 より迅速な請求業務連携を実現することができます。

用語の定義

本ドキュメントで利用する用語について解説します。

項目 説明
Endpoint 単一の機能を提供するURL。例:POST: /customers
Object Money Forward Kessai内に存在する各情報。例: customer
Property Objectの各要素。
Parameter APIへのリクエスト時に指定するクエリ引数。
Payload Object登録時に利用するリクエストデータ。

基本事項

本APIはでは各情報はObject(もの)として扱い、それに対するシンプルな操作を提供します。 シンプルな操作の組み合わせで柔軟に利用ができるように設計されています。 このような考え方はRESTful指向と呼ばれています。 現在扱っているObjectは以下の通りです。

これらは、それぞれ固有のIDを持つObject(もの)として考えてください。 各EndpointはそれぞれのObjectに対応した操作をするためにあります。

例えば請求先について登録・取得などの操作をしたい場合は 請求先に対するEndpointを利用します。

次に各Endpointにはそれぞれ操作の種類があります。操作の種別によって利用するHTTPメソッド(GET, POSTなど)が異なります。

各項目について目的を説明します。

■ 一覧取得 GET

Objectの一覧を取得するためのEndpointです。取得する際に取得条件を指定することができます。 例えば作成日時で絞る、顧客をアラートの有無で絞るということができます。 特定の条件下にあるObjectを取得するときに利用できます。 各Endpointで利用できる条件はリファレンスをご確認ください。

■ 登録 POST

Objectを登録するためのEndpointです。

■ 一部更新 PATCH

Objectを一部更新するためのEndpointです。

■ 更新 PUT

Objectを更新するためのEndpointです。

■ 取得 GET

IDを指定して特定のObjectを1件のみ取得するためのEndpointです。 IDがわかっている特定の1件だけを取得するために利用します。 取得できる情報は一覧取得のものと同様です。

■ 削除 DELETE

IDを指定してObjectを削除またはキャンセルするためのEndpointです。 現在は取引キャンセルのみに対応しています。

Endpointは対象のObjectへのCRUD ( Create / Retrieve / Update / Delete ) 操作を提供します。但し各Objectに対して CRUD操作のすべてが提供されるわけではありません。特にUD ( Update / Delete ) 操作に関してはほとんどのObjectに対して提供されていません。

HTTPメソッドは各々が以下のようにCRUD操作と対応しています。

メソッド 操作
POST Create
GET Retrieve
PATCH, PUT Update
DELETE Delete

利用を開始する

Money Forward Kessaiを利用して顧客の与信枠を取得してみましょう。 以下の行程ではSandbox環境利用を前提としています。

与信枠取得までの流れ

以下の手順で本APIを利用し、与信枠を取得していきます。

Step1. apikeyを取得する

Step2. 顧客登録をする

Step3. 与信枠審査申請をする

Step4. 与信枠を取得する

Step5. 取引登録をする

Step6. 請求確認をする

Step1. apikeyを取得する

APIをご利用頂く場合、事前にその旨をご依頼いただき、Money Forward Kessai側で利用登録する必要があります。 お済みでない場合は、担当へお問い合わせください。

利用登録が完了すると、管理画面上のAPIキーページからapikeyを取得できるようになります。

  1. APIキーページへ行き「新規発行」ボタンでapikeyを発行してください。 本番環境であるhttps://s.mfk.jp/developers/apikeyから取得できるapikeyはSandbox環境のものと異なります。
  2. 発行されたapikeyをコピーしておいてください。

APIキー発行

Step2. 顧客登録をする

Step2. 顧客登録をする

curl -X POST "https://sandbox-api.mfkessai.co.jp/v2/customers" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -H "apikey: [apikey]" \
  -d '{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array(
    "destination" => array(
        "address1" => "東京都千代田区1-2-3",
        "address2" => "サンプルビル3F",
        "cc_emails" => array(
            "[email protected]",
            "[email protected]"
        ),
        "department" => "経理部",
        "email" => "[email protected]",
        "name" => "担当 太郎",
        "name_kana" => "タントウ タロウ",
        "tel" => "03-1234-5678",
        "title" => "部長",
        "zip_code" => "111-1111"
    ),
    "name" => "サンプル顧客",
    "number" => "CUSTOMER0001"
);

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
}

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers")

headers = {
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
  p res.body
end
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'apikey': '[apikey]'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers', json={
    "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
            "[email protected]",
            "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
    },
    "name": "サンプル顧客",
    "number": "CUSTOMER0001"
}, headers=headers)

print(r.json())
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type CustomerPayloadDestination struct {
    Address1   string   `json:"address1"`
    Address2   string   `json:"address2"`
    CcEmails   []string `json:"cc_emails"`
    Department string   `json:"department"`
    Email      string   `json:"email"`
    Name       string   `json:"name"`
    NameKana   string   `json:"name_kana"`
    Tel        string   `json:"tel"`
    Title      string   `json:"title"`
    ZipCode    string   `json:"zip_code"`
}

type CustomerPayload struct {
    Destination CustomerPayloadDestination `json:"destination"`
    Name        string                     `json:"name"`
    Number      string                     `json:"number"`
}

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept":       []string{"application/json"},
        "apikey":       []string{"[apikey]"},
    }

    payload, err := json.Marshal(CustomerPayload{
        Destination: CustomerPayloadDestination{
            Address1:   "東京都千代田区1-2-3",
            Address2:   "サンプルビル3F",
            CcEmails:   []string{
                "[email protected]",
                "[email protected]",
            },
            Department: "経理部",
            Email:      "[email protected]",
            Name:       "担当 太郎",
            NameKana:   "タントウ タロウ",
            Tel:        "03-1234-5678",
            Title:      "部長",
            ZipCode:    "111-1111",
        },
        Name:        "サンプル顧客",
        Number:      "CUSTOMER0001",
    })
    if err != nil {
        // handle error
        return
    }

    data := bytes.NewBuffer(payload)
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(resp)

    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(string(body))
}
const fetch = require('node-fetch');
const inputBody = `{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'[apikey]'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customers',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
    "customer": {
        "created_at": "2019-04-01T10:36:43+09:00",
        "has_alert": false,
        "id": [customer_id],
        "name": "サンプル顧客",
        "number": "CUSTOMER001",
        "object": "customer",
        "payment_method": {
            "bank_transfer": {
                "object": "bank_transfer"
            },
            "object": "payment_method"
        },
        "uri": "mfk:customer:[customer_id]"
    },
    "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
            "[email protected]",
            "[email protected]"
        ],
        "created_at": "2019-04-01T10:36:43+09:00",
        "customer_id": "[customer_id]",
        "department": "経理部",
        "email": "[email protected]",
        "id": "69M9-3P96",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "object": "destination",
        "tel": "03-1234-5678",
        "title": "部長",
        "uri": "mfk:destination:[destination_id]",
        "zip_code": "111-1111"
    }
}

顧客登録Endpointを利用して、顧客を登録します。 この際、同時に請求先(Destination)も一件登録されます。

この時レスポンスに含まれるcustomer.idを顧客ID(customer_id), destination.idを請求先ID(destination_id)として利用していきます。

Step3. 与信枠審査申請をする

Step3. 与信枠審査申請をする

curl -X POST "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -H "apikey: [apikey]" \
  -d '{
       "address1": "東京都千代田区1-2-3",
       "address2": "サンプルビル3F",
       "amount": 20000,
       "business_description": "クラウド型企業間決済サービス",
       "business_type": "corporate",
       "corporate_number": "1234567890123",
       "customer_id": "[customer_id]",
       "email": "[email protected]",
       "end_date": "2019-04-30",
       "remark": "__passed__",
       "representative_name": "代表太郎",
       "tel": "03-1234-5678",
       "website": "https://mfkessai.co.jp",
       "zip_code": "111-1111"
     }'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array(
    "address1" => "東京都千代田区1-2-3",
    "address2" => "サンプルビル3F",
    "amount" => 20000,
    "business_description" => "クラウド型企業間決済サービス",
    "business_type" => "corporate",
    "corporate_number" => "1234567890123",
    "customer_id" => "[customer_id]",
    "email" => "[email protected]",
    "end_date" => "2019-04-30",
    "remark" => "__passed__",
    "representative_name" => "代表太郎",
    "tel" => "03-1234-5678",
    "website" => "https://mfkessai.co.jp",
    "zip_code" => "111-1111"
);

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations")

headers = {
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "customer_id": "[customer_id]",
    "email": "[email protected]",
    "end_date": "2019-04-30",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "tel": "03-1234-5678",
    "website": "https://mfkessai.co.jp",
    "zip_code": "111-1111"
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
  p res.body
end
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'apikey': '[apikey]'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', json={
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "customer_id": "[customer_id]",
    "email": "[email protected]",
    "end_date": "2019-04-30",
    "remark": "__passed__",
    "representative_name": "代表太郎",
    "tel": "03-1234-5678",
    "website": "https://mfkessai.co.jp",
    "zip_code": "111-1111"
}, headers=headers)

print(r.json())

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type CustomerExaminationPayload struct {
    Address1            string `json:"address1"`
    Address2            string `json:"address2"`
    Amount              int    `json:"amount"`
    BusinessDescription string `json:"business_description"`
    BusinessType        string `json:"business_type"`
    CorporateNumber     string `json:"corporate_number"`
    CustomerID          string `json:"customer_id"`
    Email               string `json:"email"`
    EndDate             string `json:"end_date"`
    Remark              string `json:"remark"`
    RepresentativeName  string `json:"representative_name"`
    Tel                 string `json:"tel"`
    Website             string `json:"website"`
    ZipCode             string `json:"zip_code"`
}

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept":       []string{"application/json"},
        "apikey":       []string{"[apikey]"},
    }

    payload, err := json.Marshal(CustomerExaminationPayload{
        Address1:            "東京都千代田区1-2-3",
        Address2:            "サンプルビル3F",
        Amount:              100001,
        BusinessDescription: "クラウド型企業間決済サービス",
        BusinessType:        "corporate",
        CorporateNumber:     "1234567890123",
        CustomerID:          "NG47-R436",
        Email:               "[email protected]",
        EndDate:             "2019-09-30",
        Remark:              "__passed__",
        RepresentativeName:  "代表太郎",
        Tel:                 "03-1234-5678",
        Website:             "https://mfkessai.co.jp",
        ZipCode:             "111-1111",
    })
    if err != nil {
        // handle error
        return
    }

    data := bytes.NewBuffer(payload)
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(resp)

    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(string(body))
}

const fetch = require('node-fetch');
const inputBody = `{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "[customer_id]",
  "email": "[email protected]",
  "end_date": "2019-04-30",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'[apikey]'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "created_at": "2019-04-25T12:50:52+09:00",
  "customer_id": "[customer_id]",
  "email": "[email protected]",
  "end_date": "2019-04-30",
  "id": "6V9W-EMYN",
  "object": "customer_examination",
  "remark": "__passed__",
  "representative_name": "代表太郎",
  "status": "unexamined",
  "tel": "03-1234-5678",
  "uri": "mfk:customer_examination:6V9W-EMYN",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}

Step2で作成した顧客に対する与信枠審査申請をします。 end_dateは現在時点で指定可能な日付に入れ替えてください。

remark__passed__を入れているのは、審査結果を指定するためです。 これはsandboxのみで提供されている機能です。審査結果の操作

Step4. 与信枠を確認する

Step4. 与信枠を確認する

curl -X GET "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]" \
  -H "accept: application/json" \
  -H "apikey: [apikey]"
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => '[apikey]',

    );

$client = new \GuzzleHttp\Client();

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]', array(
        'headers' => $headers,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]")

headers = {
    'Accept' => 'application/json',
    'apikey' => '[apikey]'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
  p res.body
end
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'apikey': '[apikey]'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]', headers=headers)

print(r.json())
package main

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

func main() {

    headers := map[string][]string{
        "Accept":       []string{"application/json"},
        "apikey":       []string{"[apikey]"},
    }

    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]", nil)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(resp)

    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(string(body))
}

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'[apikey]'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=[customer_id]',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "6V9W-EMYN",
      "customer_id": [customer_id],
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-04-25",
      "uri": "mfk:credit_facility:7679-YW36"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "7679-YW36",
    "total": 1
  }
}

与信枠一覧取得を利用します。 与信枠審査が通過した場合、与信枠が付与されます。 Step3ではマジックナンバーを利用して即時審査通過するように指定したため、与信枠審査申請後すぐに与信枠が付与されたことが確認できます。

Step5. 取引登録をする

Step5. 取引登録をする

curl -X POST "https://sandbox-api.mfkessai.co.jp/v2/transactions" \
  -H "accept: application/json" \
  -H "Content-Type: application/json" \
  -H "apikey: [apikey]" \
  -d '{
        "amount": 5440,
        "amounts_per_tax_rate_type": [
          {
            "amount": 2200,
            "tax_rate_type": "normal_10"
          },
          {
            "amount": 3240,
            "tax_rate_type": "reduced_8"
          }
        ],
        "date": "2019-04-10",
        "destination_id": [destination_id],
        "due_date": "2019-04-30",
        "invoice_delivery_methods": [
          "posting",
          "email"
        ],
        "issue_date": "2019-04-20",
        "number": "Transaction-0001",
        "transaction_details": [
          {
            "amount": 3000,
            "description": "商品名A",
            "tax_included_type": "excluded",
            "tax_rate_type": "normal_10",
            "quantity": 3,
            "unit_price": 1000
          },
          {
            "amount": 3000,
            "description": "商品名B",
            "tax_included_type": "excluded",
            "tax_rate_type": "reduced_8",
            "quantity": 3,
            "unit_price": 1000
          },
          {
            "amount": -1000,
            "description": "商品名A 返品",
            "tax_included_type": "excluded",
            "tax_rate_type": "normal_10",
            "quantity": 1,
            "unit_price": -1000
          }
        ]
      }'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array(
    "amount" => 5440,
    "amounts_per_tax_rate_type" => array(
        array(
            "amount" => 2200,
            "tax_rate_type" => "normal_10"
        ),
        array(
             "amount" => 3240,
             "tax_rate_type" => "reduced_8"
        )
    ),
    "date" => "2019-04-10",
    "destination_id" => "[destination_id]",
    "due_date" => "2019-04-30",
    "invoice_delivery_methods" => array(
        "posting",
        "email"
    ),
    "issue_date" => "2019-04-20",
    "number" => "Transaction-0001",
    "transaction_details" => array(
        array(
            "amount" => 3000,
            "description" => "商品名A",
            "tax_included_type" => "excluded",
            "tax_rate_type" => "normal_10",
            "quantity" => 3,
            "unit_price" => 1000
        ),
        array(
            "amount" => 3000,
            "description" => "商品名B",
            "tax_included_type" => "excluded",
            "tax_rate_type" => "reduced_8",
            "quantity" => 3,
            "unit_price" => 1000
        ),
        array(
            "amount" => -1000,
            "description" => "商品名A 返品",
            "tax_included_type" => "excluded",
            "tax_rate_type" => "normal_10",
            "quantity" => 1,
            "unit_price" => -1000
        )
    )
);

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")

headers = {
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => '[apikey]'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
    "amount": 5440,
    "amounts_per_tax_rate_type": [
      {
        "amount": 2200,
        "tax_rate_type": "normal_10"
      },
      {
        "amount": 3240,
        "tax_rate_type": "reduced_8"
      }
    ],
    "date": "2019-04-10",
    "destination_id": "[destination_id]",
    "due_date": "2019-04-30",
    "invoice_delivery_methods": [
      "posting",
      "email"
    ],
    "issue_date": "2019-04-20",
    "number": "Transaction-0001",
    "transaction_details": [
      {
        "amount": 3000,
        "description": "商品名A",
        "tax_included_type": "excluded",
        "tax_rate_type": "normal_10",
        "quantity": 3,
        "unit_price": 1000
      },
      {
        "amount": 3000,
        "description": "商品名B",
        "tax_included_type": "excluded",
        "tax_rate_type": "reduced_8",
        "quantity": 3,
        "unit_price": 1000
      },
      {
        "amount": -1000,
        "description": "商品名A 返品",
        "tax_included_type": "excluded",
        "tax_rate_type": "normal_10",
        "quantity": 1,
        "unit_price": -1000
      }
    ]
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
  p res.body
end
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'apikey': '[apikey]'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/transactions', json={
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "[destination_id]",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}, headers=headers)

print(r.json())

package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "io/ioutil"
    "net/http"
)

type TransactionPayload struct {
    Amount                 int                    `json:"amount"`
    AmountsPerTaxRateType  []AmountPerTaxRateType `json:"amounts_per_tax_rate_type"`
    Date                   string                 `json:"date"`
    DestinationID          string                 `json:"destination_id"`
    DueDate                string                 `json:"due_date"`
    InvoiceDeliveryMethods []string               `json:"invoice_delivery_methods"`
    IssueDate              string                 `json:"issue_date"`
    Number                 string                 `json:"number"`
    TransactionDetails     []TransactionDetail    `json:"transaction_details"`
}

type AmountPerTaxRateType struct {
    Amount      int    `json:"amount"`
    TaxRateType string `json:"tax_rate_type"`
}

type TransactionDetail struct {
    Amount          int    `json:"amount"`
    Description     string `json:"description"`
    TaxIncludedType string `json:"tax_included_type"`
    TaxRateType     string `json:"tax_rate_type"`
    Quantity        int    `json:"quantity"`
    UnitPrice       int    `json:"unit_price"`
}

func main() {

    headers := map[string][]string{
        "Content-Type": {"application/json"},
        "Accept":       {"application/json"},
        "apikey":       {"[apikey]"},
    }

    payload, err := json.Marshal(TransactionPayload{
        Amount: 5440,
        AmountsPerTaxRateType: []AmountPerTaxRateType{
            {
                Amount:      2200,
                TaxRateType: "normal_10",
            },
            {
                Amount:      3240,
                TaxRateType: "normal_8",
            },
        },
        Date:                   "2019-04-10",
        DestinationID:          "[destination_id]",
        DueDate:                "2019-04-30",
        InvoiceDeliveryMethods: []string{"posting", "email"},
        IssueDate:              "2019-04-20",
        Number:                 "Transaction-0001",
        TransactionDetails: []TransactionDetail{
            {
                Amount:          3000,
                Description:     "商品A",
                TaxIncludedType: "excluded",
                TaxRateType:     "normal_10",
                Quantity:        3,
                UnitPrice:       1000,
            },
            {
                Amount:          3000,
                Description:     "商品B",
                TaxIncludedType: "excluded",
                TaxRateType:     "normal_8",
                Quantity:        3,
                UnitPrice:       1000,
            },
            {
                Amount:          -1000,
                Description:     "商品A 返品",
                TaxIncludedType: "excluded",
                TaxRateType:     "normal_10",
                Quantity:        1,
                UnitPrice:       -1000,
            },
        },
    })
    if err != nil {
        // handle error
        return
    }

    data := bytes.NewBuffer(payload)
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(resp)

    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(string(body))
}

const fetch = require('node-fetch');

const inputBody = `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "[destination_id]",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'[apikey]'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "[billing_id]",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "[destination_id]''",
  "due_date": "2019-04-30",
  "id": "[transaction_id]",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:[transaction_id]"
}

Step1で作成した顧客・請求先に対して取引登録をします。 date, due_date, issue_dateは現在時点で指定可能な日付に入れ替えてください。

Step6. 請求確認をする

Step6. 請求確認をする

curl -X GET "https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]" \
  -H "accept: application/json" \
  -H "apikey: [apikey]"
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => '[apikey]',

    );

$client = new \GuzzleHttp\Client();

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]', array(
        'headers' => $headers,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]")

headers = {
    'Accept' => 'application/json',
    'apikey' => '[apikey]'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
  p res.body
end
import requests

headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'apikey': '[apikey]'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]', headers=headers)

print(r.json())
package main

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

func main() {

    headers := map[string][]string{
        "Accept":       []string{"application/json"},
        "apikey":       []string{"[apikey]"},
    }

    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]", nil)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(resp)

    defer resp.Body.Close()
    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        // handle error
        return
    }

    fmt.Println(string(body))
}

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'[apikey]'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/[billing_id]',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "customer_id": "[customer_id]",
  "destination_id": "[destination_id]",
  "due_date": "2019-04-30",
  "id": "[billing_id]",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "object": "billing",
  "status": "scheduled",
  "uri": "mfk:billing:[billing_id]"
}

請求取得を利用します。 与信枠があるため、取引審査は即時通過し請求が作成されます。 Step5で登録した取引の billing_idを利用して請求を確認します。

Object関連

Money Forward Kessai API内の各Objectの関連は下図のようになっています。

Object関連図

レシピ

ユースケースに応じた利用例をレシピとして紹介します。

審査型に応じて利用するAPIが異なりますので、以下の審査型と参考レシピの対応表もご確認ください。

審査型 概要 参考レシピ
【1】
与信枠審査
(毎月自動で付与)
・取引前に事前に与信枠審査(毎月の枠)
毎月〇万の枠を自動で付与
・与信枠審査は即時~2営業日
・取引登録前に残枠を確認して登録
・付与された枠内であれば、取引審査は即時
自動与信枠審査を利用して与信枠を取得する
与信枠を利用して取引登録を行う
【2】
一時与信枠審査
(取引ごとに手動で事前申請)
・取引前に事前に与信枠審査(都度の枠)
・事前審査で期限付きの枠を付与
・与信枠審査は即時~2営業日
・取引登録前に残枠を確認して登録
・付与された枠内であれば、取引審査は即時
一時的な与信枠取得・増枠を行う
与信枠を利用して取引登録を行う
【3】
取引審査
(都度)
・事前の与信枠審査不要
取引単位で審査を実施
・取引審査は即時~2営業日
・取引登録(≒ご注文後)の審査不通過あり
取引登録時に取引単位で審査を行う

自動与信枠審査を利用して与信枠を取得する

自動与信枠審査機能をご利用の場合に与信枠を取得するまでの流れを説明します。

Step1. 顧客を登録する

Step1. 顧客を登録する

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customers \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers', params={

}, json={
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "customer_examination": {
    "amount": 20000,
    "business_description": "クラウド型企業間決済サービス",
    "business_type": "corporate",
    "corporate_number": "1234567890123",
    "remark": "一部上場企業です。",
    "representative_name": "代表太郎",
    "website": "https://mfkessai.co.jp"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customers',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "customer": {
    "created_at": "2019-04-01T10:36:43+09:00",
    "has_alert": false,
    "id": "AY9N-VPN3",
    "name": "サンプル顧客",
    "number": "CUSTOEMR001",
    "object": "customer",
    "payment_method": {
      "bank_transfer": {
        "object": "bank_transfer",
        "account_number": "123456789",
        "bank_name": "MEKESSAI銀行",
        "branch_name": "大手町支店",
        "holder_name": "エムエフケツサイ(カ",
        "type": "current"
      },
      "object": "payment_method"
    },
    "uri": "mfk:customer:7679-YW36"
  },
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "created_at": "2019-04-01T10:36:43+09:00",
    "customer_id": "AY9N-VPN3",
    "department": "経理部",
    "email": "[email protected]",
    "id": "WNAV-37R6",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "object": "destination",
    "tel": "03-1234-5678",
    "title": "部長",
    "uri": "mfk:destination:WNAV-37R6",
    "zip_code": "111-1111"
  }
}

顧客登録 POST: /customersを利用します。

自動与信枠審査なので顧客登録するだけで自動的に月ごとの与信枠審査が申請されます。
まず登録時に与信枠が付与される月数分の与信枠審査申請が自動で行われます。それ以降の与信枠審査申請は月次で行われます。

顧客登録時に、与信枠審査に利用する情報をcustomer_examinationとして入力することができます。ここではend_dateの指定は不要です。 情報が多いほど審査時間の短縮や精度の向上が見込まれるため、可能な限り入力することを推奨します。

与信額は基本的に売り手さまごとに一律となります。ここで、customer_examination.amountを指定することで登録する顧客の与信額を指定することができます。 指定がない場合は売り手さまごとに一律の与信額で審査いたします。

この金額は今後新しく更新されて付与される与信枠にも適用されます。
一時的な増枠をご希望の際は、一時的な与信枠取得・増枠を行うをご利用ください。

Step2. 与信枠審査のステータスを確認する

Step2. 与信枠審査のステータスを確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations?customer_id=AY9N-VPN3',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-04-18T10:20:34+09:00",
      "customer_id": "AY9N-VPN3",
      "email": "[email protected]",
      "end_date": "2019-05-31",
      "id": "9R6M-VMAN",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-05-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "uri": "mfk:customer_examination:9R6M-VMAN",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    },
    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-04-18T10:20:34+09:00",
      "customer_id": "AY9N-VPN3",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-04-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "uri": "mfk:customer_examination:7679-YW36",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "9R6M-VMAN",
    "total": 2
  }
}

与信枠審査一覧取得 GET: /credit_facilitiesを利用します。

登録した顧客の顧客IDを利用して、その顧客に対する与信枠審査を取得します。

審査が通過した場合、与信枠確認に進みます。
否決になった場合はMoney Forward Kessaiの否決時請求を利用するか、または別の支払方法・サービスの提供停止などを検討するが必要があります。

与信枠審査が否決になった場合も、取引審査を利用することは可能です。 しかしこの場合の取引審査通過率は低くなります。

Step3. 与信枠を確認する

Step3. 与信枠を確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
mport requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3', params={

}, headers=headers)

print(r.json())

package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=AY9N-VPN3',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "9R6M-VMAN",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-05-31",
      "id": "Y96E-WW6M",
      "start_date": "2019-05-01",
      "status": "inactive",
      "uri": "mfk:credit_facility:Y96E-WW6M"
    },
    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "7679-YW36",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "796R-G7NY",
      "start_date": "2019-04-01",
      "status": "inactive",
      "uri": "mfk:credit_facility:796R-G7NY"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "Y96E-WW6M",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "796R-G7NY",
    "total": 2
  }
}

与信枠一覧取得 GET: /credit_facilitiesを利用します。

申請した金額と実際に付与される金額が違うケースが発生する可能性があるため、審査通過後に与信枠を確認します。 これは、Money Forward Kessaiの審査で与信額を下げて審査通過とする場合があるからです。

希望与信枠または許容範囲の金額・期間で付与されていたら、Money Forward Kessaiを利用した請求を行うという流れになります。

一時的な与信枠取得・増枠を行う

単発で発生する初期費用など、一時的に与信枠の取得・増枠が必要になった場合の利用について説明します。

ここで付与される与信枠は自動与信枠審査機能で付与される月ごとの与信枠ではなく、手動与信枠審査申請による与信枠になります。 与信枠取得方法によって与信枠の付与開始日が異なります。手動与信枠審査申請の場合、与信枠の開始日が審査通過日となります。一方、自動与信枠審査申請の場合は毎月初が開始日になります。

ここでは、事前に対象顧客の顧客登録は行われているものとします。

Step1. 与信枠審査登録をする

Step1. 与信枠審査登録をする

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customer_examinations \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', params={

}, json={
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "tel": "03-1234-5678",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "created_at": "2019-04-18T10:20:34+09:00",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-05-31",
  "id": "WNAV-37R6",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "start_date": "",
  "status": "passed",
  "tel": "03-1234-5678",
  "uri": "mfk:customer_examination:WNAV-37R6",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}

与信枠審査申請 POST: /customer_examinationsを利用します。

顧客を指定して与信枠審査を申請します。これは手動与信枠審査申請です。 自動与信枠審査申請を利用している売り手さまも利用可能です。

付与希望期間に既に与信枠がある場合、既存の与信枠は上書きされます。上書きされた与信枠は利用できなくなります。 ※対象の顧客に審査中(ステータスがunexamined)の与信枠審査がある場合は申請できません。

Step2. 与信枠審査のステータスを確認する 

Step2. 与信枠審査のステータスを確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/WNAV-37R6',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "address1": "東京都千代田区1-2-3",
  "address2": "サンプルビル3F",
  "amount": 20000,
  "business_description": "クラウド型企業間決済サービス",
  "business_type": "corporate",
  "corporate_number": "1234567890123",
  "created_at": "2019-02-18T10:20:34+09:00",
  "customer_id": "7679-YW36",
  "email": "[email protected]",
  "end_date": "2019-04-30",
  "id": "WNAV-37R6",
  "remark": "一部上場企業です。",
  "representative_name": "代表太郎",
  "start_date": "2019-04-01",
  "status": "passed",
  "tel": "03-1234-5678",
  "uri": "mfk:customer_examination:WNAV-37R6",
  "website": "https://mfkessai.co.jp",
  "zip_code": "111-1111"
}

与信枠審査取得 GET: /customer_examinations/{customer_examination_id}を利用します。

登録した与信枠審査IDを利用して、与信枠審査を取得しステータスを確認します。

Step3. 与信枠を確認する

Step3. 与信枠を確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_examination_id=WNAV-37R6',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "amount": 20000,
      "balance": 20000,
      "customer_examination_id": "WNAV-37R6",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-02-18",
      "status": "active",
      "uri": "mfk:credit_facility:7679-YW36"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "7679-YW36",
    "total": 1
  }
}

与信枠一覧取得 GET: /credit_facilitiesを利用します。

審査通過した場合、与信枠を確認します。この時対象の与信枠は与信枠審査IDを指定することで取得できます。 この際に付与される与信枠の開始日は審査通過日となります。

与信枠を利用して取引登録を行う

与信枠がある顧客に対して与信枠内で取引登録をする方法を説明します。

事前に与信枠を超過することがわかっている場合は、一時的な与信枠取得・増枠を行うで増枠を行うことを推奨します。 事前に増枠申請行われず与信枠を超過する取引登録がなされた場合には与信枠残高の消費は行われず、自動的に取引審査を行います。

Step1. 現在有効な与信枠を確認する

Step1. 現在有効な与信枠を確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities?customer_id=9R6M-VMAN&start_date_to=2019-04-05&end_date_from=2019-04-05',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "amount": 20000,
      "balance": 20000,
      "customer_examination_id": "WNAV-37R6",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-04-01",
      "status": "active",
      "uri": "mfk:credit_facility:7679-YW36"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "7679-YW36",
    "total": 1
  }
}

与信枠一覧取得 GET: /credit_facilitiesを利用します。

現在有効な与信枠を取得し、登録しようとしている取引が残高以下の金額であるかを確認します。

取引登録時点で有効な与信枠取得をするためには start_date_to={取引登録日}&end_date_from={取引登録日}のようにパラメーターを指定します。

Step2. 取引を登録する

Step2. 取引を登録する

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/transactions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/transactions', params={

}, json={
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "9R6M-VMAN",
  "canceled_at": "2019-04-22T10:36:43+09:00",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "id": "7679-YW36",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:7679-YW36"
}

取引登録 POST: /transactionsを利用します。

残高を確認したのち取引登録を行います。

与信枠残高以下の取引であれば審査通過となり、即時に結果が返却されます。 残高より取引金額が大きい場合、通常の取引審査を行うので与信審査の結果返却まで最長2営業日かかる場合があります。

Step3. 取引を確認する

Step3. 取引を確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "9R6M-VMAN",
  "canceled_at": "2019-04-22T10:36:43+09:00",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "id": "7679-YW36",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:7679-YW36"
}

取引取得 GET: /transactions/{transaction_id}を利用します。

登録した取引の取引IDを指定して取引審査結果を確認します。 審査否決となった場合にはMoney Forward Kessaiを利用しない請求方法に切り替えるなどの対応が必要になります。

アラートを持つ顧客に対して情報を集める

自動与信枠審査機能をご利用の場合、請求に対する未入金などの理由で顧客の与信枠を更新できなくなった際に顧客に対してアラートがあがります。 アラートの理由に関する情報を取得する方法を説明します。

Step1. アラートありの顧客を確認

Step1. アラートありの顧客を確認

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customers?has_alert=true',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "created_at": "2019-01-01T10:36:43+09:00",
      "has_alert": true,
      "id": "7679-YW36",
      "name": "サンプル顧客",
      "number": "CUSTOEMR001",
      "object": "customer",
      "payment_method": {
        "bank_transfer": {
          "object": "bank_transfer",
          "account_number": "123456789",
          "bank_name": "MEKESSAI銀行",
          "branch_name": "大手町支店",
          "holder_name": "エムエフケツサイ(カ",
          "type": "current"
        },
        "object": "payment_method"
      },
      "uri": "mfk:customer:7679-YW36"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "7679-YW36",
    "total": 1
  }
}

顧客一覧取得 GET: /customersを利用します。

アラートが出ている顧客を取得します。ここで得られる顧客は未入金などが原因で次回の与信枠付与が停止されている顧客です。 現在付与されている与信枠はそのまま利用できます。

アラートがある顧客を絞り込むためにhas_alert=trueを指定します。

Step2. アラートありの顧客に未入金の請求がないか確認

Step2. アラートありの顧客に未入金の請求がないか確認

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/billings?customer_id=7679-YW36&unpaid=true',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "amount": 21800,
      "amounts_per_tax_rate_type": [
        {
          "amount": 11000,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 10800,
          "tax_rate_type": "reduced_8"
        }
      ],
      "customer_id": "WNAV-37R6",
      "destination_id": "7679-YW36",
      "due_date": "2019-04-30",
      "id": "9R6M-VMAN",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-01",
      "object": "billing",
      "status": "scheduled",
      "unpaid": {
        "shortage_amount": 12000,
        "updated_date": "2019-04-30"
      },
      "uri": "mfk:billing:9R6M-VMAN"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "9R6M-VMAN",
    "has_next": false,
    "has_previous": false,
    "limit": 20,
    "start": "9R6M-VMAN",
    "total": 1
  }
}

請求一覧取得 GET: /billingsを利用します。

対象顧客に未入金の請求がある場合、未入金の請求情報を取得できます。 支払期限(due_date)と未入金情報(unpaid)を照らし合わせることで、遅延期間や不足金額を確認できます。

未入金の請求を絞り込むために unpaid=trueを指定します。

顧客番号を利用して取引登録をする

Money Forward Kessaiへ取引登録をする際に、請求先を指定します。 売り手さま側で請求先の管理を行っておらず請求先IDを保持していない場合、顧客番号から請求先IDを取得できます。

利用するEndpoint

Step1. 顧客に紐づく請求先取得

Step1. 顧客に紐づく請求先取得

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/destinations?customer_number=CUSTOMER_0001 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/destinations?customer_number=CUSTOMER_0001', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/destination?customer_number=CUSTOMER_0001")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/destinations?customer_number=CUSTOMER_0001', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/destinations?customer_number=CUSTOMER_0001", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/destinations?customer_number=CUSTOMER_0001',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "items": [
    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
  ],
  "object": "list",
  "pagination": {
    "end": "7679-YW36",
    "has_next": true,
    "has_previous": false,
    "limit": 20,
    "start": "9R6M-VMAN",
    "total": 143
  }
}

利用例: GET: /destinations?customer_number=CUSTOMER_0001

請求先を顧客番号で絞り込み取得します。請求対象の顧客に紐づく請求先一覧が取得できます。 取得した請求先リストから適切なものを選んでください。リストの順番は作成日降順になっていますので、先頭のものが最新の請求先です。

Step2. 取引登録

Step2. 取引登録 

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/transactions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/transactions', params={

}, json={
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "9R6M-VMAN",
  "canceled_at": "2019-04-22T10:36:43+09:00",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "id": "7679-YW36",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:7679-YW36"
}

利用例: POST: /transactions

取得した請求先のIDを利用して取引登録をします。

取引登録時に取引単位で審査を行う

与信枠の取得を行わずに取引登録をする流れを説明します。
この場合、事前の与信枠審査がない代わりに取引登録の都度、取引審査が行われます。

Step1. 顧客を登録する

Step1. 顧客を登録する

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customers \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers', params={

}, json={
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "department": "経理部",
    "email": "[email protected]",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "tel": "03-1234-5678",
    "title": "部長",
    "zip_code": "111-1111"
  },
  "name": "サンプル顧客",
  "number": "CUSTOMER0001"
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/customers',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "customer": {
    "created_at": "2019-04-01T10:36:43+09:00",
    "has_alert": false,
    "id": "AY9N-VPN3",
    "name": "サンプル顧客",
    "number": "CUSTOEMR001",
    "object": "customer",
    "payment_method": {
      "bank_transfer": {
        "object": "bank_transfer",
        "account_number": "123456789",
        "bank_name": "MEKESSAI銀行",
        "branch_name": "大手町支店",
        "holder_name": "エムエフケツサイ(カ",
        "type": "current"
      },
      "object": "payment_method"
    },
    "uri": "mfk:customer:7679-YW36"
  },
  "destination": {
    "address1": "東京都千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "created_at": "2019-04-01T10:36:43+09:00",
    "customer_id": "AY9N-VPN3",
    "department": "経理部",
    "email": "[email protected]",
    "id": "WNAV-37R6",
    "name": "担当 太郎",
    "name_kana": "タントウ タロウ",
    "object": "destination",
    "tel": "03-1234-5678",
    "title": "部長",
    "uri": "mfk:destination:WNAV-37R6",
    "zip_code": "111-1111"
  }
}

顧客登録 POST: /customersを利用します。

取引先の顧客を登録します。
ここでは与信枠を取得しない場合を想定してcustomer_examinationは入力しません。

Step2. 取引を登録する

Step2. 取引を登録する

curl -X POST https://sandbox-api.mfkessai.co.jp/v2/transactions \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'apikey: API_KEY' \
  -d `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}';

try {
    $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Post.new(uri, headers)
req.body='{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}'

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/transactions', params={

}, json={
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{`{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`})
    req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');
const inputBody = `{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "invoice_delivery_methods": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 1,
      "unit_price": -1000
    }
  ]
}`;
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "9R6M-VMAN",
  "canceled_at": "2019-04-22T10:36:43+09:00",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "id": "7679-YW36",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:7679-YW36"
}

取引登録 POST: /transactionsを利用します。

顧客登録時のレスポンスにあるdestination_idを使って取引を登録します。

取引単位で都度審査が実施されるため、即時〜2営業日かかります。
与信枠を利用して取引登録を行う場合は、与信枠内であれば即時通過となります。)

Step3. 取引を確認する

Step3. 取引を確認する

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36 \
  -H 'Accept: application/json'
  -H 'apikey: API_KEY'
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'apikey' => 'API_KEY',

    );

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = '';

try {
    $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36', array(
        'headers' => $headers,
        'body' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
require 'net/http'
require 'uri'

uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36")

headers = {
  'Accept' => 'application/json',
  'apikey' => 'API_KEY'
}

req = Net::HTTP::Get.new(uri, headers)

req_options = {
    use_ssl: uri.scheme = "https"
}

response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
  res = http.request(req)
  p res
end
import requests
headers = {
  'Accept': 'application/json',
  'apikey': 'API_KEY'
}

r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36', params={

}, headers=headers)

print(r.json())
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "apikey": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{``})
    req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36", data)
    if err != nil {
        // handle error
        return
    }
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        // handle error
        return
    }
    // ...
}
const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'apikey':'API_KEY'
};

fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions/7679-YW36',
{
  method: 'GET',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

レスポンス

{
  "amount": 5440,
  "amounts_per_tax_rate_type": [
    {
      "amount": 2200,
      "tax_rate_type": "normal_10"
    },
    {
      "amount": 3240,
      "tax_rate_type": "reduced_8"
    }
  ],
  "billing_id": "9R6M-VMAN",
  "canceled_at": "2019-04-22T10:36:43+09:00",
  "created_at": "2019-04-01T10:36:43+09:00",
  "date": "2019-04-10",
  "destination_id": "WNAV-37R6",
  "due_date": "2019-04-30",
  "id": "7679-YW36",
  "invoice_delivery_method": [
    "posting",
    "email"
  ],
  "issue_date": "2019-04-20",
  "number": "Transaction-0001",
  "object": "transaction",
  "status": "passed",
  "transaction_details": [
    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": 3000,
      "description": "商品名B",
      "tax_included_type": "excluded",
      "tax_rate_type": "reduced_8",
      "quantity": 3,
      "unit_price": 1000
    },
    {
      "amount": -1000,
      "description": "商品名A 返品",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": -1,
      "unit_price": 1000
    }
  ],
  "uri": "mfk:transaction:7679-YW36"
}

取引取得 GET: /transactions/{transaction_id}を利用します。

登録した取引の取引IDを指定して取引審査結果を確認します。 審査否決となった場合にはMoney Forward Kessaiを利用しない請求方法に切り替えるなどの対応が必要になります。

与信枠と審査

取引登録に先んじて顧客の与信枠を取得できます。 取引後に与信がとれず本サービスを利用した請求ができないなどのリスクを、与信枠を利用することで回避することができます。

与信枠

Money Forward Kessaiにおける与信枠は顧客(Customer)に対して付与されます。 以下の2つの要素を持っています。

与信枠の有効期間内・与信残高内での取引登録であれば、取引審査は即時通過します。

与信枠の有効期間内に取引登録をすると、与信枠を利用した取引審査が行われます。 取引金額が与信残高以下であれば取引審査は即時通過し、与信残高が消費されます。 取引金額が与信残高を超過していた場合は、通常の取引審査を行います。この時与信残高は消費されません

また、同一顧客に対する各与信枠の有効期間が重なることはありません。ある時点で有効な与信枠は必ず一つになります。 ※具体例として、増枠申請のスケジュールを参照ください。

クレジットカードとの違い

クレジットカードの与信枠とは有効期間・与信残高の扱いにおいて違いがあります。

一般的なクレジットカードは事前に付与された一つの与信枠を利用します。 取引登録によって与信残高が消費され、後に支払いがなされると与信残高は支払われた金額分だけ回復する仕組みになっています。

一方でMoney Forward Kessaiの与信枠には期間ごとにそれぞれ独立した複数の与信枠となります。 取引登録によって対象期間の与信残高が消費されますが、別の期間の与信枠へは影響しません。 その代わり、支払いがなされても与信残高は戻りません。

Money Forward Kessai クレジットカード
期間 ×
残高の回復 ×

与信枠審査

Money Forward Kessaiでは与信枠審査を提供しております。 自動で毎月審査を行い与信枠を取得するサービスです。 ご利用されたい場合はお問い合わせください。お問い合わせ先: [email protected]

与信枠審査のご利用の有無によって、与信枠確保のための審査申請や与信枠のパターンが異なります。

与信枠審査ご利用の場合

与信枠申請(自動)

顧客登録(POST: /customers)時に自動で与信枠審査申請を行います。また、与信枠の更新も自動で毎月行われます。

顧客登録から請求までの流れは下図のようになります。

与信枠申請フロー

この方法によって付与される与信枠は月ごとの有効期間をもちます。

ご契約前に当社と合意の上で以下の二点を決定します。

この二点をもとに自動で与信枠審査申請を行います。 例えば、2ヶ月分・X円という設定下で3月中に顧客登録をした場合、下図のように与信枠が付与されます。

また、月次で新たに申請を行います。上記の設定下では4月中頃に 5/1~5/31・X円の与信枠審査申請を行います。

与信枠審査(自動)スケジュール

この審査が否決された場合、顧客にアラートがあがりcustomer.has_alertというPropertyが trueに変わります。 アラートは今後の与信枠の更新が止まることを意味しています。 アラートはあくまで今後の付与の停止を意味するので、付与済みの与信枠については無効になることはありません。

与信枠申請(自動)スケジュール否決

特定の顧客との取引金額が他の顧客と大幅に異なる場合や、顧客ごとに取引金額がまちまちである場合には、顧客ごとに与信希望金額の基本値を指定していただくこともできます。 こちらは顧客登録時にcustomer_exmination.amountの値にて指定できます。

与信枠申請(手動)

対象の顧客に与信枠がない場合、顧客登録とは別に、POST: /customer_examinationsを利用して手動で与信枠申請を行います。 この時希望取引登録期間終了日(end_date)と希望与信額(amount)を指定します。

例えば、~3/31・Y円で申請した場合、3/23に審査通過したとすると以下の与信枠が付与されます。

与信枠申請(手動)スケジュール

顧客アラートがtrueとなっている顧客に対して与信枠申請(手動)の審査が通過した場合、以下のようになります。

増枠申請

既に与信枠がある期間に対する与信枠審査申請は増枠申請になります。与信枠申請と同様にPOST: /customer_examinationsを利用します。 増枠審査が通過した場合、有効期限が重複している古い方の与信枠は上書きされ無効となります。 また、今後有効な与信枠についても増枠された金額が反映されます。

与信枠審査申請スケジュール上書き

増枠による与信枠の有効期間が次回の与信枠付与期間を含んでいる場合は月次の与信枠申請(自動)はスキップされます。

与信枠申請スケジュール増枠後

顧客アラートがtrueとなっている顧客に対して増枠申請の審査が通過した場合、以下のようになります。

与信枠審査ご利用でない場合

与信枠審査をご利用でない場合も、一時的な与信枠の取得が可能です。

一時与信枠申請

対象の顧客に与信枠がない場合、顧客登録とは別に、POST: /customer_examinationsを利用して手動で一時与信枠申請を行います。 この時希望取引登録期間終了日(end_date)と希望与信額(amount)を指定します。

顧客登録から請求までの流れは下図のようになります。 一時与信枠申請フロー

この方法によって付与される与信枠は審査通過日からこの時希望取引登録期間終了日までの有効期間を持ちます。

例えば、~5/31・Y円で申請した場合、3/23に審査通過したとすると以下の与信枠が付与されます。

一時与信枠申請スケジュール

増枠申請

既に与信枠がある期間に対する与信枠審査申請は増枠申請になります。一時与信枠申請と同様にPOST: /customer_examinationsを利用します。 増枠審査が通過した場合、有効期限が重複している古い方の与信枠は上書きされ無効となります。

増枠申請スケジュール上書き

税計算について

請求書に記載される税額の計算方法について説明します。

基本事項

まずMoney Forward Kessaiにおいて税率計算に関わる請求(billing)・取引(transaction)・取引明細(transaction_detail)の関係性について確認します。

これらは 請求>取引>取引明細という親子関係になっています。

Money Forward Kessaiへは、取引単位でご登録いただきます。同じ顧客への同条件(請求先・支払期限・請求書発行日・取引登録方式が同一)の取引をまとめ、一つの請求書として発行しています。

請求・取引・取引明細の親子関係

税率種別毎の合計税込金額

"amounts_per_tax_rate_type": [
    {
        "amount": 11000,             // 合計税込金額
        "tax_rate_type": "normal_10" // 税率種別
    },
    {
        "amount": 10800,
        "tax_rate_type": "normal_8"
    },
]

取引明細

"transaction_details": [
    {
        "amount": 10000,                // 金額
        "tax_rate_type": "normal_10",   // 税率種別
        "tax_included_type": "exclude", // 税込 or 税抜
        ...
    },
    {
        "amount": 10800,
        "tax_rate_type": "normal_8",
        "tax_included_type": "include",
        ...
    }
]

次に取引登録の際に必要な項目の中で税額計算に関連するものを確認します。 リクエスト中では右サンプルのようになります。

「税率種別毎の合計税込金額」には、「取引明細から算出される税率種別毎の合計税込金額」を任意の方法で整数にまるめた値を利用します。 これらの差は1円未満である必要があります。

請求単位での税額計算

2019年10月より開始された軽減税率制度に伴い、Money Forward Kessaiでも軽減税率対応を行いました。 これにより、税額計算を請求単位で行うようになりました。

軽減税率制度下の請求書では以下が求められます。

参考:

請求書毎に税額を計算する必要があるので取引単位では税額は決定されません

Money Forward Kessaiへの取引登録では取引明細において税率種別(tax_rate_type)を指定します。 取引を請求書にまとめる際に、この税率種別を利用して税額を計算して記載しています。

請求での税額は、請求に含まれる取引の税率種別毎の合計金額を合算し、税率で割り戻して計算しております。 端数が出た場合は売り手毎の端数処理設定が適用されます。

この処理によって請求金額にずれは生じません。しかし一方で、「取引毎に計算した税額の合計」と「請求の税額」はずれる可能性がございます。

例えば、消費税の端数処理設定を四捨五入にしている場合は下図のように、「取引毎に計算した税額の合計」と「請求の税額」にずれが生じることがあります。

請求時の税額ズレ

税込金額の整合性確認

請求金額が意図しない金額にならないために、取引登録時に税率種別毎の税込金額と取引明細の整合性を確認しています。

税込金額の整合性確認には具体的には以下の2つを比較しています。

※取引明細が税抜指定の場合(tax_included_type=excluded)は税率を乗じて税込金額を算出しています。

端数処理を考慮し、この2つの差が1円未満であるかを確認しています。

請求代行プランについて

請求代行プランにてAPIをご利用される場合、審査に係るものなど、いくつかの機能がご利用いただけません。 ご利用いただけない機能は以下の通りです。

  1. 請求条件
    取引登録の際、請求条件 billing_condition に「審査通過のみ passed」を指定することができません。
    何も指定しないか、「すべて請求 all」を指定してください。

  2. オーソリゼーションID
    オーソリゼーション機能をご利用いただけないため何も指定せずフィールドごと省略してください。
    オーソリゼーションを指定した場合でも審査はされず、債権譲渡もされません。

  1. 顧客登録時の審査情報
    顧客登録時に与信枠審査情報 customer_examination を付与できますが指定しても無視され与信枠審査は行われません。

  2. 与信枠審査申請
    与信枠申請および与信枠はご利用いただけないため、以下のエンドポイントで提供しているAPIはご利用いただけません。
    ■ 与信枠の申請 /customer_examinations
    ■ 与信枠の参照 /credit_facilities
    ■ オーソリゼーション /authorizations

よくあるご質問

Q.API v1からv2に変更するには手続き・契約更新などが必要でしょうか?

A.変更の際に必要な手続きや契約更新はありません。またAPIキーも共通でご利用いただけるので、新たにv2用のAPIキーを発行する必要もございません。

Q.自動与信枠審査申請が更新されるタイミングを教えて下さい。

A.前後する可能性もありますが、基本的に毎月15日~25日に対応しております。

Q.自動与信枠審査申請がされないケースはありますか?

A.基本的には未入金などの与信枠付与を継続できない状態であると判断した顧客に対して、アラートとして Customer.has_alerttrueに設定しております。 このアラートを持つ顧客に関しましては与信枠の更新が行われません。

Q.自動与信枠審査申請を利用する場合に費用はかかりますか?

A.別途費用はかかりません。

Q.自動与信枠審査申請を停止することはできますか?

A.可能です。ご希望の際は、以下メールアドレスにお問い合わせください。

[email protected]

Q.与信枠審査にはどのくらい時間がかかりますか?

A.最大で2営業日いただいております。

Q.与信枠審査の結果はどのように取得できますか?

A.結果の取得にはいくつか方法がございます。

※自動与信枠審査機能をご利用の場合、審査結果メールが送付されるのは初回時・付与停止通知時・増枠申請時のみとなり 通常の継続付与に際しては審査結果メールは送付されません。

Q.請求先の追加では審査されますか?

A.顧客に対する請求先追加では審査はいたしません。

Q.取引審査にはどのくらい時間がかかりますか?

A.最大で2営業日いただいております。与信枠をご利用の場合は金額が与信枠内であれば即時に結果が返却されます。

Q.Sandbox環境で顧客・取引審査結果を操作することはできますか?

A.可能です。詳しくは審査結果の操作を参照ください。

Q.与信枠がない・もしくは与信枠を超過する場合にも取引登録は可能ですか?

A.可能です。与信枠がない、または与信枠を超過する場合は取引審査となります。

Q.顧客と請求先の関係について教えて下さい。

A.顧客は取引先企業で、請求先は取引担当者という位置づけの親子関係になっており、顧客一件に対して請求先を複数件登録することができます。

Q.顧客登録時に請求先も登録されますか?

A.はい。POST: /customers をご利用の場合、顧客登録時に請求先が一件のみ登録されます。

Q.顧客名を変更したいです。

A.顧客名変更申請登録 POST: /customer_name_updates をご利用ください。

Q.登録済み取引の請求先を変更したいです。

A.請求書未発送の場合は、一度対象の取引をキャンセルしていただき、再度ご登録をお願いいたします。 請求書発送済みの場合は、請求書再発行時に修正後の請求先を指定してください。

Q.取引が請求にまとまる条件を教えて下さい。

A.以下の4つの条件が同一の取引が一つの請求にまとまります。

取引登録方式には、取引登録時に税率を指定しない旧方式と軽減税率対応の新方式があります。 API v2を利用した取引登録では常に新方式となります。 一方で以下の方式で取引登録をいた場合は旧方式となります。

Q.端数処理設定がAPIによる取引登録時も利用されますか。

A.利用されません。端数処理設定についてはこちらのサポートページをご覧ください

Q.請求の送付方法の決定方法を教えて下さい。

A.同一の請求内で少なくとも1つの取引がその送付方法を指定していた場合は、その送付方法を利用して請求書を送付します。

例:取引①と取引②が同一の請求にまとまっている場合、取引登録時に指定した送付方法の組み合わせによって以下のようになります。

取引① 取引② 送付方法
メール メール メール
郵送 郵送 郵送
メール 郵送 メール・郵送
メール メール・郵送 メール・郵送

Q.Money Forward Kessaiから売り手さまへ振込後に取引キャンセルした場合、返金方法を教えて下さい。

A.Money Forward Kessaiから売り手さまへ振込後に取引キャンセルが発生した場合、次回の振込より控除いたしますので売り手様側でのご返金手続きは必要ございません。

Q.キャンセルした取引番号は使い回せますか?

A.ご利用いただけません。別途取引番号をご用意いただく必要があります。

Q.キャンセル期限はありますか?

A.キャンセル期限はありません。

Q.取引登録の締めはありますか?

A.取引登録の締めはございません。取引毎に請求書発行日をご指定いただければ、その日付に沿って請求書を発行いたします。

Q.特定の請求書フォーマットに対応できますか?

A.現在対応しておりません。

Q.買い手がMFK口座ではなく、売り手口座に誤って入金した場合はどうすればよいでしょうか?

A.ご登録いただいた取引をキャンセルしていただいています。

Q.メンテナンス時間はいつですか?

A.不定期メンテナンスを実施しています。実施の際は、事前に管理画面にご登録いただいているメールアドレス宛に実施内容及び対応方法を通知いたします。お客様にはご不便をおかけいたしますが、何卒ご了承ください。

移行ガイド

API v1 のサポート終了に伴い、スムーズにAPI v2へ移行するためのガイドです。

できなくなること

v1とv2の大きな違いとして以下があります。

これにより次の操作が利用できなくなっています。

上記を利用していない場合はエンドポイント対応表をもとに、現在ご利用のエンドポイントをv2のものに置き換えることで移行可能です。

顧客情報での顧客指定とは?

v1のリクエストボディ例

{
  "address1": "千代田区1-2-3",
  "address2": "サンプルビル3F",
  "cc_emails": [
    "[email protected]",
    "[email protected]"
  ],
  "customer": {
    "office_name": "サンプル1株式会社",
    "user_defined_id": "customer000001"
  },
  "department": "経理部",
  "email": "[email protected]",
  "name": "請求先氏名",
  "name_kana": "セイキュウサキ シメイ",
  "prefecture": "東京都",
  "tel": "03-1234-5678",
  "title": "",
  "zip_code": "111-1111"
}

具体例は右記のようなリクエストで請求先追加を行っている場合です。
請求先登録API(POST: /v1/destinations)のpayloadの中で customer_idではなくcustomerを利用しています。

v2では customerを利用した請求先登録はできません。

解決策

売り手さま側で顧客IDを保持している場合は、そちらの顧客IDを利用してください。

顧客IDを保持していない場合は、下記顧客IDがわからない場合を参照ください。

請求先情報での請求先指定とは?

v1のリクエストボディ例

{
  "amount": 2160,
  "date": "2019-05-14T00:00:00+09:00",
  "destination": {
    "address1": "千代田区1-2-3",
    "address2": "サンプルビル3F",
    "cc_emails": [
      "[email protected]",
      "[email protected]"
    ],
    "customer": {
      "office_name": "サンプル1株式会社",
      "user_defined_id": "customer000001"
    },
    "department": "経理部",
    "email": "[email protected]",
    "name": "請求先氏名",
    "name_kana": "セイキュウサキ シメイ",
    "prefecture": "東京都",
    "tel": "03-1234-5678",
    "title": "",
    "zip_code": "111-1111"
  },
  "due_date": "2019-06-30T00:00:00+09:00",
  "email_flag": true,
  "issue_date": "2019-06-13T00:00:00+09:00",
  "posting_flag": false,
  "transaction_details": [
    {
      "amount": 2000,
      "description": "商品名A",
      "quantity": 2,
      "unit_price": 1000
    },
    {
      "amount": 160,
      "description": "消費税",
      "quantity": 1,
      "unit_price": 160
    }
  ],
  "user_defined_id": "transaction00000001"
}

具体例は下記のようなリクエストで取引登録を行っている場合です。
請求先登録API(POST: /v1/transactions)のpayloadの中で destination_idではなくdestinationを利用しています。
右の例では、destination内の顧客指定でcustomer_idではなくcustomerを利用しています。

v2では destinationを利用した取引登録はできません。

解決策

請求先IDを売り手さま側で保持している場合は、そちらの請求先IDを利用してください。

請求先IDを保持していない場合は、請求先IDがわからない場合を参照ください。

顧客IDがわからない場合

顧客一覧取得(GET: /v2/customers)で顧客番号から顧客IDを取得できます。
クエリパラメータnumberを指定することで、顧客番号により一致する顧客を一件取得できます。

※この時レスポンスは対象顧客一件だけが含まれる顧客リストとして返却されます。

請求先IDがわからない場合

[
  {
    "code": "already_exists",
    "message": "destination already exists",
    "param": "9R6M-VMAN"
  }
]

請求先登録(POST: /v2/destinations)を利用してください。
未登録の請求先の場合、登録された請求先が返却されますので、請求先IDが取得できます。
登録済みの請求先の場合エラーコード 409が返却されます。
このエラーレスポンスのparamから登録済みの請求先IDが取得できます。

エンドポイント対応表

操作 v1 v2
顧客登録 POST: /v1/destinations
(POST: /v1/transactions)
POST: /v2/customers
請求先追加 POST: /v1/destinations
(POST: /v1/transactions)
POST: /v2/destinations
顧客一覧取得 GET: /v1/customers GET: /v2/customers
顧客取得 GET: /v1/customers/id GET: /v2/customers/id
与信枠審査申請 POST: /v1/customers/id/customer_examinations POST: /v2/customer_examinations
顧客ごとの与信枠審査取得 GET: /v1/customers/id/examination GET: /v2/customer_examinations?customer_id=id (※1)
顧客ごとの与信枠取得 GET: /v1/customers/id/credit_facility GET: /v2/credit_facilities?customer_id=id (※2)
取引登録 POST: /v1/transactions POST: /v2/transactions
取引一覧取得 GET: /v1/transactions GET: /v2/transactions
取引取得 GET: /v1/transactions/id GET: /v2/transactions/id
取引キャンセル POST: /v1/transactions/id/cancel DELETE: /v2/transactions/id
事前審査登録 POST: /v1/examinations (※3)
事前審査一覧取得 GET: /v1/examinations (※3)
事前審査取得 GET: /v1/examinations/id (※3)
事前審査を利用した取引登録 POST: /v1/examinations/id/transaction (※3)

※1...v1では最新の与信枠審査一件のみの取得でしたが、v2では対象顧客に対する与信枠審査がすべて取得できます。

※2...v1では現在適用中の与信枠一件のみの取得でしたが、v2では対象顧客に対する与信枠がすべて取得できます。

※3...v2では事前審査系APIを提供しておりません。代替として与信枠審査をご利用ください。

バージョン

Money Forward Kessaiが提供しているAPIには現在 v1,v2が存在します。 本APIはv2であり、v1との互換性はありません。 但し、apikeyに関しては両APIで共通で利用できます。

新しいPropertyについて

機能改善により、既存のObjectに新たなPropertyが追加されることがあります。 Client側では未知のPropertyは無視するようにしてください。

提供終了について

提供が終了する予定のEndpoint、またはPropertyはDeprecatedと表示されます。 DeprecatedとなっているEndpointまたはPropertyは将来削除予定のものなので、利用を控えてください。

Deprecatedである期間は1年間で、それを過ぎると提供終了します。

リリースについて

新機能や提供終了の連絡はリリースノートと売り手様向けのお知らせメールで行います。

定期的に確認するようにしてください。

リリースノート

新機能のリリースや機能改善・非推奨機能・機能削除の情報を随時更新していきます。

2024.02.08

新機能

2023.09.12

新機能

2023.09.11

新機能

2023.08.18

新機能

インボイスモード(取引単位)に対応した取引登録、請求取得ができるようになりました。

ドキュメントの修正

2023.08.09

ドキュメントの修正

以下のエラーコードを追加しました

2023.07.13

ドキュメントの修正

2023.07.12

新機能

2023.06.15

新機能

2023.04.19

変更

2023.03.31

新機能

2023.01.31

新機能

インボイス(適格請求書)モードに対応した取引登録、請求取得ができるようになりました。

ドキュメント修正

2022.09.16

ドキュメント修正

以下のエラーコードの説明が欠損していたため追加しました。

以下のエラーコードの説明に誤りがあったため修正しました。

2022.08.10

変更

取引登録時にcanceled_transaction_idを指定した際に、その取引IDが与信枠に紐付いていない場合に、
エラーコードinvalid_canceled_transaction_not_related_to_credit_facilityを返していましたが、
このケースを許容するよう変更し、エラーコードを削除しました。

2021.12.07

新機能

2021.11.11

新機能

2021.06.23

新機能

2021.06.21

新機能

2021.06.01

新機能

2021.05.11

新機能

2021.04.26

新機能

2021.02.12

新機能

変更

2020.12.18

新機能

2020.12.04

2020.12.03

新機能

変更

2020.12.02

変更

2020.10.27

新機能

2020.09.30

新機能

2020.04.21

変更

2020.04.03

新機能

2020.03.24

新機能

2020.03.09

新機能

債権譲渡の対象とならない取引についても請求対象とする機能を追加しました。
参考: プレスリリース

2020.02.05

変更

2020.01.27

新機能

2019.12.06

新機能

2019.11.25

変更

2019.11.14

新機能

2019.11.06

新機能

変更

2019.10.23

変更

2019.09.26

変更

2019.09.03

新機能

2019.08.22

新機能

2019.07.23

新機能

2019.06.25

新機能

クライアント

本APIではAPIのインタフェース定義にOpenAPI Specification(以下OAS)を利用しています。 バージョンはSwaggerとして知られているOpenAPI2.0です。

OAS定義ファイルを利用して本APIのクライアントコードを生成できます。 コード生成ツールが以下のサイトにまとめられていますので、ご利用ください。

APIクライアントの生成

docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli generate \
    -i  https://developer.mfkessai.co.jp/docs/v2/swagger.yaml \
    -g go \
    -o /local/out/go

swagger.jsonを提供しておりますので、openapi-generatorをご利用いただくことで、APIクライアントを生成することができます。

openapi-generatorの導入方法、使い方はhttps://openapi-generator.tech/をご参照ください。 右はDockerを用いてGoクライアントを生成する例です。他の言語も同様に生成することができます。

ダウンロード

以下のリンクからswagger.yamlをダウンロードしてください。

認証

本APIではHTTP Headerを利用したapikey方式で認可を行っています。 apikeyはお問い合わせ頂いた後にMoney Forward Kessai側で利用登録を行います。その後、管理画面上から発行・取得ができるようになります。 また、apikeyはAPIの旧バージョンであるv1と共通で利用できます。既に発行済みの場合は、再度発行する必要はありません。

漏洩リスク

apikeyは漏洩リスクが高いため、安全に保管するようにしてください。 Github,Bitbucketなどのサードパーティーのホスティングサービスや、フロントエンドのコード内など、外部に公開される場所には絶対に置かないようにしてください。

利用方法

ヘッダー設定例

apikey: abcfc38888b419215612146c427f34637eb05e340e55b68664d81c37276357ba

API利用をご希望される売り手様は、Money Forward Kessaiへお問い合わせください。API利用登録を行います。

  1. APIキーページへ行き「新規発行」ボタンでapikeyを発行してください。 ※本番URLはこちらです。本番APIキーページ
  2. 発行されたapikeyをコピーしておいてください。 APIキー発行
  3. 取得したapikeyを利用して各Endpointへアクセスします。 HTTPヘッダーに右のように設定してください。

環境

本APIではProduction環境とテスト用のSandbox環境を提供しています。

環境名 URL
Production https://api.mfkessai.co.jp/v2/
Sandbox https://sandbox-api.mfkessai.co.jp/v2/

Sandbox環境

Sandbox環境では一部機能が制限されています。 また、Sandbox環境ではテストのために審査結果などを指定することができます。

機能の制限

制限されている機能は以下の通りです。

審査結果の操作

取引審査・与信枠審査などで特定の結果を指定してテストを行いたい場合、 Sandbox環境に限りマジックナンバーを利用して期待する結果を得ることができます。

取引審査

対象の取引の取引明細(TransactionDetailPayload)のdescriptionすべて以下に示す結果と対応する文字列にすると、取引の審査結果を指定することができます。
参考:TransactionDetailPayload

結果 対応する文字列
審査通過 __passed__
審査否決 __rejected__
未審査 __unexamined__

与信枠審査

与信枠申請時に申請情報(CustomerExaminationPayload)のremarkを以下に示す結果と対応する文字列にすると与信枠審査結果を指定することができます。
参考:CustomerExaminationPayload

また、与信枠審査利用されている場合、顧客登録時にの与信枠審査申請情報(CustomerPayload.customer_examination)のremarkに対しても同様の文字列にすることで 自動で申請される与信枠申請の審査結果を指定することができます。

結果 対応する文字列
審査通過 __passed__
審査否決 __rejected__
未審査 __unexamined__

文字コードとデータ形式

文字コード

本APIではリクエスト/レスポンスともに文字コードとしてUTF-8を使用しています。 他の文字コードでの利用はできません。

日時・日付

本APIでの日時・日付を表すデータ形式はRFC3339に準拠しています。 GETメソッドを使用したエンドポイントで、URLにクエリとして含める場合にはURLエンコードしてください。+はURLではスペースとして扱われてしまうので、%2Bとする必要があります。

データ型 フォーマット 凡例
日時 RFC3339 date-time 2019-04-22T15:04:05+09:00
URLに含める場合 2019-04-22T15:04:05%2B09:00
日付 RFC3339 full-date 2019-04-22

小数

小数を表すデータ形式として小数点以下4桁までのdecimal型を利用しています。 小数点以下5桁以上の入力を行うとエラーが返却されます。

エラー

レスポンスコード

本APIは一般的なHTTPレスポンスコードを利用しています。 2xxの範囲のステータスコードは正常処理を表します。 4xxの範囲はリクエストのParameterなどの入力に起因するエラーで、リクエストが受付られない状態を表します。 5xxの範囲はMoney Forward Kessai内部で正常に処理が行われなかった状態を表します。

ステータスコード 内容
200 - OK 成功
400 - Bad Request Parameterの不備などでリクエストを受付られない。
401 - Unauthorized 認証・認可できない。apikeyが不正である。
404 - Not Found 指定したリソースが存在しない。
405 - Method Not Allowed 不正なメソッドが利用された。
409 - Conflict 作成しようとしたリソースが既に存在する。
412 - Precondition Failed リソースへのアクセスが拒否された。
429 - Too Many Requests レートリミットを超えてリクエストがされた。
499 - Client Canceled クライアントが接続を遮断した。
500, 502, 503, 504 - Server Errors Money Forward Kessai内で処理が正常に行われなかった。

タイムアウト

本APIはリクエストの処理時間が一定時間以上になった場合にTimeoutとなることがあります。 指定したレスポンスを返しません。

エラー

レスポンス例

[
  {
    "code": "invalid_parameter",
    "message": "parameter must be a valid one.",
    "param": "9R6M-VMAN"
  }
]

エラー発生時にはエラーレスポンスコードと共にエラーObjectを返却します。

項目 内容
code string エラーコード文字列。発生したエラーに対応したエラーコード
message string エラー発生原因に関する情報。
param string 何らかの値に関するエラーの場合、その値がはいります。

エラーコード

4xxの範囲のエラー時に返却されるエラーコードとその説明の一覧です。

unavailable_seller

現在ご利用できません。

param:-

seller_setting_required

売り手さまの初期設定が不足しています。担当者までお問い合わせください。

param:-

not_found

指定されたObjectが見つかりませんでした。

param:指定されたリソースのID

request_canceled

リクエストがキャンセルされました。処理が正常に完了していない可能性があります。

param:-

already_exists

作成/更新しようとしたObjectが既に存在します。同一の情報をもつObjectがないか確認してください。

param:請求先登録請求先更新のみ登録済みの請求先ID

invalid_json_format

POSTデータのjsonが不正なフォーマットになっています。

param:-

invalid_after

ページネーションで指定されたafterの値が不正です。afterは存在するリソースのIDで指定してください。

param:指定されたafterの値

invalid_before

ページネーションで指定されたbeforeの値が不正です。beforeは存在するリソースのIDで指定してください。

param:指定されたbeforeの値

invalid_limit

ページネーションで指定されたlimitの値が不正です。limitは1~200までの整数で指定してください。

param:指定されたlimitの値

out_of_range_by_after

ページネーションで指定されたafterの値が範囲外を指しています。

param:指定されたafterの値

out_of_range_by_before

ページネーションで指定されたbeforeの値が範囲外を指しています。

param:指定されたbeforeの値

invalid_amount_per_tax_rate_type_amount

指定された各税率種別毎の合計金額amountの値が不正です。

param:指定されたamountの値

invalid_amount_per_tax_rate_type_tax_rate_type

指定された税率種別tax_rate_typeの値が不正です。取引明細に指定した税率種別をもつ明細が存在することも確認してください。

param:指定されたtax_rate_typeの値

invalid_created_at_from

指定されたcreated_at_fromの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたcreated_at_fromの値

invalid_created_at_to

指定されたcreated_at_toの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたcreated_at_toの値

invalid_canceled_at_from

指定されたcanceled_at_fromの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたcanceled_at_fromの値

invalid_canceled_at_to

指定されたcanceled_at_toの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたcanceled_at_toの値

invalid_accepted_at_from

指定されたaccepted_at_fromの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたaccepted_at_fromの値

invalid_accepted_at_to

指定されたaccepted_at_toの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたaccepted_at_toの値

invalid_account_transfer_notification_id

指定されたaccount_transfer_notification_idの形式または値が不正です。例:GY9N-EWNM

param:指定されたaccount_transfer_notification_idの値

invalid_authorization_amount

指定されたamountの形式または値が不正です。

param:指定されたamountの値

invalid_authorization_canceled

指定されたオーソリゼーションはキャンセル済みのため利用できません。

param:指定されたauthorization_idの値

invalid_authorization_captured

指定されたオーソリゼーションは確定済みのため利用できません。

param:指定されたauthorization_idの値

invalid_authorization_credit_facility_balance_shortage

指定されたオーソリゼーションは与信残高不足のため作成できません。

param:指定されたamountの値

invalid_authorization_expired

指定されたオーソリゼーションは期限切れで利用できません。

param:指定されたauthorization_idの値

invalid_authorization_id

指定されたauthorization_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたauthorization_idの値

invalid_authorization_not_available

指定されたオーソリゼーションは利用できません。

param:指定されたauthorization_idの値

invalid_authorization_not_found

指定されたオーソリゼーションがみつかりませんでした。

param:指定されたauthorization_idの値

invalid_authorization_not_matched

指定されたauthorization_iddestination_idの顧客が一致しません。

param:指定されたauthorization_idの値

invalid_authorization_number

指定されたnumberの形式または値が不正です。100字以内で指定してください。

param:指定されたnumberの値

invalid_authorization_over_amount

指定されたamountがオーソリゼーションの金額を超過しています。

param:指定されたauthorization_idの値

invalid_authorization_over_due_date

指定されたdue_dateがオーソリゼーションのmax_due_dateを超過しています。

param:指定されたauthorization_idの値

invalid_authorization_status

指定されたstatusの形式または値が不正です。active,expired,captured,canceledから指定してください。

param:指定されたstatusの値

invalid_billing_accepted_at_from

指定されたbilling_accepted_at_fromの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたbilling_accepted_at_fromの値

invalid_billing_accepted_at_to

指定されたbilling_accepted_at_toの形式または値が不正です。例:2019-04-02T07:00:00+09:00

param:指定されたbilling_accepted_at_toの値

invalid_canceled_transaction_already_used

指定されたキャンセル済み取引canceled_transaction_idはすでに利用されています。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_canceled_in_effective_period

指定されたキャンセル済み取引canceled_transaction_idは消費した与信枠の有効期間中にキャンセルされています。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_customer_not_matched

指定されたキャンセル済み取引canceled_transaction_idの顧客と取引の顧客が一致しません。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_expired

指定されたキャンセル済み取引canceled_transaction_idは期限切れです。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_id

指定されたキャンセル済み取引canceled_transaction_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_inherited

指定されたキャンセル済み取引canceled_transaction_idは別のキャンセル済み取引の与信を利用して登録された取引です。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_not_found

指定されたキャンセル済み取引canceled_transaction_idは見つかりません。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_not_accepted

指定されたキャンセル済み取引canceled_transaction_idは債権譲渡されていません。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_not_available

キャンセル済み取引を利用した取引登録は利用出来ません。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_not_canceled

指定されたキャンセル済み取引canceled_transaction_idはキャンセルされていません。

param:指定されたcanceled_transaction_idの値

invalid_canceled_transaction_over_amount

指定された顧客名canceled_transaction_idの金額を超過しています。

param:指定されたcanceled_transaction_idの値

invalid_customer_name

指定された顧客名nameの値が不正です。1~50文字の文字列で指定してください。

param:指定されたnameの値

invalid_customer_number

指定された顧客番号numberの値が不正です。100文字以内の文字列で指定してください。

param:指定されたnumberの値

invalid_customer_destination

指定された請求先情報destinationの値が不正です。

param:-

invalid_customer_has_alert

指定されたhas_alertの値が不正です。アラートありtrueまたはアラートなしfalseで指定してください。

param:指定されたhas_alertの値

invalid_customer_id

指定されたcustomer_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたcustomer_idの値

invalid_customer_ids

指定されたcustomer_idが指定可能な件数を超えています。同時に指定するIDは200件以内にしてください。

param:指定されたidsの値

invalid_customer_payment_method

指定された支払方法payment_methodの値が不正です。口座振替account_transferまたは銀行振込bank_transferで指定してください。

param:指定されたpayment_methodの値

invalid_destination_address1

指定されたaddress1の値が不正です。1~100文字の文字列で指定してください。

param:指定されたaddress1の値

invalid_destination_address2

指定されたaddress1の値が不正です。100文字以内の文字列で指定してください。

param:指定されたaddress2の値

invalid_destination_cc_emails

指定されたcc_emailsの値が不正です。それぞれメールアドレス形式で指定し、4件以内としてください。

param:指定されたcc_emailsの値

invalid_destination_department

指定されたdepartmentの値が不正です。50字以内の文字列で指定してください。

param:指定されたdepartmentの値

invalid_destination_email

指定されたemailの値が不正です。メールアドレス形式で指定してください。

param:指定されたemailの値

invalid_destination_id

指定されたdestination_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたdestination_idの値

invalid_destination_name

指定されたnameの値が不正です。30文字以内の文字列で指定してください。

param:指定されたnameの値

invalid_destination_name_kana

指定されたname_kanaの値が不正です。60文字以内のカタカナで指定してください。

param:指定されたname_kanaの値

invalid_destination_tel

指定されたtelの値が不正です。有効な電話番号を指定してください。

param:指定されたtelの値

invalid_destination_title

指定されたtitleの値が不正です。30文字以内の文字列で指定してください。

param:指定されたtitleの値

invalid_destination_zip_code

指定されたzip_codeの値が不正です。有効な郵便番号を指定してください。

param:指定されたzip_codeの値

invalid_customer_examination_amount

指定されたamountの値が不正です。150,000,000円以下かつ現在適用中の与信額残高以上の金額を指定してください。

param:指定されたamountの値

invalid_customer_examination_amount_with_balance

指定されたamountの値が現在適用中の与信額残高以下になっています。150,000,000円以下かつ現在適用中の与信額残高よりも大きな金額を指定してください。

param:現在適用中の与信額残高balanceの値

invalid_customer_examination_business_description

指定されたbusiness_descriptionの値が不正です。500文字以下で指定してください。

param:指定されたbusiness_descriptionの値

invalid_customer_examination_business_type

指定されたbusiness_typeの値が不正です。個人事業主individual, 法人corporateのうちから指定してください。不明な場合は空で指定してください。

param:指定されたbusiness_typeの値

invalid_customer_examination_address1

指定されたaddress1の値が不正です。1~100文字の文字列で指定してください。

param:指定されたaddress1の値

invalid_customer_examination_address2

指定されたaddress1の値が不正です。100文字以内の文字列で指定してください。

param:指定されたaddress2の値

invalid_customer_examination_corporate_number

指定されたcorporate_numberの値が不正です。13文字の数字を文字列として指定してください。

param:指定されたcorporate_numberの値

invalid_customer_examination_email

指定されたemailの値が不正です。メールアドレス形式で指定してください。

param:指定されたemailの値

invalid_customer_examination_end_date

指定されたend_dateの値が不正です。利用可能な日付を指定してください。例:2019-04-30

param:有効な候補日のリスト

invalid_customer_examination_id

指定されたcustomer_examination_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたcustomer_examination_idの値

invalid_customer_examination_remark

指定されたremarkの値が不正です。500文字以内で指定してください。

param:指定されたremarkの値

invalid_customer_examination_representative_name

指定されたrepresentative_nameの値が不正です。30文字以内で指定してください。

param:指定されたrepresentative_nameの値

invalid_customer_examination_status

指定されたstatusの値が不正です。未審査unexamined, 審査通過passed, 審査否決rejectedのうちから指定してください。

param:指定されたstatusの値

invalid_customer_examination_tel

指定されたtelの値が不正です。有効な電話番号を指定してください。

param:指定されたtelの値

invalid_customer_examination_website

指定されたwebsiteの値が不正です。500文字以内で有効なURLを指定してください。

param:指定されたwebsiteの値

invalid_customer_examination_zip_code

指定されたzip_codeの値が不正です。有効な郵便番号を指定してください。

param:指定されたzip_codeの値

invalid_credit_facility_status

指定されたstatusの形式または値が不正です。expired,active,inactiveのから指定してください。

param:指定されたstatusの値

invalid_credit_facility_end_date_from

指定されたend_date_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたend_date_fromの値

invalid_credit_facility_end_date_to

指定されたend_date_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたend_date_toの値

invalid_credit_facility_id

指定されたcredit_facility_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたcredit_facility_idの値

invalid_credit_facility_start_date_from

指定されたstart_date_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたstart_date_fromの値

invalid_credit_facility_start_date_to

指定されたstart_date_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたstart_date_toの値

invalid_transaction_amount

指定されたamountの値が不正です。1~2,147,483,647円の間で指定してください。

param:指定されたamountの値

invalid_customer_name_update_name

指定されたnameの値が不正です。50字以内の文字列で指定してください。

param:指定されたnameの値

invalid_customer_name_update_reason

指定されたreasonの値が不正です。500文字以内の文字列で指定してください。

param:指定されたreasonの値

invalid_customer_name_update_under_examination

指定されたcustomer_idは顧客名変更申請中です。

param:指定されたcustomer_idの値

invalid_customer_name_update_id

指定されたcustomer_name_update_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたcustomer_name_update_idの値

invalid_customer_name_update_not_found

指定された顧客名変更申請がみつかりませんでした。

param:指定されたcustomer_name_update_idの値

invalid_customer_name_update_status

指定されたstatusの形式または値が不正です。unexamined,passed,rejectedから指定してください

param:指定されたstatusの値

invalid_invoice_id

指定されたinvoice_idの形式または値が不正です。例:GY9N-EWNM

param:指定されたinvoice_idの値

invalid_transaction_amounts_per_tax_rate_type

指定されたamounts_per_tax_rate_typeの値が不正です。

param:指定されたamounts_per_tax_rate_typeの値

invalid_transaction_billing

指定されたbillingの値が不正です。請求対象true, 請求対象外falseのいずれかで指定してください。

param:指定されたbillingの値

invalid_transaction_billing_condition

指定されたbilling_conditionの値が不正です。審査結果に関わらずすべて請求するall、審査通過の取引のみ請求するpassedのいずれかで指定してください。

param:指定されたbilling_conditionの値

invalid_transaction_details

指定されたdetailsの値が不正です。

param:-

invalid_transaction_details_amount_total

取引明細の小計を合計した値が1未満です。

param:-

invalid_transaction_detail_amount

指定されたamountの値が不正です。-2147483648~2147483647の間で小数点以下4桁以内の値を指定してください。また、単価×数量の値と一致するようにしてください。

param:指定されたamountの値

invalid_transaction_detail_description

指定されたdescriptionの値が不正です。1~250文字の文字列で指定してください。

param:指定されたdescriptionの値

invalid_transaction_detail_quantity

指定されたquantityの値が不正です。0~2147483647の間で小数点以下4桁以内の値を指定してください。

param:指定されたquantityの値

invalid_transaction_detail_tax_included_type

指定されたtax_included_typeの値が不正です。税込included, 税抜excludedのうちから指定してください。

param:指定されたtax_included_typeの値

invalid_transaction_detail_tax_rate_type

指定されたtax_rate_typeの値が不正です。非課税non_taxable、消費税8%normal_8、消費税10%normal_10、軽減税率8%reduced_8、経過措置8%transitional_measures_8、対象外inapplicableのうちいずれかを指定してください。

param:指定されたtax_rate_typeの値

invalid_transaction_detail_unit_price

指定されたunit_priceの値が不正です。-2147483648~2147483647の間で小数点以下4桁以内の値を指定してください。

param:指定されたunit_priceの値

invalid_transaction_date

指定されたdateの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたdateの値

invalid_transaction_date_from

指定されたdate_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたdate_fromの値

invalid_transaction_date_to

指定されたdate_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたdate_toの値

invalid_transaction_due_date

指定されたdue_dateの形式または値が不正です。日付形式で利用可能な日付を指定してください。例:2019-04-30

param:指定されたdue_dateの値

invalid_transaction_duplicate_invoice_delivery_method

指定されたinvoice_delivery_methodsで送付方法が重複しています。

param:重複している送付方法の値

invalid_transaction_invoice_delivery_methods

指定されたinvoice_delivery_methodsの値が不正です。

param:指定されたinvoice_delivery_methodsの値

invalid_transaction_issue_date

指定されたissue_dateの形式または値が不正です。日付形式で利用可能な日付を指定してください。例:2019-04-30

param:指定されたissue_dateの値

invalid_transaction_id

指定されたtransaction_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたtransaction_idの値

invalid_transaction_multiple_inheritable_options

authorization_id, canceled_transaction_idは同時に指定できません。

param:指定されたnumberの値

invalid_transaction_number

指定されたnumberの値が不正です。1~100文字の文字列で指定してください。また、他の取引と重複しないようにしてください。

param:指定されたnumberの値

invalid_transaction_status

指定されたstatusの値が不正です。審査中unexamined、審査通過passed、審査否決rejected、キャンセル済canceledのいずれかで指定してください。

param:指定されたstatusの値

not_cancelable_transaction_status

指定された取引はキャンセル不可の状態です。

param:指定されたtransaction_id

invalid_billing_due_date_from

指定されたdue_date_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたdue_date_fromの値

invalid_billing_due_date_to

指定されたdue_date_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたdue_date_toの値

invalid_billing_id

指定されたbilling_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたbilling_idの値

invalid_billing_issue_date_from

指定されたissue_date_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたissue_date_fromの値

invalid_billing_issue_date_to

指定されたissue_date_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたissue_date_toの値

invalid_billing_unpaid

指定されたunpaidの値が不正です。未入金ありtrue, 未入金なしfalseのいずれかで指定してください。

param:指定されたunpaidの値

invalid_billing_status

指定されたstatusの値が不正です。請求予定scheduled、請求書発行済invoice_issued 、口座振替通知済account_transfer_notifiedのいずれかで指定してください。

param:指定されたstatusの値

invalid_payout_date_from

指定されたpayout_date_fromの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたpayout_date_fromの値

invalid_payout_date_to

指定されたpayout_date_toの形式または値が不正です。日付形式で指定してください。例:2019-04-02

param:指定されたpayout_date_toの値

invalid_payout_id

指定されたpayout_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたpayout_idの値

invalid_payout_status

指定されたstatusの値が不正です。振込手続中in_progress、振込完了completedのいずれかで指定してください。

param:指定されたstatusの値

invalid_payout_transaction_id

指定されたpayout_transaction_idの形式または値が不正です。例:9R6M-VMAN

param:指定されたpayout_transaction_idの値

invalid_reissuing_billing_canceled

指定されたbilling_idがキャンセルされています。

param:指定されたbilling_idの値

invalid_reissuing_billing_not_issued

指定されたbilling_idは発行済みではありません。既に請求書もしくは口座振替通知書兼請求書が発行されている請求を指定してください。

param:指定されたbilling_idの値

invalid_reissuing_payload_customer_not_matched

指定されたdestination_idの値が不正です。指定されたbilling_idに紐づく顧客の請求先を指定してください。

param:指定されたdestination_idの値

invalid_reissuing_payload_destination_not_found

指定されたdestination_idの値が見つかりませんでした。

param:指定されたdestination_idの値

invalid_reissuing_payload_duplicated_invoice_delivery_methods

指定されたinvoice_delivery_methodsの値が重複して指定されています。郵送posting, メールemailのうちから重複せずに指定してください。

param:指定されたinvoice_delivery_methodsの値

invalid_reissuing_payload_invoice_delivery_methods

指定されたinvoice_delivery_methodsの形式または値が不正です。郵送posting, メールemailのうちから指定してください。

param:指定されたinvoice_delivery_methodsの値

invalid_reissuing_unavailable

指定されたbilling_idは発行中か再発行できない請求です。

param:指定されたbilling_idの値

ページネーション

Cursor Based Paginationについて

本APIのページング方式はCursorBasedを採用しています。

ページ番号やoffsetを指定する方式ではなく、起点となるCursorであるafter(本APIでは各ObjectのID)からlimitの件数だけ取得する方式です。

beforeは前ページの取得になります。afterbeforeのどちらも指定された場合、beforeが利用されます。

本APIではObjectの作成日時降順でObjectの一覧を返却しています。

ページネーションレスポンス

本APIではページネーションが発生するEndpointではlistObjectが返却されます。この場合のlistObjectには以下のobjectitemspaginationのPropertyが含まれます。 一部ページネーションが発生しないEndpointでもlistObjectが返却されますが、この場合のlistObjectには以下のobjectitemsのPropertyが含まれます。

ページネーションのあるEndpointのレスポンス

{
  "object": "list",
  "items": [
    {
      ...
    }
  ],
  "pagination": {
    "end": "7679-YW36",
    "has_next": true,
    "has_previous": true,
    "limit": 20,
    "start": "9R6M-VMAN",
    "total": 143
  }
}
項目名 内容
object Objectのタイプ識別子。ここでは必ずlistが入ります。各Objectには必ずこのAttributeがあります。
items 目的のObjectのリスト。array形式になっています。
pagination ページング情報が含まれるObjectです。

ページネーションObject

Pagination

ページ繰り

次ページ

次ページのリクエスト例

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customers?after=7679-YW36 \
  -H 'Accept: application/json' \
  -H 'apikey: [apikey]'

次のページを取得したい場合には、afterpagination.endの値を入れてリクエストします。

この時、afterで指定したObjectは次のページには含まれません。

また、pagination.has_nextfalseの場合に同じリクエストを行うと範囲外指定のエラー(out_of_range)が返却されます。

前ページ

前ページのリクエスト例

curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customers?before=9R6M-VMAN \
  -H 'Accept: application/json' \
  -H 'apikey: [apikey]'

逆に前ページを取得したい場合には、beforepagination.startの値を入れてリクエストします。

ステータス

Objectの中にはステータスを持つものがあります。各ステータスがどのように遷移するのかを説明します。

与信枠審査

与信枠審査ステータス

与信枠

与信枠ステータス

取引

取引ステータス

請求

請求ステータス

振込

振込ステータス

レートリミット

本APIではレートリミットを設定しています。 ある一定の頻度を超えてリクエストが行われた際には 単位時間あたりの利用回数を制限させていただく場合があります。

レートリミットを超えた場合には429 Too Many Requestsというエラーコードが返却されはじめます。 その際には利用頻度を抑えるようにしてください。 またこの時正しく処理は行われていないので、リトライするようにしてください。

Customer 顧客

Customer Object

Customer

{
  "created_at": "2019-04-01T10:36:43+09:00",
  "has_alert": false,
  "id": "7679-YW36",
  "name": "サンプル顧客",
  "number": "CUSTOEMR001",
  "object": "customer",
  "payment_method": {
    "bank_transfer": {
      "object": "bank_transfer",
      "account_number": "123456789",
      "bank_name": "MEKESSAI銀行",
      "branch_name": "大手町支店",
      "holder_name": "マネ-フオワ-ドケツサイ(カ",
      "type": "current"
    },
    "object": "payment_method"
  },
  "uri": "mfk:customer:7679-YW36"
}

顧客です。取引登録や与信枠取得などあらゆる機能を利用する起点となります。

Property

項目名 説明
created_at string(date-time) 顧客が登録された日時を示します。
has_alert boolean アラートの有無を示します。アラートがある場合はtrue、ない場合はfalseを返します。アラートがあると、自動で毎月付与されている与信枠が停止します。
id string 顧客IDです。 Money Forward Kessaiによって発番される一意の識別子です。
name string 顧客名です。
number string 顧客に付与できる任意の顧客番号です。自動で付与される顧客IDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理される顧客間で一意でなければなりません。
object string このObjectの種別を示します。ここでは必ずcustomerが入ります。
  • customer
  • payment_method PaymentMethod 顧客の支払方法です。口座振替(AccountTransfer)もしくは銀行振込(BankTransfer)のいずれかです。顧客の支払方法に応じたObjectが返却されます。 デフォルトでは銀行振込になっています。ただし、初回請求前には振込先口座が指定されていない場合があります。 口座振替に変更する場合には別途書面でのお手続きが必要であるため、サポートセンターへお問い合わせください。
    uri string 顧客URIです。すべてのリソースで一意の識別子として自動で付与されます。

    顧客一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customers \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customers', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customers', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customers", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers

    顧客の一覧を取得することができます。顧客番号や支払方法、未入金の有無で絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    number string 任意の顧客の numberを指定します。該当する顧客がいる場合、その一件のみが返却されます。
    ids array[string] 任意の顧客の id を指定します。最大で200件まで指定できます。 複数指定する場合は?ids=ABCD-XXXX&ids=ABCD-YYYYのように指定してください。
    payment_method array[string] 支払方法を指定します。該当する支払方法の顧客が返却されます。指定できる値は bank_transfer(銀行振込), account_transfer(口座振替)の2種類のみです。支払方法は複数指定することができます。 複数指定する場合は?payment_method=bank_transfer&payment_method=account_transferのように指定してください。
    値は以下のうちの一つになります。
    • bank_transfer
    • account_transfer
    has_alert boolean アラートの有無をboolean値で指定します。trueの場合アラート有り、falseの場合はアラート無しを表します。
    created_at_from string(date-time) 指定された日時以降に作成された顧客を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成された顧客を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "created_at": "2019-04-01T10:36:43+09:00",
          "has_alert": false,
          "id": "7679-YW36",
          "name": "サンプル顧客",
          "number": "CUSTOEMR001",
          "object": "customer",
          "payment_method": {
            "bank_transfer": {
              "object": "bank_transfer",
              "account_number": "123456789",
              "bank_name": "MEKESSAI銀行",
              "branch_name": "大手町支店",
              "holder_name": "マネ-フオワ-ドケツサイ(カ",
              "type": "current"
            },
            "object": "payment_method"
          },
          "uri": "mfk:customer:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 顧客一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Customer] 条件に該当する顧客の一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    顧客登録

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customers \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers', params={
    
    }, json={
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers

    顧客を登録することができます。顧客には必ず一つの請求先が必要であるため同時に請求先一件も登録します。

    Body parameter

    {
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }
    

    BodyParameters

    項目名 説明
    body
    required
    CustomerPayload 顧客登録情報です。請求先情報も含まれています。

    レスポンス例

    200 Response

    {
      "customer": {
        "created_at": "2019-04-01T10:36:43+09:00",
        "has_alert": false,
        "id": "7679-YW36",
        "name": "サンプル顧客",
        "number": "CUSTOEMR001",
        "object": "customer",
        "payment_method": {
          "bank_transfer": {
            "object": "bank_transfer",
            "account_number": "123456789",
            "bank_name": "MEKESSAI銀行",
            "branch_name": "大手町支店",
            "holder_name": "マネ-フオワ-ドケツサイ(カ",
            "type": "current"
          },
          "object": "payment_method"
        },
        "uri": "mfk:customer:7679-YW36"
      },
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "created_at": "2019-04-01T10:36:43+09:00",
        "customer_id": "7679-YW36",
        "department": "経理部",
        "email": "[email protected]",
        "id": "WNAV-37R6",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "object": "destination",
        "tel": "03-1234-5678",
        "title": "部長",
        "uri": "mfk:destination:WNAV-37R6",
        "zip_code": "111-1111"
      }
    }
    

    Responses

    ステータス 説明
    200 作成された顧客が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    409 登録しようとした顧客と一致する顧客が既に登録されている場合のエラーです。指定したnumberや、その他住所・電話番号などが既に登録済みでないか確認してください。

    Status Code 200

    項目名 説明
    customer Customer 顧客です。取引登録や与信枠取得などあらゆる機能を利用する起点となります。
    destination Destination 請求先です。一つの顧客に対して複数作成することができます。請求先の情報を利用して請求書送付を行います。
    請求書の印字との対照についてはサポートページを確認してください。

    顧客取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers/{customer_id}

    顧客IDを指定して対象顧客1件を取得することができます。

    PathParameters

    項目名 説明
    customer_id
    required
    string 対象の顧客IDを指定してください。

    レスポンス例

    200 Response

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "has_alert": false,
      "id": "7679-YW36",
      "name": "サンプル顧客",
      "number": "CUSTOEMR001",
      "object": "customer",
      "payment_method": {
        "bank_transfer": {
          "object": "bank_transfer",
          "account_number": "123456789",
          "bank_name": "MEKESSAI銀行",
          "branch_name": "大手町支店",
          "holder_name": "マネ-フオワ-ドケツサイ(カ",
          "type": "current"
        },
        "object": "payment_method"
      },
      "uri": "mfk:customer:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 指定した顧客が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。

    Status Code 200

    項目名 説明
    created_at string(date-time) 顧客が登録された日時を示します。
    has_alert boolean アラートの有無を示します。アラートがある場合はtrue、ない場合はfalseを返します。アラートがあると、自動で毎月付与されている与信枠が停止します。
    id string 顧客IDです。 Money Forward Kessaiによって発番される一意の識別子です。
    name string 顧客名です。
    number string 顧客に付与できる任意の顧客番号です。自動で付与される顧客IDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理される顧客間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずcustomerが入ります。
    payment_method PaymentMethod 顧客の支払方法です。口座振替(AccountTransfer)もしくは銀行振込(BankTransfer)のいずれかです。顧客の支払方法に応じたObjectが返却されます。 デフォルトでは銀行振込になっています。ただし、初回請求前には振込先口座が指定されていない場合があります。 口座振替に変更する場合には別途書面でのお手続きが必要であるため、サポートセンターへお問い合わせください。
    uri string 顧客URIです。すべてのリソースで一意の識別子として自動で付与されます。

    顧客更新

    コードサンプル

    curl -X PATCH https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "number": "CUSTOMER0001"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "number": "CUSTOMER0001"
    }';
    
    try {
        $response = $client->request('PATCH','https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Patch.new(uri, headers)
    req.body='{
      "number": "CUSTOMER0001"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.patch('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}', params={
    
    }, json={
      "number": "CUSTOMER0001"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "number": "CUSTOMER0001"
    }`})
        req, err := http.NewRequest("PATCH", "https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "number": "CUSTOMER0001"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}',
    {
      method: 'PATCH',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers/{customer_id}

    顧客の情報を更新することができます。

    Body parameter

    {
      "number": "CUSTOMER0001"
    }
    

    PathParameters

    項目名 説明
    customer_id
    required
    string 対象の顧客IDを指定してください。

    BodyParameters

    項目名 説明
    body
    required
    CustomerUpdatePayload 顧客更新情報です。

    レスポンス例

    200 Response

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "has_alert": false,
      "id": "7679-YW36",
      "name": "サンプル顧客",
      "number": "CUSTOEMR001",
      "object": "customer",
      "payment_method": {
        "bank_transfer": {
          "object": "bank_transfer",
          "account_number": "123456789",
          "bank_name": "MEKESSAI銀行",
          "branch_name": "大手町支店",
          "holder_name": "マネ-フオワ-ドケツサイ(カ",
          "type": "current"
        },
        "object": "payment_method"
      },
      "uri": "mfk:customer:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 更新した顧客が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。

    Status Code 200

    項目名 説明
    created_at string(date-time) 顧客が登録された日時を示します。
    has_alert boolean アラートの有無を示します。アラートがある場合はtrue、ない場合はfalseを返します。アラートがあると、自動で毎月付与されている与信枠が停止します。
    id string 顧客IDです。 Money Forward Kessaiによって発番される一意の識別子です。
    name string 顧客名です。
    number string 顧客に付与できる任意の顧客番号です。自動で付与される顧客IDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理される顧客間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずcustomerが入ります。
    payment_method PaymentMethod 顧客の支払方法です。口座振替(AccountTransfer)もしくは銀行振込(BankTransfer)のいずれかです。顧客の支払方法に応じたObjectが返却されます。 デフォルトでは銀行振込になっています。ただし、初回請求前には振込先口座が指定されていない場合があります。 口座振替に変更する場合には別途書面でのお手続きが必要であるため、サポートセンターへお問い合わせください。
    uri string 顧客URIです。すべてのリソースで一意の識別子として自動で付与されます。

    振込先口座割り当て

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/bank_transfer',
    {
      method: 'POST',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers/{customer_id}/bank_transfer

    対象顧客1件に振込先口座番号を未割り当ての場合、割り当てます。

    PathParameters

    項目名 説明
    customer_id
    required
    string 対象の顧客IDを指定してください。

    レスポンス例

    200 Response

    {
      "account_number": "12345678",
      "bank_code": "0001",
      "bank_name": "MFKESSSAI銀行",
      "bank_name_kana": "エムエフケツサイ",
      "branch_code": "001",
      "branch_name": "大手町支店",
      "branch_name_kana": "オオテマチ",
      "object": "bank_transfer",
      "type": "current",
      "holder_name": "マネ-フオワ-ドケツサイ(カ"
    }
    

    Responses

    ステータス 説明
    200 割り当てられた振込先口座情報が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 振込先口座を割り当てようとした顧客がすでに割り当て済みの場合のエラーです。

    Status Code 200

    項目名 説明
    account_number string 振込先口座番号です。未割当の場合は空で返却されます。
    bank_code string 振込先銀行コードです。未割当の場合は空で返却されます。
    bank_name string 振込先銀行名です。未割当の場合は空で返却されます。
    bank_name_kana string 振込先銀行名フリガナです。未割当の場合は空で返却されます。
    branch_code string 振込先銀行支店コードです。未割当の場合は空で返却されます。
    branch_name string 振込先銀行支店名です。未割当の場合は空で返却されます。
    branch_name_kana string 振込先銀行支店名フリガナです。未割当の場合は空で返却されます。
    object string このObjectの種別を示します。ここでは必ずbank_transferが入ります。
    type string 振込先口座種別です。current(当座)、saving(普通)の2種類のうちどちらかになります。未割当の場合は空で返却されます。
    値は以下のうちの一つになります。
    • current
    • saving
    holder_name string 振込先口座名義です。必ずマネ-フオワ-ドケツサイ(カになります。未割当の場合は空で返却されます。

    口座振替依頼申請

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request', params={
    
    }, json={
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customers/{customer_id}/account_transfer_request',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customers/{customer_id}/account_transfer_request

    顧客IDを指定して、口座振替依頼を申請することができます。弊社から顧客に口座振替依頼に必要な書類を送付 (無料) します。

    Body parameter

    {
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }
    

    PathParameters

    項目名 説明
    customer_id
    required
    string 対象の顧客IDを指定してください。

    BodyParameters

    項目名 説明
    body
    required
    AccountTransferRequestPayload 口座振替依頼申請に用いる送付先情報です。

    レスポンス例

    200 Response

    {
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "email": "[email protected]",
      "tel": "03-1234-5678",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "object": "account_transfer_request"
    }
    

    Responses

    ステータス 説明
    200 登録された口座振替申請情報が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 指定した顧客IDで、前回の口座振替依頼の申請から1時間以上時間が経っていない場合のエラーです。
    412 口座振替依頼の申請が現在利用できない場合のエラーです。

    Status Code 200

    項目名 説明
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    email Email メールアドレスです。email形式で指定してください。
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    department string 担当者の部署名です。
    title string 担当者の役職です。
    name string 担当者名です。
    object string このObjectの種別を示します。ここでは必ずaccount_transfer_requestが入ります。

    Destination 請求先

    Destination Object

    Destination

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
    
    

    請求先です。一つの顧客に対して複数作成することができます。請求先の情報を利用して請求書送付を行います。
    請求書の印字との対照についてはサポートページを確認してください。

    Property

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email] CCメールアドレスです。最大4件まで登録できます。
    created_at string(date-time) 請求先が登録された日時を示します。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    department string 担当者の部署名です。
    email Email メールアドレスです。email形式で指定してください。
    id string 請求先IDです。一意の識別子として自動で付与されます。
    name string 担当者名です。
    name_kana string 担当者名カナです。全角カタカナで入力してください。
    object string このObjectの種別を示します。ここでは必ずdestinationが入ります。
  • destination
  • tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string 担当者の役職です。
    uri string 請求先URIです。すべてのリソースで一意の識別子として自動で付与されます。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    請求先一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/destinations \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/destinations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/destinations")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/destinations', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/destinations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/destinations',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /destinations

    請求先の一覧を取得します。顧客IDや顧客番号で特定の顧客に紐づく請求先に絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    customer_id string 顧客IDを指定します。指定された顧客の請求先を取得します。customer_numberに別の顧客の顧客番号を指定した場合には該当請求先は0件になります。
    customer_number string 顧客番号を指定します。指定された顧客の請求先を取得します。customer_idに別の顧客の顧客IDを指定した場合には該当請求先は0件になります。
    created_at_from string(date-time) 指定された日時以降に作成された請求先を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成された請求先を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "address1": "東京都千代田区1-2-3",
          "address2": "サンプルビル3F",
          "cc_emails": [
            "[email protected]",
            "[email protected]"
          ],
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "7679-YW36",
          "department": "経理部",
          "email": "[email protected]",
          "id": "WNAV-37R6",
          "name": "担当 太郎",
          "name_kana": "タントウ タロウ",
          "object": "destination",
          "tel": "03-1234-5678",
          "title": "部長",
          "uri": "mfk:destination:WNAV-37R6",
          "zip_code": "111-1111"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 請求先一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Destination] 請求先一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    請求先登録

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/destinations \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/destinations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/destinations")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/destinations', params={
    
    }, json={
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/destinations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/destinations',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /destinations

    顧客を指定して請求先を登録することができます。

    Body parameter

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }
    

    BodyParameters

    項目名 説明
    body
    required
    DestinationPayload 請求先登録情報です。

    レスポンス例

    200 Response

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
    

    Responses

    ステータス 説明
    200 登録した請求先が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 登録しようとした請求先と一致する請求先が既に登録されている場合のエラーです。住所・電話番号などが既に登録済みでないか確認してください。Errorのparamには登録済みの請求先IDが入ります。

    Status Code 200

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email] CCメールアドレスです。最大4件まで登録できます。
    created_at string(date-time) 請求先が登録された日時を示します。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    department string 担当者の部署名です。
    email Email メールアドレスです。email形式で指定してください。
    id string 請求先IDです。一意の識別子として自動で付与されます。
    name string 担当者名です。
    name_kana string 担当者名カナです。全角カタカナで入力してください。
    object string このObjectの種別を示します。ここでは必ずdestinationが入ります。
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string 担当者の役職です。
    uri string 請求先URIです。すべてのリソースで一意の識別子として自動で付与されます。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    請求先取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /destinations/{destination_id}

    請求先IDを指定して対象請求先1件を取得することができます。

    PathParameters

    項目名 説明
    destination_id
    required
    string 対象の請求先IDを指定してください。

    レスポンス例

    200 Response

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
    

    Responses

    ステータス 説明
    200 指定した請求先が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求先IDで指定した請求先が存在しない場合のエラーです。Errorのparamには指定した請求先IDが入ります。

    Status Code 200

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email] CCメールアドレスです。最大4件まで登録できます。
    created_at string(date-time) 請求先が登録された日時を示します。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    department string 担当者の部署名です。
    email Email メールアドレスです。email形式で指定してください。
    id string 請求先IDです。一意の識別子として自動で付与されます。
    name string 担当者名です。
    name_kana string 担当者名カナです。全角カタカナで入力してください。
    object string このObjectの種別を示します。ここでは必ずdestinationが入ります。
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string 担当者の役職です。
    uri string 請求先URIです。すべてのリソースで一意の識別子として自動で付与されます。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    請求先更新

    コードサンプル

    curl -X PUT https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id} \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }';
    
    try {
        $response = $client->request('PUT','https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Put.new(uri, headers)
    req.body='{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.put('https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}', params={
    
    }, json={
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`})
        req, err := http.NewRequest("PUT", "https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/destinations/{destination_id}',
    {
      method: 'PUT',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /destinations/{destination_id}

    請求先の情報を更新することができます。

    Body parameter

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }
    

    PathParameters

    項目名 説明
    destination_id
    required
    string 対象の請求先IDを指定してください。

    BodyParameters

    項目名 説明
    body
    required
    DestinationUpdatePayload 請求先更新情報です。

    レスポンス例

    200 Response

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
    

    Responses

    ステータス 説明
    200 更新した請求先が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求先IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した請求先IDが入ります。
    409 更新しようとした請求先と一致する請求先が既に登録されている場合のエラーです。住所・電話番号などが既に登録済みでないか確認してください。Errorのparamには登録済みの請求先IDが入ります。

    Status Code 200

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email] CCメールアドレスです。最大4件まで登録できます。
    created_at string(date-time) 請求先が登録された日時を示します。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    department string 担当者の部署名です。
    email Email メールアドレスです。email形式で指定してください。
    id string 請求先IDです。一意の識別子として自動で付与されます。
    name string 担当者名です。
    name_kana string 担当者名カナです。全角カタカナで入力してください。
    object string このObjectの種別を示します。ここでは必ずdestinationが入ります。
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string 担当者の役職です。
    uri string 請求先URIです。すべてのリソースで一意の識別子として自動で付与されます。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    CustomerExamination 与信枠審査

    CustomerExamination Object

    CustomerExamination

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-02-18T10:20:34+09:00",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "id": "WNAV-37R6",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-04-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "type": "auto",
      "uri": "mfk:customer_examination:WNAV-37R6",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    
    

    与信枠審査です。顧客に対する与信枠取得のために利用します。申請後2営業日以内に審査いたします。 自動与信枠審査を利用している場合は顧客登録と同時に与信枠審査も申請されます。

    Property

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    amount integer 希望与信額です。審査通過の場合に付与される与信枠の希望金額になります。審査の結果減額されて与信枠付与されることもあります。
    business_description string 事業内容です。顧客の主なサービス、商材などです。
    business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定されます。不明な場合は空になります。
    値は以下のうちの一つになります。
    • corporate
    • individual
    corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ利用されます。
    created_at string(date-time) 与信枠審査の申請日時です。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    email Email メールアドレスです。email形式で指定してください。
    end_date string(date) 希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠審査IDです。一意の識別子として自動で付与されます。
    remark string その他情報です。審査に利用できる情報を記載できます。
    representative_name string 代表者名です。
    start_date string(date) 希望取引登録期間開始日。この日付から対象の与信枠を利用して取引登録ができます。 手動での申請の場合、審査通過日となるため空で返却されます。自動与信枠審査による申請の場合は、月次での与信枠付与になり対象月の月初日となります。
    status string 与信枠審査ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)があります。審査通過の場合には与信枠が付与されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    type string 申請理由の種別です。手動(manual)、自動(auto)、回復(recovery)があります。手動(manual)には増枠申請と手動回復審査申請が含まれます。
    値は以下のうちの一つになります。
    • manual
    • auto
    • recovery
    object string このObjectの種別を示します。ここでは必ずcustomer_examinationが入ります。
  • customer_examination
  • uri string 与信枠審査URIです。すべてのリソースで一意の識別子として自動で付与されます。
    website string 顧客企業のwebサイトです。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    与信枠審査一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_examinations \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_examinations

    与信枠審査の一覧を取得します。顧客IDやステータスで絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    customer_id string 顧客IDを指定します。指定された顧客に対する与信枠審査を取得します。
    customer_number string 顧客番号を指定します。
    status string 与信枠審査のステータスを指定します。未審査(unexamined)、審査通過(passed)、審査否決(rejected)のいずれかを指定してください。
    値は以下のうちの一つになります。
    • passed
    • rejected
    • unexamined
    created_at_from string(date-time) 指定された日時以降に作成された与信枠審査を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成された与信枠審査を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "address1": "東京都千代田区1-2-3",
          "address2": "サンプルビル3F",
          "amount": 20000,
          "business_description": "クラウド型企業間決済サービス",
          "business_type": "corporate",
          "corporate_number": "1234567890123",
          "created_at": "2019-02-18T10:20:34+09:00",
          "customer_id": "7679-YW36",
          "email": "[email protected]",
          "end_date": "2019-04-30",
          "id": "WNAV-37R6",
          "remark": "一部上場企業です。",
          "representative_name": "代表太郎",
          "start_date": "2019-04-01",
          "status": "passed",
          "tel": "03-1234-5678",
          "type": "auto",
          "uri": "mfk:customer_examination:WNAV-37R6",
          "website": "https://mfkessai.co.jp",
          "zip_code": "111-1111"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 与信枠審査一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [CustomerExamination] 与信枠審査一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    与信枠審査申請

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customer_examinations \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations', params={
    
    }, json={
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_examinations

    顧客を指定して与信枠審査を申請することができます。最長で申請後2営業日以内に審査いたします。
    自動与信枠審査をご利用の場合、こちらで増枠した金額は今後の与信枠付与に継続して利用されます。また、対象顧客のアラートは解消されます。
    Sandbox環境では動作テストのため、任意の審査結果を指定することができます。審査結果の操作を参照してください。

    Body parameter

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    

    BodyParameters

    項目名 説明
    body
    required
    CustomerExaminationPayload 与信枠審査申請情報です。

    レスポンス例

    200 Response

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-02-18T10:20:34+09:00",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "id": "WNAV-37R6",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-04-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "type": "auto",
      "uri": "mfk:customer_examination:WNAV-37R6",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    

    Responses

    ステータス 説明
    200 登録した与信枠審査が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 審査中の与信枠審査が存在している場合のエラーです。審査中は与信枠審査を登録できません。

    Status Code 200

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    amount integer 希望与信額です。審査通過の場合に付与される与信枠の希望金額になります。審査の結果減額されて与信枠付与されることもあります。
    business_description string 事業内容です。顧客の主なサービス、商材などです。
    business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定されます。不明な場合は空になります。
    値は以下のうちの一つになります。
    • corporate
    • individual
    corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ利用されます。
    created_at string(date-time) 与信枠審査の申請日時です。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    email Email メールアドレスです。email形式で指定してください。
    end_date string(date) 希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠審査IDです。一意の識別子として自動で付与されます。
    remark string その他情報です。審査に利用できる情報を記載できます。
    representative_name string 代表者名です。
    start_date string(date) 希望取引登録期間開始日。この日付から対象の与信枠を利用して取引登録ができます。 手動での申請の場合、審査通過日となるため空で返却されます。自動与信枠審査による申請の場合は、月次での与信枠付与になり対象月の月初日となります。
    status string 与信枠審査ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)があります。審査通過の場合には与信枠が付与されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    type string 申請理由の種別です。手動(manual)、自動(auto)、回復(recovery)があります。手動(manual)には増枠申請と手動回復審査申請が含まれます。
    値は以下のうちの一つになります。
    • manual
    • auto
    • recovery
    object string このObjectの種別を示します。ここでは必ずcustomer_examinationが入ります。
    uri string 与信枠審査URIです。すべてのリソースで一意の識別子として自動で付与されます。
    website string 顧客企業のwebサイトです。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    与信枠審査取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_examinations/{customer_examination_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_examinations/{customer_examination_id}

    与信枠審査IDを指定して対象与信枠審査1件を取得することができます。

    PathParameters

    項目名 説明
    customer_examination_id
    required
    string 対象の与信枠審査IDを指定してください。

    レスポンス例

    200 Response

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-02-18T10:20:34+09:00",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "id": "WNAV-37R6",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-04-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "type": "auto",
      "uri": "mfk:customer_examination:WNAV-37R6",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    

    Responses

    ステータス 説明
    200 指定した与信枠審査が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 与信枠審査IDで指定した与信枠審査が存在しない場合のエラーです。Errorのparamには指定した与信枠審査IDが入ります。

    Status Code 200

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    amount integer 希望与信額です。審査通過の場合に付与される与信枠の希望金額になります。審査の結果減額されて与信枠付与されることもあります。
    business_description string 事業内容です。顧客の主なサービス、商材などです。
    business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定されます。不明な場合は空になります。
    値は以下のうちの一つになります。
    • corporate
    • individual
    corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ利用されます。
    created_at string(date-time) 与信枠審査の申請日時です。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    email Email メールアドレスです。email形式で指定してください。
    end_date string(date) 希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠審査IDです。一意の識別子として自動で付与されます。
    remark string その他情報です。審査に利用できる情報を記載できます。
    representative_name string 代表者名です。
    start_date string(date) 希望取引登録期間開始日。この日付から対象の与信枠を利用して取引登録ができます。 手動での申請の場合、審査通過日となるため空で返却されます。自動与信枠審査による申請の場合は、月次での与信枠付与になり対象月の月初日となります。
    status string 与信枠審査ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)があります。審査通過の場合には与信枠が付与されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    type string 申請理由の種別です。手動(manual)、自動(auto)、回復(recovery)があります。手動(manual)には増枠申請と手動回復審査申請が含まれます。
    値は以下のうちの一つになります。
    • manual
    • auto
    • recovery
    object string このObjectの種別を示します。ここでは必ずcustomer_examinationが入ります。
    uri string 与信枠審査URIです。すべてのリソースで一意の識別子として自動で付与されます。
    website string 顧客企業のwebサイトです。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    CreditFacility 与信枠

    CreditFacility Object

    CreditFacility

    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "WNAV-37R6",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-04-01",
      "status": "inactive",
      "uri": "mfk:credit_facility:7679-YW36"
    }
    
    

    顧客の与信枠です。この枠内の取引登録であれば取引審査なしで登録することができます。

    Property

    項目名 説明
    amount integer 与信額です。取引登録期間(start_date~end_date)にこの金額までの取引であれば取引審査なしで登録することができます。
    balance integer 与信額残高です。与信額からこの与信枠を利用して登録された取引の合計金額を差し引いた金額です。現在与信枠を利用して登録できる取引金額を示しています。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    customer_examination_id string 与信枠審査IDです。
    end_date string(date) 取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずcredit_facilityが入ります。
  • credit_facility
  • start_date string(date) 取引登録期間開始日です。この日付から対象の与信枠を利用して取引登録ができます。
    status string 与信枠ステータスです。未適用(inactive)、適用中(active)、期限切れ(expired)があります。 現在の日付がstart_date~end_dateの期間内であればactivestart_dateよりも前であればinactiveend_dateを過ぎていればexpiredになります。
    値は以下のうちの一つになります。
    • inactive
    • active
    • expired
    uri string 与信枠URIです。すべてのリソースで一意の識別子として自動で付与されます。

    与信枠一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/credit_facilities \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /credit_facilities

    与信枠の一覧を取得します。顧客IDや取引登録期間開始日・終了日で絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    customer_id string 顧客IDを指定します。指定された顧客の与信枠を取得します。
    customer_number string 顧客番号を指定します。 指定された顧客の与信枠を取得します。
    customer_examination_id string 与信枠審査IDを指定します。指定された与信枠審査によって付与された与信枠を取得します。
    status array[string] ステータスを指定します。該当するステータスの与信枠が返却されます。指定できる値は expired(期限切れ), active(適用中), inactive(未適用), の3種類のみです。ステータスは複数指定することができます。 複数指定する場合は?status=expired&status=activeもしくは?status=expired,activeのように指定してください。
    値は以下のうちの一つになります。
    • expired
    • active
    • inactive
    start_date_from string(date) 取引登録期間開始日が指定された日時よりも後の与信枠を取得します。指定された日時のものも含まれます。 RFC3339のfull-time(2019-04-01)で指定してください。
    start_date_to string(date) 取引登録期間開始日が指定された日時よりも前の与信枠を取得します。指定された日時のものも含まれます。 RFC3339のfull-time(2019-04-01)で指定してください。
    end_date_from string(date) 取引登録期間終了日が指定された日時よりも後の与信枠を取得します。指定された日時のものも含まれます。 RFC3339のfull-time(2019-04-01)で指定してください。
    end_date_to string(date) 取引登録期間終了日が指定された日時よりも前の与信枠を取得します。指定された日時のものも含まれます。 RFC3339のfull-time(2019-04-01)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "amount": 200000,
          "balance": 100000,
          "customer_examination_id": "WNAV-37R6",
          "customer_id": "9R6M-VMAN",
          "end_date": "2019-04-30",
          "id": "7679-YW36",
          "start_date": "2019-04-01",
          "status": "inactive",
          "uri": "mfk:credit_facility:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 与信枠一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [CreditFacility] 与信枠一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    与信枠取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/credit_facilities/{credit_facility_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /credit_facilities/{credit_facility_id}

    与信枠IDを指定して対象与信枠1件を取得することができます。

    PathParameters

    項目名 説明
    credit_facility_id
    required
    string 対象の与信枠IDを指定してください。

    レスポンス例

    200 Response

    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "WNAV-37R6",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-04-01",
      "status": "inactive",
      "uri": "mfk:credit_facility:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 指定した与信枠が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 与信枠IDで指定した与信枠が存在しない場合のエラーです。Errorのparamには指定した与信枠IDが入ります。

    Status Code 200

    項目名 説明
    amount integer 与信額です。取引登録期間(start_date~end_date)にこの金額までの取引であれば取引審査なしで登録することができます。
    balance integer 与信額残高です。与信額からこの与信枠を利用して登録された取引の合計金額を差し引いた金額です。現在与信枠を利用して登録できる取引金額を示しています。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    customer_examination_id string 与信枠審査IDです。
    end_date string(date) 取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずcredit_facilityが入ります。
    start_date string(date) 取引登録期間開始日です。この日付から対象の与信枠を利用して取引登録ができます。
    status string 与信枠ステータスです。未適用(inactive)、適用中(active)、期限切れ(expired)があります。 現在の日付がstart_date~end_dateの期間内であればactivestart_dateよりも前であればinactiveend_dateを過ぎていればexpiredになります。
    値は以下のうちの一つになります。
    • inactive
    • active
    • expired
    uri string 与信枠URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Transaction 取引

    Transaction Object

    Transaction

    {
      "accepted_at": "2019-04-03T10:36:43+09:00",
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "billing": true,
      "billing_accepted_at": "2019-04-22T10:36:43+09:00",
      "billing_condition": "passed",
      "billing_id": "9R6M-VMAN",
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "9PNG-VYR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "id": "7679-YW36",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "object": "transaction",
      "status": "passed",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": -1,
          "unit_price": 1000
        }
      ],
      "uri": "mfk:transaction:7679-YW36"
    }
    
    

    取引です。

    Property

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 取引金額です。税込金額になります。
    請求モードの設定によって値が変わります。
    - 区分記載請求書モード:TransactionPayload.amountで指定した金額
    - インボイスモード(請求単位):弊社システムにて算出した金額
    - インボイスモード(取引単位):TransactionPayload.amountで指定した金額
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    請求モードの設定によって値が変わります。各税率種別の取引明細行の小計を合計した値の税込金額になっています。
    - 区分記載請求書モード:TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    - インボイスモード(請求単位):空の配列
    - インボイスモード(取引単位):TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    billing boolean 請求対象であるかをboolean値で表します。trueの場合請求対象で、falseの場合は請求対象ではないことを表します。
    billing_accepted_at string(date-time) 請求依頼受領日時です。請求対象になった日時を表します。請求対象でない場合は空になります。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    billing_id string 請求IDです。請求書にまとめられる単位のIDです。同じ請求IDを持つ取引とまとめられて請求書に記載されます。
    canceled_at string(date-time) 取引がキャンセルされた日時です。未キャンセルの場合は空になります。
    canceled_transaction_id string 先行してキャンセルし与信に利用したキャンセル済み取引のIDです。キャンセル取引を利用していない場合は空になります。
    created_at string(date-time) 取引が登録された日時です。
    customer_id string 顧客IDです。
    destination_id string 請求先IDです。取引の請求先を示します。
    date string(date) 取引日です。売り手様と顧客様の間で取引を行った日付です。
    due_date string(date) 支払期限です。この日付を超えてMoney Forward Kessaiへの入金が確認できない場合は未入金になります。
    id string 取引IDです。一意の識別子として自動で付与されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date string(date) 請求書発行日です。請求書発送日については請求書発行日についてを参照ください。
    number string 取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    object string このObjectの種別を示します。ここでは必ずtransactionが入ります。
  • transaction
  • status string 取引ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済(canceled)があります。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    transaction_details [TransactionDetail] 取引明細行です。
    uri string 取引URIです。すべてのリソースで一意の識別子として自動で付与されます。

    取引一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/transactions \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/transactions', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /transactions

    QueryParameters

    項目名 説明
    number string 任意の取引の numberを指定します。該当する取引がある場合、その一件のみが返却されます。
    customer_id string 任意の顧客IDを指定します。指定した顧客に対する取引が返却されます。
    customer_number string 顧客番号を指定します。指定された顧客の取引を取得します。
    billing_id string 任意の請求IDを指定します。指定した請求に含まれる取引が返却されます。
    status string 取引のステータスを指定します。未審査(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済み(canceled)のいずれかを指定してください。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    billing boolean 請求対象であるかどうかを指定します。請求対象(true)、請求対象外(false)のいずれかを指定してください。 詳しくは請求対象とはを参照してください。
    date_from string(date) 取引日が指定された日付以降の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339のfull-time(2019-04-01)で指定してください。
    date_to string(date) 取引日が指定された日付以前の取引を取得します。指定された日付が取引日のものも含まれます。 RFC3339のfull-time(2019-04-01`)で指定してください。
    created_at_from string(date-time) 指定された日時以降に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成された取引を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    canceled_at_from string(date-time) 指定された日時以降にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    canceled_at_to string(date-time) 指定された日時以前にキャンセルされた取引を取得します。指定された日時にキャンセルされたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    accepted_at_from string(date-time) 指定された日時以降に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    accepted_at_to string(date-time) 指定された日時以前に債権譲受された取引を取得します。指定された日時に債権譲受されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    billing_accepted_at_from string(date-time) 指定された日時以降に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    billing_accepted_at_to string(date-time) 指定された日時以前に請求依頼を受領した取引を取得します。指定された日時に請求依頼を受領したものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    amount_from integer 指定された金額以上の取引を取得します。
    amount_to integer 指定された金額未満の取引を取得します。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "accepted_at": "2019-04-03T10:36:43+09:00",
          "amount": 5440,
          "amounts_per_tax_rate_type": [
            {
              "amount": 2200,
              "tax_rate_type": "normal_10"
            },
            {
              "amount": 3240,
              "tax_rate_type": "reduced_8"
            }
          ],
          "billing": true,
          "billing_accepted_at": "2019-04-22T10:36:43+09:00",
          "billing_condition": "passed",
          "billing_id": "9R6M-VMAN",
          "canceled_at": "2019-04-22T10:36:43+09:00",
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "9PNG-VYR6",
          "date": "2019-04-10",
          "destination_id": "WNAV-37R6",
          "due_date": "2019-04-30",
          "id": "7679-YW36",
          "invoice_delivery_method": [
            "posting",
            "email"
          ],
          "issue_date": "2019-04-20",
          "number": "Transaction-0001",
          "object": "transaction",
          "status": "passed",
          "transaction_details": [
            {
              "amount": 3000,
              "description": "商品名A",
              "tax_included_type": "excluded",
              "tax_rate_type": "normal_10",
              "quantity": 3,
              "unit_price": 1000
            },
            {
              "amount": 3000,
              "description": "商品名B",
              "tax_included_type": "excluded",
              "tax_rate_type": "reduced_8",
              "quantity": 3,
              "unit_price": 1000
            },
            {
              "amount": -1000,
              "description": "商品名A 返品",
              "tax_included_type": "excluded",
              "tax_rate_type": "normal_10",
              "quantity": -1,
              "unit_price": 1000
            }
          ],
          "uri": "mfk:transaction:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 取引一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Transaction] 取引一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    取引登録

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/transactions \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/transactions', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/transactions', params={
    
    }, json={
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/transactions", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /transactions

    請求先を指定して取引を登録できます。最長で申請後2営業日以内に審査いたします。
    取引登録時の制約事項についてはサポートページを確認してください。
    Sandbox環境では動作テストのため、任意の審査結果を指定することができます。審査結果の操作を参照してください。

    Body parameter

    {
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }
    

    BodyParameters

    項目名 説明
    body
    required
    TransactionPayload

    レスポンス例

    200 Response

    {
      "accepted_at": "2019-04-03T10:36:43+09:00",
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "billing": true,
      "billing_accepted_at": "2019-04-22T10:36:43+09:00",
      "billing_condition": "passed",
      "billing_id": "9R6M-VMAN",
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "9PNG-VYR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "id": "7679-YW36",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "object": "transaction",
      "status": "passed",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": -1,
          "unit_price": 1000
        }
      ],
      "uri": "mfk:transaction:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 作成した取引が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求先IDで指定した請求先が存在しない場合のエラーです。Errorのparamには指定した請求先IDが入ります。
    409 登録しようとした取引と一致する取引が既に登録されている場合のエラーです。指定したnumberが既に登録済みでないか確認してください。

    Status Code 200

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 取引金額です。税込金額になります。
    請求モードの設定によって値が変わります。
    - 区分記載請求書モード:TransactionPayload.amountで指定した金額
    - インボイスモード(請求単位):弊社システムにて算出した金額
    - インボイスモード(取引単位):TransactionPayload.amountで指定した金額
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    請求モードの設定によって値が変わります。各税率種別の取引明細行の小計を合計した値の税込金額になっています。
    - 区分記載請求書モード:TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    - インボイスモード(請求単位):空の配列
    - インボイスモード(取引単位):TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    billing boolean 請求対象であるかをboolean値で表します。trueの場合請求対象で、falseの場合は請求対象ではないことを表します。
    billing_accepted_at string(date-time) 請求依頼受領日時です。請求対象になった日時を表します。請求対象でない場合は空になります。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    billing_id string 請求IDです。請求書にまとめられる単位のIDです。同じ請求IDを持つ取引とまとめられて請求書に記載されます。
    canceled_at string(date-time) 取引がキャンセルされた日時です。未キャンセルの場合は空になります。
    canceled_transaction_id string 先行してキャンセルし与信に利用したキャンセル済み取引のIDです。キャンセル取引を利用していない場合は空になります。
    created_at string(date-time) 取引が登録された日時です。
    customer_id string 顧客IDです。
    destination_id string 請求先IDです。取引の請求先を示します。
    date string(date) 取引日です。売り手様と顧客様の間で取引を行った日付です。
    due_date string(date) 支払期限です。この日付を超えてMoney Forward Kessaiへの入金が確認できない場合は未入金になります。
    id string 取引IDです。一意の識別子として自動で付与されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date string(date) 請求書発行日です。請求書発送日については請求書発行日についてを参照ください。
    number string 取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    object string このObjectの種別を示します。ここでは必ずtransactionが入ります。
    status string 取引ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済(canceled)があります。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    transaction_details [TransactionDetail] 取引明細行です。
    uri string 取引URIです。すべてのリソースで一意の識別子として自動で付与されます。

    取引取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /transactions/{transaction_id}

    PathParameters

    項目名 説明
    transaction_id
    required
    string 対象の取引IDを指定してください。

    レスポンス例

    200 Response

    {
      "accepted_at": "2019-04-03T10:36:43+09:00",
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "billing": true,
      "billing_accepted_at": "2019-04-22T10:36:43+09:00",
      "billing_condition": "passed",
      "billing_id": "9R6M-VMAN",
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "9PNG-VYR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "id": "7679-YW36",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "object": "transaction",
      "status": "passed",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": -1,
          "unit_price": 1000
        }
      ],
      "uri": "mfk:transaction:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 指定した取引が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 取引IDで指定した取引が存在しない場合のエラーです。Errorのparamには指定した取引IDが入ります。

    Status Code 200

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 取引金額です。税込金額になります。
    請求モードの設定によって値が変わります。
    - 区分記載請求書モード:TransactionPayload.amountで指定した金額
    - インボイスモード(請求単位):弊社システムにて算出した金額
    - インボイスモード(取引単位):TransactionPayload.amountで指定した金額
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    請求モードの設定によって値が変わります。各税率種別の取引明細行の小計を合計した値の税込金額になっています。
    - 区分記載請求書モード:TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    - インボイスモード(請求単位):空の配列
    - インボイスモード(取引単位):TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    billing boolean 請求対象であるかをboolean値で表します。trueの場合請求対象で、falseの場合は請求対象ではないことを表します。
    billing_accepted_at string(date-time) 請求依頼受領日時です。請求対象になった日時を表します。請求対象でない場合は空になります。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    billing_id string 請求IDです。請求書にまとめられる単位のIDです。同じ請求IDを持つ取引とまとめられて請求書に記載されます。
    canceled_at string(date-time) 取引がキャンセルされた日時です。未キャンセルの場合は空になります。
    canceled_transaction_id string 先行してキャンセルし与信に利用したキャンセル済み取引のIDです。キャンセル取引を利用していない場合は空になります。
    created_at string(date-time) 取引が登録された日時です。
    customer_id string 顧客IDです。
    destination_id string 請求先IDです。取引の請求先を示します。
    date string(date) 取引日です。売り手様と顧客様の間で取引を行った日付です。
    due_date string(date) 支払期限です。この日付を超えてMoney Forward Kessaiへの入金が確認できない場合は未入金になります。
    id string 取引IDです。一意の識別子として自動で付与されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date string(date) 請求書発行日です。請求書発送日については請求書発行日についてを参照ください。
    number string 取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    object string このObjectの種別を示します。ここでは必ずtransactionが入ります。
    status string 取引ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済(canceled)があります。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    transaction_details [TransactionDetail] 取引明細行です。
    uri string 取引URIです。すべてのリソースで一意の識別子として自動で付与されます。

    取引キャンセル

    コードサンプル

    curl -X DELETE https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('DELETE','https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Delete.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("DELETE", "https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/transactions/{transaction_id}',
    {
      method: 'DELETE',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /transactions/{transaction_id}

    取引の状態によってはキャンセルができない場合もあります。キャンセルについてを参照してください。

    PathParameters

    項目名 説明
    transaction_id
    required
    string 対象の取引IDを指定してください。

    レスポンス例

    200 Response

    {
      "accepted_at": "2019-04-03T10:36:43+09:00",
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "billing": true,
      "billing_accepted_at": "2019-04-22T10:36:43+09:00",
      "billing_condition": "passed",
      "billing_id": "9R6M-VMAN",
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "9PNG-VYR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "id": "7679-YW36",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "object": "transaction",
      "status": "passed",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": -1,
          "unit_price": 1000
        }
      ],
      "uri": "mfk:transaction:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 キャンセルした取引が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    409 キャンセルしようとした取引が既にキャンセルされている場合のエラーです。

    Status Code 200

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 取引金額です。税込金額になります。
    請求モードの設定によって値が変わります。
    - 区分記載請求書モード:TransactionPayload.amountで指定した金額
    - インボイスモード(請求単位):弊社システムにて算出した金額
    - インボイスモード(取引単位):TransactionPayload.amountで指定した金額
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    請求モードの設定によって値が変わります。各税率種別の取引明細行の小計を合計した値の税込金額になっています。
    - 区分記載請求書モード:TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    - インボイスモード(請求単位):空の配列
    - インボイスモード(取引単位):TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    billing boolean 請求対象であるかをboolean値で表します。trueの場合請求対象で、falseの場合は請求対象ではないことを表します。
    billing_accepted_at string(date-time) 請求依頼受領日時です。請求対象になった日時を表します。請求対象でない場合は空になります。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    billing_id string 請求IDです。請求書にまとめられる単位のIDです。同じ請求IDを持つ取引とまとめられて請求書に記載されます。
    canceled_at string(date-time) 取引がキャンセルされた日時です。未キャンセルの場合は空になります。
    canceled_transaction_id string 先行してキャンセルし与信に利用したキャンセル済み取引のIDです。キャンセル取引を利用していない場合は空になります。
    created_at string(date-time) 取引が登録された日時です。
    customer_id string 顧客IDです。
    destination_id string 請求先IDです。取引の請求先を示します。
    date string(date) 取引日です。売り手様と顧客様の間で取引を行った日付です。
    due_date string(date) 支払期限です。この日付を超えてMoney Forward Kessaiへの入金が確認できない場合は未入金になります。
    id string 取引IDです。一意の識別子として自動で付与されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date string(date) 請求書発行日です。請求書発送日については請求書発行日についてを参照ください。
    number string 取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    object string このObjectの種別を示します。ここでは必ずtransactionが入ります。
    status string 取引ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済(canceled)があります。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    transaction_details [TransactionDetail] 取引明細行です。
    uri string 取引URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Billing 請求

    Billing Object

    Billing

    {
      "account_transfer_notification_ids": [
        "7MW6-AW6A"
      ],
      "amount": 21800,
      "amounts_per_tax_rate_type": [
        {
          "amount": 11000,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 10800,
          "tax_rate_type": "reduced_8"
        }
      ],
      "customer_id": "WNAV-37R6",
      "destination_id": "7679-YW36",
      "due_date": "2019-04-30",
      "id": "9R6M-VMAN",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "invoice_ids": [
        "W47N-7WNM",
        "AY9N-VPN3"
      ],
      "issue_date": "2019-04-01",
      "object": "billing",
      "status": "scheduled",
      "unpaid": {
        "shortage_amount": 12000,
        "updated_date": "2019-04-30"
      },
      "uri": "mfk:billing:9R6M-VMAN"
    }
    
    

    請求です。取引のうち、請求先・支払期限・請求書発行日・取引登録方式が同一の取引が同じ請求にまとめられます。

    Property

    項目名 説明
    account_transfer_notification_ids [string] 口座振替通知書IDです。取引が紐づく口座振替通知書を示します。口座振替通知書が発行され次第非同期に値が追加されます。
    amount integer 請求の税込の合計金額です。区分記載請求書モードの請求では請求に含まれる取引金額の合計となり、インボイスモードの請求では含まれる全ての明細情報からインボイス制度の端数処理方法に則り算出した金額となります。インボイスモードでは審査中の取引を含んだ請求金額となり、請求対象の取引がなければ0になります。
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    customer_id string 顧客IDです。請求の顧客を示します。
    destination_id string 請求先IDです。請求先を示します。
    due_date string(date) 支払期限です。
    id string 請求IDです。一意の識別子として自動で付与されます。請求先ID・支払期限・請求書発行日・取引登録方式が同一の取引がこの請求によってまとめられます。請求書は請求をもとに発行されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    invoice_ids [string] 請求書IDです。請求に紐づく請求書を示します。請求書が発行され次第非同期で値が追加されます。
    issue_date string(date) 請求書発行日です。請求書送付日についてはこちらをご参照ください。
    object string このObjectの種別を示します。ここでは必ずbillingが入ります。
  • billing
  • status string 請求ステータスです。請求予定(scheduled)、請求書発行済(invoice_issued) 、口座振替通知済(account_transfer_notified)、請求停止(stopped)で指定されます。 請求停止(stopped)は請求モードがインボイスモードの場合のみ返却されます。
    値は以下のうちの一つになります。
    • scheduled
    • invoice_issued
    • account_transfer_notified
    • stopped
    unpaid object 未入金情報です。請求に対して支払期限後未入金がある場合のみ返却されます。
    » shortage_amount integer 未入金額です。
    » updated_date string(date) 入金情報が最後に更新された日付です。この日付以降に入金されている可能性があります。
    uri string 請求URIです。すべてのリソースで一意の識別子として自動で付与されます。

    請求一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/billings \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings

    区分記載請求書等保存方式に対応した請求一覧を取得します。

    QueryParameters

    項目名 説明
    customer_id string 任意の顧客IDを指定します。指定した顧客への請求が返却されます。
    customer_number string 顧客番号を指定します。指定された顧客の請求を取得します。
    status array[string] 請求ステータスを指定します。該当するステータスの請求が返却されます。複数指定することが可能です。指定できる値は scheduled(請求予定), invoice_issued(請求書発行済), account_transfer_notified(口座振替通知済)の3種類のみです。
    値は以下のうちの一つになります。
    • scheduled
    • invoice_issued
    • account_transfer_notified
    due_date_from string(date) 日付を指定します。指定した日付以降の支払期限となっている請求を取得できます。指定された日付のものも含まれます。
    due_date_to string(date) 日付を指定します。指定した日付以前の支払期限となっている請求を取得できます。指定された日付のものも含まれます。
    issue_date_from string(date) 日付を指定します。指定した日付以降の請求書発行日となっている請求を取得できます。指定された日付のものも含まれます。
    issue_date_to string(date) 日付を指定します。指定した日付以前の請求書発行日となっている請求を取得できます。指定された日付のものも含まれます。
    unpaid boolean 未入金のあり(true)、なし(false)を指定します。空文字が指定された場合、falseとして扱われます。
    invoice_id string 任意の請求書IDを指定します。指定した請求書に紐付く請求が返却されます。
    account_transfer_notification_id string 任意の口座振替通知書IDを指定します。指定した口座振替通知書に紐付く請求が返却されます。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "account_transfer_notification_ids": [
            "7MW6-AW6A"
          ],
          "amount": 21800,
          "amounts_per_tax_rate_type": [
            {
              "amount": 11000,
              "tax_rate_type": "normal_10"
            },
            {
              "amount": 10800,
              "tax_rate_type": "reduced_8"
            }
          ],
          "customer_id": "WNAV-37R6",
          "destination_id": "7679-YW36",
          "due_date": "2019-04-30",
          "id": "9R6M-VMAN",
          "invoice_delivery_method": [
            "posting",
            "email"
          ],
          "invoice_ids": [
            "W47N-7WNM",
            "AY9N-VPN3"
          ],
          "issue_date": "2019-04-01",
          "object": "billing",
          "status": "scheduled",
          "unpaid": {
            "shortage_amount": 12000,
            "updated_date": "2019-04-30"
          },
          "uri": "mfk:billing:9R6M-VMAN"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 請求一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Billing] 請求一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    インボイス請求一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/billings/qualified \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings/qualified', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/qualified")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings/qualified', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings/qualified", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/qualified',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/qualified

    インボイス制度(適格請求書等保存方式)に対応した請求一覧を取得します。請求対象の取引がなくなった請求や、審査中の取引のみを含む請求も含まれます。

    QueryParameters

    項目名 説明
    customer_id string 任意の顧客IDを指定します。指定した顧客への請求が返却されます。
    customer_number string 顧客番号を指定します。指定された顧客の請求を取得します。
    status array[string] 請求ステータスを指定します。該当するステータスの請求が返却されます。複数指定することが可能です。指定できる値は scheduled(請求予定), invoice_issued(請求書発行済), account_transfer_notified(口座振替通知済)の3種類のみです。
    値は以下のうちの一つになります。
    • scheduled
    • invoice_issued
    • account_transfer_notified
    due_date_from string(date) 日付を指定します。指定した日付以降の支払期限となっている請求を取得できます。指定された日付のものも含まれます。
    due_date_to string(date) 日付を指定します。指定した日付以前の支払期限となっている請求を取得できます。指定された日付のものも含まれます。
    issue_date_from string(date) 日付を指定します。指定した日付以降の請求書発行日となっている請求を取得できます。指定された日付のものも含まれます。
    issue_date_to string(date) 日付を指定します。指定した日付以前の請求書発行日となっている請求を取得できます。指定された日付のものも含まれます。
    unpaid boolean 未入金のあり(true)、なし(false)を指定します。空文字が指定された場合、falseとして扱われます。
    invoice_id string 任意の請求書IDを指定します。指定した請求書に紐付く請求が返却されます。
    account_transfer_notification_id string 任意の口座振替通知書IDを指定します。指定した口座振替通知書に紐付く請求が返却されます。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "account_transfer_notification_ids": [
            "7MW6-AW6A"
          ],
          "amount": 21800,
          "amounts_per_tax_rate_type": [
            {
              "amount": 11000,
              "tax_rate_type": "normal_10"
            },
            {
              "amount": 10800,
              "tax_rate_type": "reduced_8"
            }
          ],
          "customer_id": "WNAV-37R6",
          "destination_id": "7679-YW36",
          "due_date": "2019-04-30",
          "id": "9R6M-VMAN",
          "invoice_delivery_method": [
            "posting",
            "email"
          ],
          "invoice_ids": [
            "W47N-7WNM",
            "AY9N-VPN3"
          ],
          "issue_date": "2019-04-01",
          "object": "billing",
          "status": "scheduled",
          "unpaid": {
            "shortage_amount": 12000,
            "updated_date": "2019-04-30"
          },
          "uri": "mfk:billing:9R6M-VMAN"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 請求一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Billing] 請求一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    請求取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/{billing_id}

    請求IDを指定して請求を取得します。インボイスモードでは請求対象の取引がなくなった請求や、審査中の取引のみを含む請求も取得できます。

    PathParameters

    項目名 説明
    billing_id
    required
    string 対象の請求IDを指定してください。

    レスポンス例

    200 Response

    {
      "account_transfer_notification_ids": [
        "7MW6-AW6A"
      ],
      "amount": 21800,
      "amounts_per_tax_rate_type": [
        {
          "amount": 11000,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 10800,
          "tax_rate_type": "reduced_8"
        }
      ],
      "customer_id": "WNAV-37R6",
      "destination_id": "7679-YW36",
      "due_date": "2019-04-30",
      "id": "9R6M-VMAN",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "invoice_ids": [
        "W47N-7WNM",
        "AY9N-VPN3"
      ],
      "issue_date": "2019-04-01",
      "object": "billing",
      "status": "scheduled",
      "unpaid": {
        "shortage_amount": 12000,
        "updated_date": "2019-04-30"
      },
      "uri": "mfk:billing:9R6M-VMAN"
    }
    

    Responses

    ステータス 説明
    200 指定した請求が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求IDで指定した請求が存在しない場合のエラーです。Errorのparamには指定した請求IDが入ります。

    Status Code 200

    項目名 説明
    account_transfer_notification_ids [string] 口座振替通知書IDです。取引が紐づく口座振替通知書を示します。口座振替通知書が発行され次第非同期に値が追加されます。
    amount integer 請求の税込の合計金額です。区分記載請求書モードの請求では請求に含まれる取引金額の合計となり、インボイスモードの請求では含まれる全ての明細情報からインボイス制度の端数処理方法に則り算出した金額となります。インボイスモードでは審査中の取引を含んだ請求金額となり、請求対象の取引がなければ0になります。
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    customer_id string 顧客IDです。請求の顧客を示します。
    destination_id string 請求先IDです。請求先を示します。
    due_date string(date) 支払期限です。
    id string 請求IDです。一意の識別子として自動で付与されます。請求先ID・支払期限・請求書発行日・取引登録方式が同一の取引がこの請求によってまとめられます。請求書は請求をもとに発行されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    invoice_ids [string] 請求書IDです。請求に紐づく請求書を示します。請求書が発行され次第非同期で値が追加されます。
    issue_date string(date) 請求書発行日です。請求書送付日についてはこちらをご参照ください。
    object string このObjectの種別を示します。ここでは必ずbillingが入ります。
    status string 請求ステータスです。請求予定(scheduled)、請求書発行済(invoice_issued) 、口座振替通知済(account_transfer_notified)、請求停止(stopped)で指定されます。 請求停止(stopped)は請求モードがインボイスモードの場合のみ返却されます。
    値は以下のうちの一つになります。
    • scheduled
    • invoice_issued
    • account_transfer_notified
    • stopped
    unpaid object 未入金情報です。請求に対して支払期限後未入金がある場合のみ返却されます。
    uri string 請求URIです。すべてのリソースで一意の識別子として自動で付与されます。

    請求書・口座振替通知書兼請求書再発行

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue', params={
    
    }, json={
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/reissue',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/{billing_id}/reissue

    指定した請求に対する請求書または口座振替通知書兼請求書を再発行します。請求が直近で発行した請求書または口座振替通知書兼請求書と同じ種別で再発行されます。
    振替金額決定以降に口座振替通知書兼請求書が再発行された場合は、振替金額決定時点でキャンセルされていなかった取引を対象に再発行をおこないます。
    インボイスモードの請求では、請求対象がなくなり0円になった請求も0円の適格返還請求書として再発行ができます。

    Body parameter

    {
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }
    

    PathParameters

    項目名 説明
    billing_id
    required
    string 対象の請求IDを指定してください。

    BodyParameters

    項目名 説明
    body
    required
    ReissuingPayload 再発行情報です。

    レスポンス例

    200 Response

    {
      "account_transfer_notification": {
        "account_transfer_date": "2021-06-09",
        "amount": 20000,
        "billing_id": "79NR-9WR6",
        "created_at": "2021-06-15T10:21:34+09:00",
        "destination_id": "WNAV-37R6",
        "id": "79NR-AP96",
        "invoice_delivery_methods": [
          "posting",
          "email"
        ],
        "object": "account_transfer_notification",
        "uri": "mfk:account_transfer_notification:7679-YW36"
      },
      "invoice": {
        "amount": 20000,
        "billing_date": "2021-06-09",
        "billing_id": "79NR-9WR6",
        "created_at": "2021-06-15T10:21:34+09:00",
        "destination_id": "WNAV-37R6",
        "id": "79NR-AP96",
        "invoice_delivery_methods": [
          "posting",
          "email"
        ],
        "object": "invoice",
        "uri": "mfk:invoice:7679-YW36"
      },
      "type": "invoice"
    }
    

    Responses

    ステータス 説明
    200 再発行された請求書または口座振替通知書兼請求書が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求IDで指定した請求が存在しない場合のエラーです。Errorのparamには指定した請求IDが入ります。

    Status Code 200

    項目名 説明
    account_transfer_notification AccountTransferNotification
    invoice Invoice
    type string 請求種別です。請求書(invoice)もしくは口座振替通知書(account_transfer_notification)のいずれかになります。
    値は以下のうちの一つになります。
    • account_transfer_notification
    • invoice

    請求付記ファイルアップロードのための署名付きURL発行

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "content_type": "application/pdf"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "content_type": "application/pdf"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "content_type": "application/pdf"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url', params={
    
    }, json={
      "content_type": "application/pdf"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "content_type": "application/pdf"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "content_type": "application/pdf"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/upload_signed_url',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/{billing_id}/upload_signed_url

    指定した請求に対する付記ファイルをアップロードするための署名付きURLを発行します。
    成功時に返却されたURLに対してファイルをPOSTすることでファイルをアップロードすることができます。
    このエンドポイントは利用者を限定しています。使用するには事前設定が必要です。

    Body parameter

    {
      "content_type": "application/pdf"
    }
    

    PathParameters

    項目名 説明
    billing_id
    required
    string 対象の請求IDを指定してください。

    BodyParameters

    項目名 説明
    body
    required
    UploadSignedUrlPayload 請求付記ファイルアップロードのための署名付きURL発行情報です。

    レスポンス例

    200 Response

    {
      "url": "https://upload.mfk.jp/billings/7679-YW36/billing_files?signature=mfkrandomsignature",
      "expires_at": "2023-03-08T10:36:43+09:00"
    }
    

    Responses

    ステータス 説明
    200 署名付きURLが返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    403 このエンドポイントの利用権限がない場合のエラーです。
    404 請求IDで指定した請求が存在しない場合のエラーです。Errorのparamには指定した請求IDが入ります。

    Status Code 200

    項目名 説明
    url string ファイルアップロード用の署名付きURLです。
    expires_at string(date-time) ファイルアップロード用の署名付きURLの有効期限です。

    発行済請求情報一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/{billing_id}/issues

    請求IDを指定して発行済請求情報一覧を取得します。

    PathParameters

    項目名 説明
    billing_id
    required
    string 対象の請求IDを指定してください。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "id": "i/79NR-AP96",
          "type": "invoice",
          "created_at": "2019-04-01T10:36:43+09:00"
        }
      ],
      "object": "list"
    }
    

    Responses

    ステータス 説明
    200 指定した請求が発行済請求情報されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求IDで指定した請求が存在しない場合のエラーです。Errorのparamには指定した請求IDが入ります。

    Status Code 200

    項目名 説明
    items [Issue] 発行済請求情報の一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。

    請求ファイルダウンロードのための署名付きURL発行

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/billings/{billing_id}/issues/{issue_id}/download_signed_url',
    {
      method: 'POST',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /billings/{billing_id}/issues/{issue_id}/download_signed_url

    指定した発行済み請求書ファイルまたは口座振替通知書ファイルをダウンロードするための署名付きURLを発行します。
    成功時に返却されたURLに対してGETリクエストを送ることでファイルをダウンロードすることができます。

    PathParameters

    項目名 説明
    billing_id
    required
    string 対象の請求IDを指定してください。
    issue_id
    required
    string 対象の発行済の請求書または口座振替通知書を表すIDを指定してください。このIDは請求書の場合は「i/」、口座振替通知書の場合は「a/」がprefixとして付きます。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "signed_url": "https://download.mfk.jp/api/billings/7679-YW36/content?Signature=mfkrandomsignature",
          "expired_at": "2023-03-08T10:36:43+09:00",
          "type": "pdf"
        }
      ],
      "object": "list"
    }
    

    Responses

    ステータス 説明
    200 署名付きURLが返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 請求IDで指定した請求が存在しない場合のエラーです。Errorのparamには指定した請求IDが入ります。

    Status Code 200

    項目名 説明
    items [DownloadSignedURL] ファイルダウンロード用の署名付きURLの一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。

    Payout 振込

    Payout Object

    Payout

    {
      "amount": 300800,
      "collected_amount": 200000,
      "receivables_amount": 110000,
      "deduction": {
        "amount": 9400,
        "returned_credit_amount": 500,
        "tax_free": {
          "amount": 3200,
          "commission_amount": 2200,
          "early_payout_commission_amount": 1000
        },
        "taxable": {
          "amount": 7000,
          "convenience_billing": {
            "charge": 15000,
            "quantity": 100,
            "unit_price": 150
          },
          "basic_monthly_charge": 4500,
          "billing_charge": {
            "amount": 2000,
            "unit_price": 200,
            "quantity": 10
          },
          "posting": {
            "amount": 500,
            "unit_price": 100,
            "quantity": 5
          }
        },
        "tax": {
          "rate_type": "normal_10",
          "amount": 500
        },
        "untaxable": {
          "amount": 15000,
          "revenue_stamp": {
            "amount": 15000,
            "quantity": 100,
            "unit_price": 150
          }
        }
      },
      "id": "7679-YW36",
      "payout_date": "2019-07-29",
      "status": "completed",
      "type": "normal",
      "uri": "mfk:payout:7679-YW36"
    }
    
    

    Money Forward Kessaiから売り手様への金額確定済みの振込です。

    Property

    項目名 説明
    amount integer 振込金額です。
    collected_amount integer 振込の対象となる回収金額です。
    deduction Deduction 振込から控除される金額とその内訳です。
    id string 振込IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayoutが入ります。
  • payout
  • payout_date string(date) 振込予定日です。
    receivables_amount integer 振込の対象となる債権金額です。
    status string 振込ステータスです。振込手続中(in_progress)、振込完了(completed)があります。
    値は以下のうちの一つになります。
    • in_progress
    • completed
    type string 振込種別です。通常振込(normal)、早期振込(early)があります。
    値は以下のうちの一つになります。
    • normal
    • early
    uri string 振込URIです。すべてのリソースで一意の識別子として自動で付与されます。

    振込一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/payouts \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/payouts', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/payouts")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/payouts', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/payouts", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/payouts',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /payouts

    QueryParameters

    項目名 説明
    status array[string] 振込ステータスを指定します。該当するステータスの振込が返却されます。指定できる値は in_progress(振込手続中), completed(振込完了)の2種類のみです。
    値は以下のうちの一つになります。
    • in_progress
    • completed
    payout_date_from string(date) 日付を指定します。指定した日付以降の振込予定日となっている振込を取得できます。指定された日付のものも含まれます。
    payout_date_to string(date) 日付を指定します。指定した日付以前の振込予定日となっている振込を取得できます。指定された日付のものも含まれます。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "amount": 300800,
          "collected_amount": 200000,
          "receivables_amount": 110000,
          "deduction": {
            "amount": 9400,
            "returned_credit_amount": 500,
            "tax_free": {
              "amount": 3200,
              "commission_amount": 2200,
              "early_payout_commission_amount": 1000
            },
            "taxable": {
              "amount": 7000,
              "convenience_billing": {
                "charge": 15000,
                "quantity": 100,
                "unit_price": 150
              },
              "basic_monthly_charge": 4500,
              "billing_charge": {
                "amount": 2000,
                "unit_price": 200,
                "quantity": 10
              },
              "posting": {
                "amount": 500,
                "unit_price": 100,
                "quantity": 5
              }
            },
            "tax": {
              "rate_type": "normal_10",
              "amount": 500
            },
            "untaxable": {
              "amount": 15000,
              "revenue_stamp": {
                "amount": 15000,
                "quantity": 100,
                "unit_price": 150
              }
            }
          },
          "id": "7679-YW36",
          "payout_date": "2019-07-29",
          "status": "completed",
          "type": "normal",
          "uri": "mfk:payout:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 振込一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Payout] 振込一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    振込取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/payouts/{payout_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /payouts/{payout_id}

    PathParameters

    項目名 説明
    payout_id
    required
    string 対象の振込ID。

    レスポンス例

    200 Response

    {
      "amount": 300800,
      "collected_amount": 200000,
      "receivables_amount": 110000,
      "deduction": {
        "amount": 9400,
        "returned_credit_amount": 500,
        "tax_free": {
          "amount": 3200,
          "commission_amount": 2200,
          "early_payout_commission_amount": 1000
        },
        "taxable": {
          "amount": 7000,
          "convenience_billing": {
            "charge": 15000,
            "quantity": 100,
            "unit_price": 150
          },
          "basic_monthly_charge": 4500,
          "billing_charge": {
            "amount": 2000,
            "unit_price": 200,
            "quantity": 10
          },
          "posting": {
            "amount": 500,
            "unit_price": 100,
            "quantity": 5
          }
        },
        "tax": {
          "rate_type": "normal_10",
          "amount": 500
        },
        "untaxable": {
          "amount": 15000,
          "revenue_stamp": {
            "amount": 15000,
            "quantity": 100,
            "unit_price": 150
          }
        }
      },
      "id": "7679-YW36",
      "payout_date": "2019-07-29",
      "status": "completed",
      "type": "normal",
      "uri": "mfk:payout:7679-YW36"
    }
    

    Responses

    ステータス 説明
    200 指定した振込が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 振込IDで指定した振込が存在しない場合のエラーです。Errorのparamには指定した振込IDが入ります。

    Status Code 200

    項目名 説明
    amount integer 振込金額です。
    collected_amount integer 振込の対象となる回収金額です。
    deduction Deduction 振込から控除される金額とその内訳です。
    id string 振込IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayoutが入ります。
    payout_date string(date) 振込予定日です。
    receivables_amount integer 振込の対象となる債権金額です。
    status string 振込ステータスです。振込手続中(in_progress)、振込完了(completed)があります。
    値は以下のうちの一つになります。
    • in_progress
    • completed
    type string 振込種別です。通常振込(normal)、早期振込(early)があります。
    値は以下のうちの一つになります。
    • normal
    • early
    uri string 振込URIです。すべてのリソースで一意の識別子として自動で付与されます。

    PayoutTransaction 債権

    PayoutTransaction Object

    PayoutTransaction

    {
      "accepted_at": "2019-04-01T10:36:43+09:00",
      "amount": 10000,
      "commission_amount": 200,
      "commission_rate": 2,
      "early_payout_commission_amount": 400,
      "early_payout_commission_rate": 4,
      "id": "9NR3-P9A6",
      "payout_date": "2019-04-15",
      "payout_id": "7679-YW36",
      "standard_payout_date": "2019-05-01",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:payout_transaction:9NR3-P9A6"
    }
    
    

    売り手様へ振込に紐づく債権です。

    Property

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 債権金額です。
    commission_amount integer 手数料の金額です。
    commission_rate number 手数料率です。
    early_payout_commission_amount integer 早期振込手数料です。
    early_payout_commission_rate number 早期振込手数料率です。
    id string 債権IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayout_transactionが入ります。
  • payout_transaction
  • payout_date string(date) 振込予定日です。早期振込の場合、standard_payout_dateよりも早くなります。
    payout_id string 債権が含まれる振込のIDです。
    standard_payout_date string(date) 通常の振込予定日です。
    transaction_id string 取引IDです。この債権が紐づく取引を示します。
    uri string 債権URIです。すべてのリソースで一意の識別子として自動で付与されます。

    債権一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/payout_transactions \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/payout_transactions', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/payout_transactions")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/payout_transactions', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/payout_transactions", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/payout_transactions',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /payout_transactions

    QueryParameters

    項目名 説明
    payout_id string 任意の振込IDを指定します。指定した振込に含まれる債権が返却されます。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "accepted_at": "2019-04-01T10:36:43+09:00",
          "amount": 10000,
          "commission_amount": 200,
          "commission_rate": 2,
          "early_payout_commission_amount": 400,
          "early_payout_commission_rate": 4,
          "id": "9NR3-P9A6",
          "payout_date": "2019-04-15",
          "payout_id": "7679-YW36",
          "standard_payout_date": "2019-05-01",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:payout_transaction:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 債権一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [PayoutTransaction] 債権一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    債権取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/payout_transactions/{payout_transaction_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /payout_transactions/{payout_transaction_id}

    PathParameters

    項目名 説明
    payout_transaction_id
    required
    string 取得したい債権のID。

    レスポンス例

    200 Response

    {
      "accepted_at": "2019-04-01T10:36:43+09:00",
      "amount": 10000,
      "commission_amount": 200,
      "commission_rate": 2,
      "early_payout_commission_amount": 400,
      "early_payout_commission_rate": 4,
      "id": "9NR3-P9A6",
      "payout_date": "2019-04-15",
      "payout_id": "7679-YW36",
      "standard_payout_date": "2019-05-01",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:payout_transaction:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 指定した債権が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 債権IDで指定した債権が存在しない場合のエラーです。Errorのparamには指定した債権IDが入ります。

    Status Code 200

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 債権金額です。
    commission_amount integer 手数料の金額です。
    commission_rate number 手数料率です。
    early_payout_commission_amount integer 早期振込手数料です。
    early_payout_commission_rate number 早期振込手数料率です。
    id string 債権IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayout_transactionが入ります。
    payout_date string(date) 振込予定日です。早期振込の場合、standard_payout_dateよりも早くなります。
    payout_id string 債権が含まれる振込のIDです。
    standard_payout_date string(date) 通常の振込予定日です。
    transaction_id string 取引IDです。この債権が紐づく取引を示します。
    uri string 債権URIです。すべてのリソースで一意の識別子として自動で付与されます。

    PayoutRefund 返金

    PayoutRefund Object

    PayoutRefund

    {
      "amount": 10000,
      "commission_amount": 100,
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "object": "payout_refund",
      "payout_id": "7679-YW36",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:payout_refund:9NR3-P9A6"
    }
    
    

    売り手さまへの振込金額確定後に発生した取引キャンセルに伴う返金です。

    Property

    項目名 説明
    amount integer 返金金額です。
    commission_amount integer 手数料の金額です。
    customer_id string 顧客IDです。この返金が紐づく顧客を示します。
    id string 返金IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayout_refundが入ります。
  • payout_refund
  • payout_id string 返金が含まれる振込のIDです。
    transaction_id string 取引IDです。この返金が紐づく取引を示します。
    uri string 返金URIです。すべてのリソースで一意の識別子として自動で付与されます。

    返金一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/payout_refunds \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/payout_refunds', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/payout_refunds")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/payout_refunds', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/payout_refunds", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/payout_refunds',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /payout_refunds

    QueryParameters

    項目名 説明
    payout_id string 任意の振込IDを指定します。指定した振込に含まれる返金が返却されます。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "amount": 10000,
          "commission_amount": 100,
          "customer_id": "W463-AA6V",
          "id": "9NR3-P9A6",
          "object": "payout_refund",
          "payout_id": "7679-YW36",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:payout_refund:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 返金一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [PayoutRefund] 返金一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    CustomerNameUpdate 顧客名変更申請

    CustomerNameUpdate Object

    CustomerNameUpdate

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため",
      "object": "customer_name_update",
      "status": "passed",
      "uri": "mfk:customer_name_update:9NR3-P9A6"
    }
    
    

    Property

    項目名 説明
    created_at string(date-time) 顧客名変更申請が登録された日時を示します。
    customer_id string 顧客IDです。この顧客名変更申請が紐づく顧客を示します。
    id string 顧客名変更申請IDです。一意の識別子として自動で付与されます。
    name string 変更後の顧客名です。
    reason string 変更希望理由です。
    object string このObjectの種別を示します。ここでは必ずcustomer_name_updateが入ります。
  • customer_name_update
  • status string 顧客名変更申請ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、申請キャンセル(canceled)があります。審査通過の場合には顧客名が変更されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    uri string 顧客名変更申請URIです。すべてのリソースで一意の識別子として自動で付与されます。

    顧客名変更申請一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_name_updates

    顧客名変更申請の一覧を取得します。顧客IDやステータスで絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    customer_id string 顧客IDを指定します。指定された顧客の顧客名変更申請を取得します。
    status string ステータスを指定します。該当するステータスの顧客名変更申請が返却されます。指定できる値は unexamined(審査中), passed(審査通過), rejected(審査否決) の3種類のみです。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    created_at_from string(date-time) 指定された日時以降に作成された顧客名変更申請を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成された顧客名変更申請を取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "W463-AA6V",
          "id": "9NR3-P9A6",
          "name": "マネーフォワードケッサイ株式会社",
          "reason": "社名変更のため",
          "object": "customer_name_update",
          "status": "passed",
          "uri": "mfk:customer_name_update:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 顧客名変更申請一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [CustomerNameUpdate] 顧客名変更申請一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    顧客名変更申請登録

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates', params={
    
    }, json={
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_name_updates

    顧客と変更希望の顧客名を指定して顧客名変更申請を登録することができます。通常、申請後2営業日以内に審査いたします。
    ただし、申請内容に関するご確認事項が発生した場合は、審査が遅れる可能性があります。

    Body parameter

    {
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }
    

    BodyParameters

    項目名 説明
    body
    required
    CustomerNameUpdatePayload 顧客名変更申請情報です。

    レスポンス例

    200 Response

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため",
      "object": "customer_name_update",
      "status": "passed",
      "uri": "mfk:customer_name_update:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 登録された顧客名変更申請が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 指定した顧客に対する顧客名変更申請が既に登録されている場合のエラーです。指定したcustomer_idで審査中の申請がないか確認してください。

    Status Code 200

    項目名 説明
    created_at string(date-time) 顧客名変更申請が登録された日時を示します。
    customer_id string 顧客IDです。この顧客名変更申請が紐づく顧客を示します。
    id string 顧客名変更申請IDです。一意の識別子として自動で付与されます。
    name string 変更後の顧客名です。
    reason string 変更希望理由です。
    object string このObjectの種別を示します。ここでは必ずcustomer_name_updateが入ります。
    status string 顧客名変更申請ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、申請キャンセル(canceled)があります。審査通過の場合には顧客名が変更されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    uri string 顧客名変更申請URIです。すべてのリソースで一意の識別子として自動で付与されます。

    顧客名変更申請取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_name_updates/{customer_name_update_id}

    顧客名変更申請IDを指定して対象顧客名変更申請1件を取得することができます。

    PathParameters

    項目名 説明
    customer_name_update_id
    required
    string 対象の顧客名変更申請IDを指定してください。

    レスポンス例

    200 Response

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため",
      "object": "customer_name_update",
      "status": "passed",
      "uri": "mfk:customer_name_update:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 指定した顧客名変更申請が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客名変更申請IDで指定した顧客名変更申請が存在しない場合のエラーです。Errorのparamには指定した顧客名変更申請IDが入ります。

    Status Code 200

    項目名 説明
    created_at string(date-time) 顧客名変更申請が登録された日時を示します。
    customer_id string 顧客IDです。この顧客名変更申請が紐づく顧客を示します。
    id string 顧客名変更申請IDです。一意の識別子として自動で付与されます。
    name string 変更後の顧客名です。
    reason string 変更希望理由です。
    object string このObjectの種別を示します。ここでは必ずcustomer_name_updateが入ります。
    status string 顧客名変更申請ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、申請キャンセル(canceled)があります。審査通過の場合には顧客名が変更されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    uri string 顧客名変更申請URIです。すべてのリソースで一意の識別子として自動で付与されます。

    顧客名変更申請キャンセル

    コードサンプル

    curl -X DELETE https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('DELETE','https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Delete.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("DELETE", "https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/customer_name_updates/{customer_name_update_id}',
    {
      method: 'DELETE',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /customer_name_updates/{customer_name_update_id}

    顧客名変更申請IDを指定して対象顧客名変更申請をキャンセルすることができます。

    PathParameters

    項目名 説明
    customer_name_update_id
    required
    string 対象の顧客名変更申請IDを指定してください。

    レスポンス例

    200 Response

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため",
      "object": "customer_name_update",
      "status": "passed",
      "uri": "mfk:customer_name_update:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 キャンセルされた顧客名変更申請が返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客名変更申請IDで指定した顧客名変更申請が存在しない場合のエラーです。Errorのparamには指定した顧客名変更申請IDが入ります。
    409 顧客名変更申請IDで指定した顧客名変更申請が既に審査済みまたはキャンセルされている場合のエラーです。

    Status Code 200

    項目名 説明
    created_at string(date-time) 顧客名変更申請が登録された日時を示します。
    customer_id string 顧客IDです。この顧客名変更申請が紐づく顧客を示します。
    id string 顧客名変更申請IDです。一意の識別子として自動で付与されます。
    name string 変更後の顧客名です。
    reason string 変更希望理由です。
    object string このObjectの種別を示します。ここでは必ずcustomer_name_updateが入ります。
    status string 顧客名変更申請ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、申請キャンセル(canceled)があります。審査通過の場合には顧客名が変更されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    uri string 顧客名変更申請URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Authorization オーソリゼーション

    Authorization Object

    Authorization

    {
      "amount": 10000,
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "credit_facility_id": "4N3W-ER7N",
      "customer_id": "W463-AA6V",
      "expiration_date": "2019-06-16",
      "id": "9NR3-P9A6",
      "max_due_date": "2019-06-30",
      "number": "AUTHORIZATION001",
      "object": "authorization",
      "status": "active",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:authorization:9NR3-P9A6"
    }
    
    

    Property

    項目名 説明
    amount integer オーソリゼーション金額です。税込金額になります。
    canceled_at string(date-time) オーソリゼーションがキャンセルされた日時です。未キャンセルの場合は空になります。
    created_at string(date-time) オーソリゼーションが登録された日時を示します。
    credit_facility_id string 与信枠IDです。このオーソリゼーションが紐づく与信枠を示します。
    customer_id string 顧客IDです。このオーソリゼーションが紐づく顧客を示します。
    expiration_date string(date) 有効期限日です。この日付を含む有効期間中はこのオーソリゼーションを利用して取引登録ができます。
    id string オーソリゼーションIDです。一意の識別子として自動で付与されます。
    max_due_date string(date) このオーソリゼーションを利用して取引登録する際に指定可能な最大支払期限です。
    number string オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずauthorizationが入ります。
  • authorization
  • status string オーソリゼーションステータスです。アクティブ(active)、有効期限切れ(expired)、取引登録済み(captured)、キャンセル済み(canceled)があります。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    transaction_id string 取引IDです。このオーソリゼーションが紐づく取引を示します。空の場合はそのオーソリゼーションを利用して取引登録がまだされていないことを示します。
    uri string オーソリゼーションURIです。すべてのリソースで一意の識別子として自動で付与されます。

    オーソリゼーション一覧取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/authorizations \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/authorizations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/authorizations")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/authorizations', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/authorizations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/authorizations',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /authorizations

    オーソリゼーション登録の一覧を取得します。顧客IDや番号で絞り込んで取得することもできます。

    QueryParameters

    項目名 説明
    customer_id string 顧客IDを指定します。指定された顧客のオーソリゼーションを取得します。
    number string オーソリゼーション番号を指定します。 指定されたオーソリゼーションを取得します。
    status string ステータスを指定します。該当するステータスのオーソリゼーションが返却されます。指定できる値は active(有効), expired(期限切れ), captured(確定済), canceled(キャンセル済) の4種類のみです。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    created_at_from string(date-time) 指定された日時以降に作成されたオーソリゼーションを取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    created_at_to string(date-time) 指定された日時以前に作成されたオーソリゼーションを取得します。指定された日時に作成されたものも含まれます。 RFC3339のdate-time(2019-04-01T10:36:43%2B09:00)で指定してください。
    after string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも後のリソースを取得します。この時afterで指定したIDのリソースは結果に含まれません。
    before string 任意のリソースIDを指定します。追加日時の降順でこのIDのリソースよりも前のリソースを取得します。この時beforeで指定したIDのリソースは結果に含まれません。
    limit integer(int32) 取得したいリソースの最大件数を指定します。1~200の間の整数で指定してください。指定がない場合は20になります。

    レスポンス例

    200 Response

    {
      "items": [
        {
          "amount": 10000,
          "canceled_at": "2019-04-22T10:36:43+09:00",
          "created_at": "2019-04-01T10:36:43+09:00",
          "credit_facility_id": "4N3W-ER7N",
          "customer_id": "W463-AA6V",
          "expiration_date": "2019-06-16",
          "id": "9NR3-P9A6",
          "max_due_date": "2019-06-30",
          "number": "AUTHORIZATION001",
          "object": "authorization",
          "status": "active",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:authorization:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    

    Responses

    ステータス 説明
    200 オーソリゼーション一覧とページネーション情報です。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。

    Status Code 200

    項目名 説明
    items [Authorization] オーソリゼーション一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
    pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    オーソリゼーション登録

    コードサンプル

    curl -X POST https://sandbox-api.mfkessai.co.jp/v2/authorizations \
      -H 'Content-Type: application/json' \
      -H 'Accept: application/json' \
      -H 'apikey: API_KEY' \
      -d `{
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }`
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Content-Type' => 'application/json',
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '{
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }';
    
    try {
        $response = $client->request('POST','https://sandbox-api.mfkessai.co.jp/v2/authorizations', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/authorizations")
    
    headers = {
      'Content-Type' => 'application/json',
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Post.new(uri, headers)
    req.body='{
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }'
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.post('https://sandbox-api.mfkessai.co.jp/v2/authorizations', params={
    
    }, json={
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Content-Type": []string{"application/json"},
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{`{
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }`})
        req, err := http.NewRequest("POST", "https://sandbox-api.mfkessai.co.jp/v2/authorizations", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    const inputBody = `{
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }`;
    const headers = {
      'Content-Type':'application/json',
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/authorizations',
    {
      method: 'POST',
      body: inputBody,
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /authorizations

    顧客と金額を指定してオーソリゼーションを登録します。

    Body parameter

    {
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }
    

    BodyParameters

    項目名 説明
    body
    required
    AuthorizationPayload オーソリゼーション登録情報です。

    レスポンス例

    200 Response

    {
      "amount": 10000,
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "credit_facility_id": "4N3W-ER7N",
      "customer_id": "W463-AA6V",
      "expiration_date": "2019-06-16",
      "id": "9NR3-P9A6",
      "max_due_date": "2019-06-30",
      "number": "AUTHORIZATION001",
      "object": "authorization",
      "status": "active",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:authorization:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 登録されたオーソリゼーションが返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 顧客IDで指定した顧客が存在しない場合のエラーです。Errorのparamには指定した顧客IDが入ります。
    409 登録しようとしたと一致するオーソリゼーションが既に登録されている場合のエラーです。指定したnumberが既に登録済みでないか確認してください。

    Status Code 200

    項目名 説明
    amount integer オーソリゼーション金額です。税込金額になります。
    canceled_at string(date-time) オーソリゼーションがキャンセルされた日時です。未キャンセルの場合は空になります。
    created_at string(date-time) オーソリゼーションが登録された日時を示します。
    credit_facility_id string 与信枠IDです。このオーソリゼーションが紐づく与信枠を示します。
    customer_id string 顧客IDです。このオーソリゼーションが紐づく顧客を示します。
    expiration_date string(date) 有効期限日です。この日付を含む有効期間中はこのオーソリゼーションを利用して取引登録ができます。
    id string オーソリゼーションIDです。一意の識別子として自動で付与されます。
    max_due_date string(date) このオーソリゼーションを利用して取引登録する際に指定可能な最大支払期限です。
    number string オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずauthorizationが入ります。
    status string オーソリゼーションステータスです。アクティブ(active)、有効期限切れ(expired)、取引登録済み(captured)、キャンセル済み(canceled)があります。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    transaction_id string 取引IDです。このオーソリゼーションが紐づく取引を示します。空の場合はそのオーソリゼーションを利用して取引登録がまだされていないことを示します。
    uri string オーソリゼーションURIです。すべてのリソースで一意の識別子として自動で付与されます。

    オーソリゼーション取得

    コードサンプル

    curl -X GET https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('GET','https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Get.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.get('https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("GET", "https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}',
    {
      method: 'GET',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /authorizations/{authorization_id}

    オーソリゼーションIDを指定して対象オーソリゼーション1件を取得することができます。

    PathParameters

    項目名 説明
    authorization_id
    required
    string 対象のオーソリゼーションIDを指定してください。

    レスポンス例

    200 Response

    {
      "amount": 10000,
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "credit_facility_id": "4N3W-ER7N",
      "customer_id": "W463-AA6V",
      "expiration_date": "2019-06-16",
      "id": "9NR3-P9A6",
      "max_due_date": "2019-06-30",
      "number": "AUTHORIZATION001",
      "object": "authorization",
      "status": "active",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:authorization:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 指定したオーソリゼーションが返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    404 オーソリゼーションIDで指定したオーソリゼーションが存在しない場合のエラーです。Errorのparamには指定したオーソリゼーションIDが入ります。

    Status Code 200

    項目名 説明
    amount integer オーソリゼーション金額です。税込金額になります。
    canceled_at string(date-time) オーソリゼーションがキャンセルされた日時です。未キャンセルの場合は空になります。
    created_at string(date-time) オーソリゼーションが登録された日時を示します。
    credit_facility_id string 与信枠IDです。このオーソリゼーションが紐づく与信枠を示します。
    customer_id string 顧客IDです。このオーソリゼーションが紐づく顧客を示します。
    expiration_date string(date) 有効期限日です。この日付を含む有効期間中はこのオーソリゼーションを利用して取引登録ができます。
    id string オーソリゼーションIDです。一意の識別子として自動で付与されます。
    max_due_date string(date) このオーソリゼーションを利用して取引登録する際に指定可能な最大支払期限です。
    number string オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずauthorizationが入ります。
    status string オーソリゼーションステータスです。アクティブ(active)、有効期限切れ(expired)、取引登録済み(captured)、キャンセル済み(canceled)があります。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    transaction_id string 取引IDです。このオーソリゼーションが紐づく取引を示します。空の場合はそのオーソリゼーションを利用して取引登録がまだされていないことを示します。
    uri string オーソリゼーションURIです。すべてのリソースで一意の識別子として自動で付与されます。

    オーソリゼーションキャンセル

    コードサンプル

    curl -X DELETE https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id} \
      -H 'Accept: application/json'
      -H 'apikey: API_KEY'
    
    
    <?php
    
    require 'vendor/autoload.php';
    
    $headers = array(
        'Accept' => 'application/json',
        'apikey' => 'API_KEY',
    
        );
    
    $client = new \GuzzleHttp\Client();
    
    // Define array of request body.
    $request_body = '';
    
    try {
        $response = $client->request('DELETE','https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}', array(
            'headers' => $headers,
            'body' => $request_body,
           )
        );
        print_r($response->getBody()->getContents());
     }
     catch (\GuzzleHttp\Exception\BadResponseException $e) {
        // handle exception or api errors.
        print_r($e->getMessage());
     }
    
     // ...
    
    
    require 'net/http'
    require 'uri'
    
    uri = URI.parse("https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}")
    
    headers = {
      'Accept' => 'application/json',
      'apikey' => 'API_KEY'
    }
    
    req = Net::HTTP::Delete.new(uri, headers)
    
    req_options = {
        use_ssl: uri.scheme = "https"
    }
    
    response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
      res = http.request(req)
      p res
    end
    
    import requests
    headers = {
      'Accept': 'application/json',
      'apikey': 'API_KEY'
    }
    
    r = requests.delete('https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}', params={
    
    }, headers=headers)
    
    print(r.json())
    
    
    package main
    
    import (
           "bytes"
           "net/http"
    )
    
    func main() {
    
        headers := map[string][]string{
            "Accept": []string{"application/json"},
            "apikey": []string{"API_KEY"},
    
        }
    
        data := bytes.NewBuffer([]byte{``})
        req, err := http.NewRequest("DELETE", "https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}", data)
        if err != nil {
            // handle error
            return
        }
        req.Header = headers
    
        client := &http.Client{}
        resp, err := client.Do(req)
        if err != nil {
            // handle error
            return
        }
        // ...
    }
    
    
    const fetch = require('node-fetch');
    
    const headers = {
      'Accept':'application/json',
      'apikey':'API_KEY'
    };
    
    fetch('https://sandbox-api.mfkessai.co.jp/v2/authorizations/{authorization_id}',
    {
      method: 'DELETE',
      headers: headers
    })
    .then(function(res) {
        return res.json();
    }).then(function(body) {
        console.log(body);
    });
    
    

    /authorizations/{authorization_id}

    オーソリゼーションの状態によってはキャンセルができない場合もあります。

    PathParameters

    項目名 説明
    authorization_id
    required
    string 対象のオーソリゼーションIDを指定してください。

    レスポンス例

    200 Response

    {
      "amount": 10000,
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "credit_facility_id": "4N3W-ER7N",
      "customer_id": "W463-AA6V",
      "expiration_date": "2019-06-16",
      "id": "9NR3-P9A6",
      "max_due_date": "2019-06-30",
      "number": "AUTHORIZATION001",
      "object": "authorization",
      "status": "active",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:authorization:9NR3-P9A6"
    }
    

    Responses

    ステータス 説明
    200 キャンセルしたオーソリゼーションが返却されます。
    400 リクエスト内容の不備によるエラーです。エラー内容を確認してください。
    409 キャンセルしようとしたオーソリゼーションがキャンセルできない状態の場合のエラーです。

    Status Code 200

    項目名 説明
    amount integer オーソリゼーション金額です。税込金額になります。
    canceled_at string(date-time) オーソリゼーションがキャンセルされた日時です。未キャンセルの場合は空になります。
    created_at string(date-time) オーソリゼーションが登録された日時を示します。
    credit_facility_id string 与信枠IDです。このオーソリゼーションが紐づく与信枠を示します。
    customer_id string 顧客IDです。このオーソリゼーションが紐づく顧客を示します。
    expiration_date string(date) 有効期限日です。この日付を含む有効期間中はこのオーソリゼーションを利用して取引登録ができます。
    id string オーソリゼーションIDです。一意の識別子として自動で付与されます。
    max_due_date string(date) このオーソリゼーションを利用して取引登録する際に指定可能な最大支払期限です。
    number string オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずauthorizationが入ります。
    status string オーソリゼーションステータスです。アクティブ(active)、有効期限切れ(expired)、取引登録済み(captured)、キャンセル済み(canceled)があります。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    transaction_id string 取引IDです。このオーソリゼーションが紐づく取引を示します。空の場合はそのオーソリゼーションを利用して取引登録がまだされていないことを示します。
    uri string オーソリゼーションURIです。すべてのリソースで一意の識別子として自動で付与されます。

    WebHook

    WebHookとは、Money Forward Kessaiから売り手様のシステムへ各種イベントの通知を行う仕組みです。 エンドポイントを設定することで、逐次確認しなければならなかった審査完了などのイベント通知を受信することができます。

    イベントの通知はHTTP通信で行いますので、HTTPエンドポイントをご用意いただく必要があります。

    設定方法

    Money Forward Kessaiの管理画面から設定することができます。

    1.管理画面の右上のメニューから「開発者向け」を選択します。

    2.WebHookタブを選択します。現在設定しているエンドポイントがなければ新規追加画面へ遷移します。設定しているエンドポイントが既にある場合は設定一覧画面へ遷移するので右上の「新規エンドポイント追加」を押下します。

    3.WebHook通知を受信したいエンドポイントのURL・Secret・受信したいEventTypeを入力してください。

    べき等性

    WebHook通知は最低一回の通知を保証(at least once)しているため、2回以上同じ内容のリクエストが送信されることがあります。受信するエンドポイントでは複数回同じWebHook通知を受信しても処理結果が変わらないようにべき等性を確保してください。

    イベントID(event_id)をキーにして同じ内容のリクエストを判別することができます。

    正当性チェック

    #!/bin/bash
    
    SIGNATURE="43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e"
    
    SECRET="your secret"
    REQUEST_BODY='your request body'
    
    HASH=`echo -n $REQUEST_BODY | openssl dgst -sha256 -hmac $SECRET`
    
    if [ $HASH != $SIGNATURE ]; then
        echo "signature not matched"
        exit 1
    fi
    
    # ...
    
    <?php
    
    $signature = "43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e";
    $secret = "your secret"
    $requestBody = "your request body"
    
    $hash = hash_hmac("sha256", $requestBody, $secret);
    
    if ( $hash != $signature ) {
        print "signature not matched";
        return;
    }
    
    // ...
    
    require 'openssl'
    
    signature = "43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e";
    
    secretKey = "your secret"
    requestBody = 'your request body'
    
    hash = OpenSSL::HMAC.hexdigest('sha256', secretKey, requestBody)
    
    if hash != signature then
      puts "signature not matched"
      return
    end
    
    # ...
    
    import hashlib
    import hmac
    
    signature = "43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e"
    
    secret = b"your secret"
    requestBody = b"your request body"
    
    hash = hmac.new(secret, requestBody, hashlib.sha256).hexdigest()
    
    if hash != signature:
        print("signature not matched")
    
    # ...
    
    package main
    
    import (
        "crypto/hmac"
        "crypto/sha256"
        "encoding/hex"
        "fmt"
    )
    
    func main() {
        sig := "43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e"
    
        secret := []byte("your secret")
        requestBody := []byte("your request body")
    
        h := hmac.New(sha256.New, secret)
    
        // Write Data to it
        if _, err := h.Write(requestBody); err != nil {
            panic(err)
            return
        }
    
        if hex.EncodeToString(h.Sum(nil)) != sig {
            fmt.Println("signature not matched")
            return
        }
    
        // ...
    }
    
    const crypto = require('crypto')
    
    const signature = "43597a97960d4c05d4c4bc2fe5bf8ffbb7b38d844b2dda9927ca62afe1b0fe0e"
    
    const secretKey = 'your secret'
    const requestBody = 'your request body'
    
    const hmac = crypto.createHmac('sha256', secretKey)
    hmac.update(requestBody)
    
    if ( hmac.digest('hex') != signature ) {
        console.log("signature not matched")
        return
    }
    
    // ...
    

    受信したリクエストがMoney Forward Kessaiからのリクエストである正当性を確認するために x-mfkessai-signatureをHTTPヘッダーとして送信しています。 これと設定したSecretを利用してリクエストが改変されていないことを確認してください。

    以下の手順で正当性を確認します。

    1. リクエストボディをHMAC(SHA256)を利用し、設定したSecretをキーとしてハッシュ値を計算します。
    2. 計算したハッシュ値をHEXエンコードします。
    3. x-mfkessai-signatureが同一であることを確認します。

    再送について

    設定されましたエンドポイントへのHTTPリクエスト後に以下の条件のレスポンスが返却された場合はWebHookの送信に失敗したとみなし再送を行います。

    次回再送までの時間は指数バックオフポリシーに則り、最大5回まで以下のルールに従って行われます。

    再送回数 前回試行からの時間(hour) 初回試行からの時間(hour)
    0 1 1
    1 2 3
    2 4 7
    3 8 15
    4 16 31

    5回の再送を行い計6回のリクエストが全て失敗した場合にはその失敗したイベントに対しての送信を終了します。 再送時には全く同じリクエスト内容が送信されるので、べき等性を確保してください。

    また、以下のHTTP Headerも利用できます。

    キー 説明
    x-mfkessai-retry-number 再送回数です。初回は0となります。
    x-mfkessai-event-id イベントIDです。冪等制御に利用できます。

    与信枠審査完了イベント

    {
      "event_id": "9NV9-PVP6",
      "type": "customer_examination.examined",
      "customer_examination_id": "6GV7-PE7N",
      "customer_id": "M9R6-MVNV",
      "result": "passed",
      "created_at": "2019-10-30T10:20:18+09:00"
    }
    

    与信枠審査完了イベントです。

    項目名 説明
    event_id string イベントIDです。全てのイベントで一意になります。
    type string イベントタイプです。ここでは必ずcustomer_examination.examinedとなります。
    customer_examination_id string 与信枠審査IDです。対象の与信枠審査を示します。
    customer_id string 顧客IDです。与信枠審査の対象顧客を示します。
    result string 審査結果です。通過passed, 否決rejectedのいずれかとなります。
    created_at string(date-time) イベント発生日時です。

    取引審査完了イベント

    {
      "event_id": "GM6Y-9W6V",
      "type": "transaction.examined",
      "transaction_id": "6E9E-P436",
      "transaction_number": "transaction-00001",
      "result": "passed",
      "created_at": "2019-10-30T10:35:08+09:00"
    }
    

    取引審査完了イベントです。

    項目名 説明
    event_id string イベントIDです。全てのイベントで一意になります。
    type string イベントタイプです。ここでは必ずtransaction.examinedとなります。
    transaction_id string 取引IDです。対象の取引を示します。
    transaction_number string 取引番号です。対象の取引を示します。
    result string 審査結果です。通過passed, 否決rejectedのいずれかとなります。
    created_at string(date-time) イベント発生日時です。

    請求書発行イベント

    {
      "event_id": "GM6Y-9W6V",
      "type": "invoice.issued",
      "invoice_id": "M9R6-MVNV",
      "billing_id": "MW4N-3ANV",
      "created_at": "2019-10-30T10:35:08+09:00"
    }
    

    請求書発行イベントです。口座振替を設定されている顧客への口座振替通知書は含まれません。 またこれは請求書が顧客に届いた送付日ではありません。詳しくは請求書発行日とはを参照ください。

    項目名 説明
    event_id string イベントIDです。全てのイベントで一意になります。
    type string イベントタイプです。ここでは必ずinvoice.issuedとなります。
    invoice_id string 請求書IDです。対象の請求書を示します。これはbilling_idとは異なり、請求書ごとに付与され記載されるIDです。再発行により一つの請求billingに対して複数の請求書が発行されることがあります。
    billing_id string 請求IDです。対象の請求を示します。
    created_at string(date-time) イベント発生日時です。

    顧客名変更申請完了イベント

    {
      "event_id": "9NV9-PVP6",
      "type": "customer_name_update.examined",
      "customer_name_update_id": "6GV7-PE7N",
      "customer_id": "M9R6-MVNV",
      "result": "passed",
      "created_at": "2019-10-30T10:20:18+09:00"
    }
    

    顧客名変更申請完了イベントです。

    項目名 説明
    event_id string イベントIDです。全てのイベントで一意になります。
    type string イベントタイプです。ここでは必ずcustomer_name_update.examinedとなります。
    customer_name_update_id string 顧客名変更申請IDです。対象の顧客名変更申請を示します。
    customer_id string 顧客IDです。顧客名変更申請の対象顧客を示します。
    result string 審査結果です。通過passed, 否決rejectedのいずれかとなります。
    created_at string(date-time) イベント発生日時です。

    Object

    Error

    {
      "code": "invalid_after",
      "message": "parameter must be a valid one.",
      "param": "9R6M-VMAN"
    }
    
    

    エラー内容の詳細です。4xxのエラーコードとともに返却されます。

    Property

    項目名 説明
    code string エラーコードです。それぞれの説明については、エラーコードを参照してください。
    値は以下のうちの一つになります。
    • unavailable_seller
    • not_found
    • request_canceled
    • already_exists
    • seller_setting_required
    • forbidden_seller
    • invalid_json_format
    • invalid_after
    • invalid_before
    • invalid_limit
    • out_of_range_by_after
    • out_of_range_by_before
    • invalid_amount_per_tax_rate_type_amount
    • invalid_amount_per_tax_rate_type_tax_rate_type
    • invalid_created_at_from
    • invalid_created_at_to
    • invalid_canceled_at_from
    • invalid_canceled_at_to
    • invalid_accepted_at_from
    • invalid_accepted_at_to
    • invalid_account_transfer_notification_id
    • invalid_authorization_amount
    • invalid_authorization_canceled
    • invalid_authorization_captured
    • invalid_authorization_credit_facility_balance_shortage
    • invalid_authorization_expired
    • invalid_authorization_id
    • invalid_authorization_not_available
    • invalid_authorization_not_found
    • invalid_authorization_not_matched
    • invalid_authorization_number
    • invalid_authorization_over_amount
    • invalid_authorization_over_due_date
    • invalid_authorization_status
    • invalid_billing_accepted_at_from
    • invalid_billing_accepted_at_to
    • invalid_canceled_transaction_already_used
    • invalid_canceled_transaction_canceled_in_effective_period
    • invalid_canceled_transaction_customer_not_matched
    • invalid_canceled_transaction_expired
    • invalid_canceled_transaction_id
    • invalid_canceled_transaction_inherited
    • invalid_canceled_transaction_not_found
    • invalid_canceled_transaction_not_accepted
    • invalid_canceled_transaction_not_available
    • invalid_canceled_transaction_not_canceled
    • invalid_canceled_transaction_over_amount
    • invalid_content_type
    • invalid_customer_destination
    • invalid_customer_has_alert
    • invalid_customer_id
    • invalid_customer_ids
    • invalid_customer_name
    • invalid_customer_number
    • invalid_customer_payment_method
    • invalid_customer_account_transfer_request_address1
    • invalid_customer_account_transfer_request_address2
    • invalid_customer_account_transfer_request_department
    • invalid_customer_account_transfer_request_email
    • invalid_customer_account_transfer_request_name
    • invalid_customer_account_transfer_request_tel
    • invalid_customer_account_transfer_request_title
    • invalid_customer_account_transfer_request_zip_code
    • invalid_destination_address1
    • invalid_destination_address2
    • invalid_destination_cc_emails
    • invalid_destination_department
    • invalid_destination_email
    • invalid_destination_id
    • invalid_destination_name
    • invalid_destination_name_kana
    • invalid_destination_tel
    • invalid_destination_title
    • invalid_destination_zip_code
    • invalid_customer_examination_id
    • invalid_customer_examination_address1
    • invalid_customer_examination_address2
    • invalid_customer_examination_amount
    • invalid_customer_examination_amount_with_balance
    • invalid_customer_examination_business_description
    • invalid_customer_examination_business_type
    • invalid_customer_examination_corporate_number
    • invalid_customer_examination_email
    • invalid_customer_examination_end_date
    • invalid_customer_examination_remark
    • invalid_customer_examination_representative_name
    • invalid_customer_examination_status
    • invalid_customer_examination_tel
    • invalid_customer_examination_website
    • invalid_customer_examination_zip_code
    • invalid_credit_facility_end_date_from
    • invalid_credit_facility_end_date_to
    • invalid_credit_facility_id
    • invalid_credit_facility_start_date_from
    • invalid_credit_facility_start_date_to
    • invalid_credit_facility_status
    • invalid_customer_name_update_id
    • invalid_customer_name_update_not_found
    • invalid_customer_name_update_status
    • invalid_customer_name_update_name
    • invalid_customer_name_update_reason
    • invalid_customer_name_update_under_examination
    • invalid_invoice_id
    • invalid_transaction_amount
    • invalid_transaction_amounts_per_tax_rate_type
    • invalid_transaction_billing
    • invalid_transaction_billing_condition
    • invalid_transaction_details
    • invalid_transaction_details_amount_total
    • invalid_transaction_detail_amount
    • invalid_transaction_detail_description
    • invalid_transaction_detail_quantity
    • invalid_transaction_detail_tax_included_type
    • invalid_transaction_detail_tax_rate_type
    • invalid_transaction_detail_unit_price
    • invalid_transaction_date
    • invalid_transaction_date_from
    • invalid_transaction_date_to
    • invalid_transaction_due_date
    • invalid_transaction_duplicate_invoice_delivery_method
    • invalid_transaction_multiple_inheritable_options
    • invalid_transaction_invoice_delivery_methods
    • invalid_transaction_issue_date
    • invalid_transaction_id
    • invalid_transaction_number
    • invalid_transaction_status
    • not_cancelable_transaction_status
    • invalid_billing_due_date_from
    • invalid_billing_due_date_to
    • invalid_billing_id
    • invalid_billing_issue_date_from
    • invalid_billing_issue_date_to
    • invalid_billing_status
    • invalid_billing_unpaid
    • invalid_payout_date_from
    • invalid_payout_date_to
    • invalid_payout_id
    • invalid_payout_status
    • invalid_payout_transaction_id
    • invalid_reissuing_billing_canceled
    • invalid_reissuing_billing_not_issued
    • invalid_reissuing_payload_customer_not_matched
    • invalid_reissuing_payload_destination_not_found
    • invalid_reissuing_payload_duplicated_invoice_delivery_methods
    • invalid_reissuing_payload_invoice_delivery_methods
    • invalid_reissuing_unavailable
    message string エラー発生原因に関する情報です。
    param string 何らかの値に関連するエラーの場合その値が入ります。
    type string エラー種別です。
    値は以下のうちの一つになります。
    • already_exisits_error
    • conflict_operation_error
    • invalid_argument_error
    • not_found_error
    • rate_limit_error
    • request_canceled
    • unavailable_seller
    • seller_setting_required
    • forbidden

    Errors

    [
      {
        "code": "invalid_after",
        "message": "parameter must be a valid one.",
        "param": "9R6M-VMAN"
      }
    ]
    
    

    4xx系のエラーが発生した場合にエラー情報を返します。エラーObjectを配列として複数返します。

    Property

    項目名 説明
    - [Error] 4xx系のエラーが発生した場合にエラー情報を返します。エラーObjectを配列として複数返します。

    Pagination

    {
      "end": "7679-YW36",
      "has_next": true,
      "has_previous": false,
      "limit": 20,
      "start": "9R6M-VMAN",
      "total": 143
    }
    
    

    ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    Property

    項目名 説明
    end string この一覧に含まれるリソースのうち最後のリソースのIDです。次ページがある場合は、この値をクエリパラメーターafterに設定することで次ページを取得することができます。
    has_next boolean 次ページがある場合はtrue、ない場合はfalseが返却されます。
    has_previous boolean 前ページがある場合はtrue、ない場合はfalseが返却されます。
    limit integer ページ当たりの最大件数です。
    start string この一覧に含まれるリソースのうち最初のリソースのIDです。前ページがある場合は、この値をクエリパラメーターbeforeに設定することで前ページを取得することができます。
    total integer 条件に合致するリソースの全件数です。

    Customer

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "has_alert": false,
      "id": "7679-YW36",
      "name": "サンプル顧客",
      "number": "CUSTOEMR001",
      "object": "customer",
      "payment_method": {
        "bank_transfer": {
          "object": "bank_transfer",
          "account_number": "123456789",
          "bank_name": "MEKESSAI銀行",
          "branch_name": "大手町支店",
          "holder_name": "マネ-フオワ-ドケツサイ(カ",
          "type": "current"
        },
        "object": "payment_method"
      },
      "uri": "mfk:customer:7679-YW36"
    }
    
    

    顧客です。取引登録や与信枠取得などあらゆる機能を利用する起点となります。

    Property

    項目名 説明
    created_at string(date-time) 顧客が登録された日時を示します。
    has_alert boolean アラートの有無を示します。アラートがある場合はtrue、ない場合はfalseを返します。アラートがあると、自動で毎月付与されている与信枠が停止します。
    id string 顧客IDです。 Money Forward Kessaiによって発番される一意の識別子です。
    name string 顧客名です。
    number string 顧客に付与できる任意の顧客番号です。自動で付与される顧客IDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理される顧客間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずcustomerが入ります。
  • customer
  • payment_method PaymentMethod 顧客の支払方法です。口座振替(AccountTransfer)もしくは銀行振込(BankTransfer)のいずれかです。顧客の支払方法に応じたObjectが返却されます。 デフォルトでは銀行振込になっています。ただし、初回請求前には振込先口座が指定されていない場合があります。 口座振替に変更する場合には別途書面でのお手続きが必要であるため、サポートセンターへお問い合わせください。
    uri string 顧客URIです。すべてのリソースで一意の識別子として自動で付与されます。

    CustomerPayload

    {
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "department": "経理部",
        "email": "[email protected]",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "tel": "03-1234-5678",
        "title": "部長",
        "zip_code": "111-1111"
      },
      "customer_examination": {
        "amount": 20000,
        "initial_amount": 50000,
        "business_description": "クラウド型企業間決済サービス",
        "business_type": "corporate",
        "corporate_number": "1234567890123",
        "remark": "一部上場企業です。",
        "representative_name": "代表太郎",
        "website": "https://mfkessai.co.jp"
      },
      "name": "サンプル顧客",
      "number": "CUSTOMER0001"
    }
    
    

    顧客登録情報です。顧客登録時に利用します。顧客には必ず一つの請求先が必要であるため同時に請求先一件も登録します。

    Property

    項目名 説明
    destination
    required
    object 請求先情報です。
    » address1
    required
    Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    » address2 Address2 建物名・部屋番号などです。
    » cc_emails [Email]
    maxItems: 4
    請求書をメール送付する際のCCメールアドレスです。最大で4つまで指定できます。
    » department string
    maxLength: 50
    担当者の部署名です。
    » email
    required
    Email メールアドレスです。email形式で指定してください。
    » name string
    maxLength: 30
    担当者氏名です。
    » name_kana string
    maxLength: 60
    担当者名カナです。全角カタカナで入力してください。
    » tel
    required
    Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    » title string
    maxLength: 30
    担当者の役職です。
    » zip_code
    required
    ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。
    customer_examination object 与信枠審査申請情報です。与信枠審査申請で利用します
    » amount integer
    minimum: 1
    maximum: 150000000
    希望与信額です。審査通過の場合に付与される与信枠の金額になります。 現在与信枠が適用中の場合は、その与信額以下の金額は指定できません。0円を指定した場合は無視されます。 審査の結果減額されて与信枠付与されることもあります。
    » initial_amount integer
    minimum: 1
    maximum: 150000000
    初月希望与信額です。初月希望与信額についてはサポートページを確認してください。 0円を指定した場合は無視されます。審査の結果減額されて与信枠付与されることもあります。
    » business_description string
    maxLength: 500
    事業内容です。顧客の主なサービス、商材などを記載してください。
    » business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定してください。不明な場合は空にしてください。
    値は以下のうちの一つになります。
    • corporate
    • individual
    » corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ指定してください。
    » remark string
    maxLength: 500
    与信枠審査に利用できるその他情報を記載できます。
    » representative_name string
    maxLength: 30
    代表者氏名です。
    » website string
    maxLength: 500
    顧客企業のwebサイトです。
    name
    required
    string
    minLength: 1
    maxLength: 50
    顧客名です。
    number
    required
    string
    minLength: 1
    maxLength: 100
    顧客に付与できる任意の顧客番号です。Money Forward Kessaiが発番する顧客IDをとは別で、売り手様が独自に管理する識別子を登録することができます。 ただし、売り手様の所有する顧客間で一意である必要があります。

    CustomerUpdatePayload

    {
      "number": "CUSTOMER0001"
    }
    
    

    顧客更新情報です。顧客更新時に利用します。

    Property

    項目名 説明
    number string
    maxLength: 100
    顧客に付与できる任意の顧客番号です。Money Forward Kessaiが発番する顧客IDをとは別で、売り手様が独自に管理する識別子を登録することができます。 ただし、売り手様の所有する顧客間で一意である必要があります。指定がないか空文字の場合は更新されません。

    PaymentMethod

    {
      "account_transfer": {
        "object": "account_transfer"
      },
      "bank_transfer": {
        "account_number": "12345678",
        "bank_code": "0001",
        "bank_name": "MFKESSSAI銀行",
        "bank_name_kana": "エムエフケツサイ",
        "branch_code": "001",
        "branch_name": "大手町支店",
        "branch_name_kana": "オオテマチ",
        "object": "bank_transfer",
        "type": "current",
        "holder_name": "マネ-フオワ-ドケツサイ(カ"
      },
      "object": "payment_method"
    }
    
    

    顧客の支払方法です。口座振替(AccountTransfer)もしくは銀行振込(BankTransfer)のいずれかです。顧客の支払方法に応じたObjectが返却されます。 デフォルトでは銀行振込になっています。ただし、初回請求前には振込先口座が指定されていない場合があります。 口座振替に変更する場合には別途書面でのお手続きが必要であるため、サポートセンターへお問い合わせください。

    Property

    項目名 説明
    account_transfer AccountTransfer 口座振替に関する情報です。お支払方法が口座振替の顧客のみ利用できます。
    bank_transfer BankTransfer 銀行振込に関する情報です。お支払方法が銀行振込の顧客のみ利用できます。 初回請求前は振込先口座が未割当のため、object以外は空で返却されます。
    object string このObjectの種別を示します。ここでは必ずpayment_methodが入ります。
  • payment_method
  • AccountTransfer

    {
      "object": "account_transfer"
    }
    
    

    口座振替に関する情報です。お支払方法が口座振替の顧客のみ利用できます。

    Property

    項目名 説明
    object string このObjectの種別を示します。ここでは必ずaccount_transferが入ります。
  • account_transfer
  • BankTransfer

    {
      "account_number": "12345678",
      "bank_code": "0001",
      "bank_name": "MFKESSSAI銀行",
      "bank_name_kana": "エムエフケツサイ",
      "branch_code": "001",
      "branch_name": "大手町支店",
      "branch_name_kana": "オオテマチ",
      "object": "bank_transfer",
      "type": "current",
      "holder_name": "マネ-フオワ-ドケツサイ(カ"
    }
    
    

    銀行振込に関する情報です。お支払方法が銀行振込の顧客のみ利用できます。 初回請求前は振込先口座が未割当のため、object以外は空で返却されます。

    Property

    項目名 説明
    account_number string 振込先口座番号です。未割当の場合は空で返却されます。
    bank_code string 振込先銀行コードです。未割当の場合は空で返却されます。
    bank_name string 振込先銀行名です。未割当の場合は空で返却されます。
    bank_name_kana string 振込先銀行名フリガナです。未割当の場合は空で返却されます。
    branch_code string 振込先銀行支店コードです。未割当の場合は空で返却されます。
    branch_name string 振込先銀行支店名です。未割当の場合は空で返却されます。
    branch_name_kana string 振込先銀行支店名フリガナです。未割当の場合は空で返却されます。
    object string このObjectの種別を示します。ここでは必ずbank_transferが入ります。
  • bank_transfer
  • type string 振込先口座種別です。current(当座)、saving(普通)の2種類のうちどちらかになります。未割当の場合は空で返却されます。
    値は以下のうちの一つになります。
    • current
    • saving
    holder_name string 振込先口座名義です。必ずマネ-フオワ-ドケツサイ(カになります。未割当の場合は空で返却されます。

    Destination

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "id": "WNAV-37R6",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "object": "destination",
      "tel": "03-1234-5678",
      "title": "部長",
      "uri": "mfk:destination:WNAV-37R6",
      "zip_code": "111-1111"
    }
    
    

    請求先です。一つの顧客に対して複数作成することができます。請求先の情報を利用して請求書送付を行います。
    請求書の印字との対照についてはサポートページを確認してください。

    Property

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email] CCメールアドレスです。最大4件まで登録できます。
    created_at string(date-time) 請求先が登録された日時を示します。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    department string 担当者の部署名です。
    email Email メールアドレスです。email形式で指定してください。
    id string 請求先IDです。一意の識別子として自動で付与されます。
    name string 担当者名です。
    name_kana string 担当者名カナです。全角カタカナで入力してください。
    object string このObjectの種別を示します。ここでは必ずdestinationが入ります。
  • destination
  • tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string 担当者の役職です。
    uri string 請求先URIです。すべてのリソースで一意の識別子として自動で付与されます。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    DestinationPayload

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "customer_id": "7679-YW36",
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }
    
    

    請求先登録情報です。請求先登録時に利用します。一つの顧客に対して複数の請求先を登録できます。

    Property

    項目名 説明
    address1
    required
    Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email]
    maxItems: 4
    請求書をメール送付する際のCCメールアドレスです。最大で4件まで指定できます。
    customer_id
    required
    string
    minLength: 1
    請求先を登録する顧客のIDです。
    department string
    maxLength: 50
    担当者の部署名です。
    email
    required
    Email メールアドレスです。email形式で指定してください。
    name string
    maxLength: 30
    担当者氏名です。
    name_kana string
    maxLength: 60
    担当者名カナです。全角カタカナで入力してください。
    tel
    required
    Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string
    maxLength: 30
    担当者の役職です。
    zip_code
    required
    ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    DestinationUpdatePayload

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "cc_emails": [
        "[email protected]",
        "[email protected]"
      ],
      "department": "経理部",
      "email": "[email protected]",
      "name": "担当 太郎",
      "name_kana": "タントウ タロウ",
      "tel": "03-1234-5678",
      "title": "部長",
      "zip_code": "111-1111"
    }
    
    

    請求先更新情報です。請求先更新時に利用します。

    Property

    項目名 説明
    address1
    required
    Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    cc_emails [Email]
    maxItems: 4
    請求書をメール送付する際のCCメールアドレスです。最大で4件まで指定できます。
    department string
    maxLength: 50
    担当者の部署名です。
    email
    required
    Email メールアドレスです。email形式で指定してください。
    name string
    maxLength: 30
    担当者氏名です。
    name_kana string
    maxLength: 60
    担当者名カナです。全角カタカナで入力してください。
    tel
    required
    Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    title string
    maxLength: 30
    担当者の役職です。
    zip_code
    required
    ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    AccountTransferRequest

    {
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "email": "[email protected]",
      "tel": "03-1234-5678",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "object": "account_transfer_request"
    }
    
    

    口座振替依頼書の送付先情報です。

    Property

    項目名 説明
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    email Email メールアドレスです。email形式で指定してください。
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    department string 担当者の部署名です。
    title string 担当者の役職です。
    name string 担当者名です。
    object string このObjectの種別を示します。ここでは必ずaccount_transfer_requestが入ります。
  • account_transfer_request
  • AccountTransferRequestPayload

    {
      "zip_code": "111-1111",
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "department": "経理部",
      "title": "部長",
      "name": "担当 太郎",
      "tel": "03-1234-5678",
      "email": "[email protected]"
    }
    
    

    口座振替依頼申請情報です。口座振替依頼申請で利用します。

    Property

    項目名 説明
    zip_code
    required
    ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。
    address1
    required
    Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    department string
    maxLength: 50
    担当者の部署名です。
    title string
    maxLength: 30
    担当者の役職です。
    name string
    maxLength: 30
    担当者名です。
    tel
    required
    Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    email
    required
    Email メールアドレスです。email形式で指定してください。

    CustomerExamination

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "created_at": "2019-02-18T10:20:34+09:00",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "id": "WNAV-37R6",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "start_date": "2019-04-01",
      "status": "passed",
      "tel": "03-1234-5678",
      "type": "auto",
      "uri": "mfk:customer_examination:WNAV-37R6",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    
    

    与信枠審査です。顧客に対する与信枠取得のために利用します。申請後2営業日以内に審査いたします。 自動与信枠審査を利用している場合は顧客登録と同時に与信枠審査も申請されます。

    Property

    項目名 説明
    address1 Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    amount integer 希望与信額です。審査通過の場合に付与される与信枠の希望金額になります。審査の結果減額されて与信枠付与されることもあります。
    business_description string 事業内容です。顧客の主なサービス、商材などです。
    business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定されます。不明な場合は空になります。
    値は以下のうちの一つになります。
    • corporate
    • individual
    corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ利用されます。
    created_at string(date-time) 与信枠審査の申請日時です。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    email Email メールアドレスです。email形式で指定してください。
    end_date string(date) 希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠審査IDです。一意の識別子として自動で付与されます。
    remark string その他情報です。審査に利用できる情報を記載できます。
    representative_name string 代表者名です。
    start_date string(date) 希望取引登録期間開始日。この日付から対象の与信枠を利用して取引登録ができます。 手動での申請の場合、審査通過日となるため空で返却されます。自動与信枠審査による申請の場合は、月次での与信枠付与になり対象月の月初日となります。
    status string
    maxLength: 60
    与信枠審査ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)があります。審査通過の場合には与信枠が付与されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    tel Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    type string 申請理由の種別です。手動(manual)、自動(auto)、回復(recovery)があります。手動(manual)には増枠申請と手動回復審査申請が含まれます。
    値は以下のうちの一つになります。
    • manual
    • auto
    • recovery
    object string このObjectの種別を示します。ここでは必ずcustomer_examinationが入ります。
  • customer_examination
  • uri string 与信枠審査URIです。すべてのリソースで一意の識別子として自動で付与されます。
    website string 顧客企業のwebサイトです。
    zip_code ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    CustomerExaminationPayload

    {
      "address1": "東京都千代田区1-2-3",
      "address2": "サンプルビル3F",
      "amount": 20000,
      "business_description": "クラウド型企業間決済サービス",
      "business_type": "corporate",
      "corporate_number": "1234567890123",
      "customer_id": "7679-YW36",
      "email": "[email protected]",
      "end_date": "2019-04-30",
      "remark": "一部上場企業です。",
      "representative_name": "代表太郎",
      "tel": "03-1234-5678",
      "website": "https://mfkessai.co.jp",
      "zip_code": "111-1111"
    }
    
    

    与信枠審査申請情報です。与信枠審査申請で利用します。

    Property

    項目名 説明
    address1
    required
    Address1 都道府県・市区町村・番地です。必ず都道府県名から始めてください。
    address2 Address2 建物名・部屋番号などです。
    amount
    required
    integer
    minimum: 1
    maximum: 150000000
    希望与信額です。審査通過の場合に付与される与信枠の金額になります。現在与信枠が適用中の場合は、その与信額以下の金額は指定できません。 審査の結果減額されて与信枠付与されることもあります。
    business_description string
    maxLength: 500
    事業内容です。顧客の主なサービス、商材などを記載してください。
    business_type string 事業所区分です。法人(corporate)または、個人(individual)で指定してください。不明な場合は空にしてください。
    値は以下のうちの一つになります。
    • corporate
    • individual
    corporate_number string 法人番号です。事業所区分(business_type)が法人(corporate)の場合にのみ指定してください。
    customer_id
    required
    string
    minLength: 1
    与信枠審査を申請する顧客のIDです。
    email
    required
    Email メールアドレスです。email形式で指定してください。
    end_date
    required
    string(date) 希望取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。 直近三ヶ月の月末のみ指定できます。
    remark string
    maxLength: 500
    与信枠審査に利用できるその他情報を記載できます。
    Sandbox環境において与信枠審査で任意の結果を指定するためにこの値を用います。詳しくは審査結果の操作を参照ください。
    representative_name string
    maxLength: 30
    代表者氏名です。
    tel
    required
    Tel 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)
    website string
    maxLength: 500
    顧客企業のwebサイトです。
    zip_code
    required
    ZipCode 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    CreditFacility

    {
      "amount": 200000,
      "balance": 100000,
      "customer_examination_id": "WNAV-37R6",
      "customer_id": "9R6M-VMAN",
      "end_date": "2019-04-30",
      "id": "7679-YW36",
      "start_date": "2019-04-01",
      "status": "inactive",
      "uri": "mfk:credit_facility:7679-YW36"
    }
    
    

    顧客の与信枠です。この枠内の取引登録であれば取引審査なしで登録することができます。

    Property

    項目名 説明
    amount integer 与信額です。取引登録期間(start_date~end_date)にこの金額までの取引であれば取引審査なしで登録することができます。
    balance integer 与信額残高です。与信額からこの与信枠を利用して登録された取引の合計金額を差し引いた金額です。現在与信枠を利用して登録できる取引金額を示しています。
    customer_id string 顧客IDです。一意の識別子として自動で付与されます。
    customer_examination_id string 与信枠審査IDです。
    end_date string(date) 取引登録期間終了日です。この日付まで対象の与信枠を利用して取引登録ができます。
    id string 与信枠IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずcredit_facilityが入ります。
  • credit_facility
  • start_date string(date) 取引登録期間開始日です。この日付から対象の与信枠を利用して取引登録ができます。
    status string 与信枠ステータスです。未適用(inactive)、適用中(active)、期限切れ(expired)があります。 現在の日付がstart_date~end_dateの期間内であればactivestart_dateよりも前であればinactiveend_dateを過ぎていればexpiredになります。
    値は以下のうちの一つになります。
    • inactive
    • active
    • expired
    uri string 与信枠URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Transaction

    {
      "accepted_at": "2019-04-03T10:36:43+09:00",
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "billing": true,
      "billing_accepted_at": "2019-04-22T10:36:43+09:00",
      "billing_condition": "passed",
      "billing_id": "9R6M-VMAN",
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "9PNG-VYR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "id": "7679-YW36",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "object": "transaction",
      "status": "passed",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": -1,
          "unit_price": 1000
        }
      ],
      "uri": "mfk:transaction:7679-YW36"
    }
    
    

    取引です。

    Property

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 取引金額です。税込金額になります。
    請求モードの設定によって値が変わります。
    - 区分記載請求書モード:TransactionPayload.amountで指定した金額
    - インボイスモード(請求単位):弊社システムにて算出した金額
    - インボイスモード(取引単位):TransactionPayload.amountで指定した金額
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    請求モードの設定によって値が変わります。各税率種別の取引明細行の小計を合計した値の税込金額になっています。
    - 区分記載請求書モード:TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    - インボイスモード(請求単位):空の配列
    - インボイスモード(取引単位):TransactionPayload.amounts_per_tax_rate_typeで指定した金額
    billing boolean 請求対象であるかをboolean値で表します。trueの場合請求対象で、falseの場合は請求対象ではないことを表します。
    billing_accepted_at string(date-time) 請求依頼受領日時です。請求対象になった日時を表します。請求対象でない場合は空になります。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    billing_id string 請求IDです。請求書にまとめられる単位のIDです。同じ請求IDを持つ取引とまとめられて請求書に記載されます。
    canceled_at string(date-time) 取引がキャンセルされた日時です。未キャンセルの場合は空になります。
    canceled_transaction_id string 先行してキャンセルし与信に利用したキャンセル済み取引のIDです。キャンセル取引を利用していない場合は空になります。
    created_at string(date-time) 取引が登録された日時です。
    customer_id string 顧客IDです。
    destination_id string 請求先IDです。取引の請求先を示します。
    date string(date) 取引日です。売り手様と顧客様の間で取引を行った日付です。
    due_date string(date) 支払期限です。この日付を超えてMoney Forward Kessaiへの入金が確認できない場合は未入金になります。
    id string 取引IDです。一意の識別子として自動で付与されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date string(date) 請求書発行日です。請求書発送日については請求書発行日についてを参照ください。
    number string 取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    object string このObjectの種別を示します。ここでは必ずtransactionが入ります。
  • transaction
  • status string 取引ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、キャンセル済(canceled)があります。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    transaction_details [TransactionDetail] 取引明細行です。
    uri string 取引URIです。すべてのリソースで一意の識別子として自動で付与されます。

    TransactionDetail

    {
      "amount": 3000,
      "description": "商品名A",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    }
    
    

    取引明細です。請求書に記載される明細行になります。

    Property

    項目名 説明
    amount number 小計です。単価(unit_price)×数量(quantity)の金額、またはその税込金額です。
    description string 商品名などです。
    object string このObjectの種別を示します。ここでは必ずtransaction_detailが入ります。
  • transaction_detail
  • tax_rate_type TaxRateType 税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    unit_price number 単価です。
    quantity number 数量です。
    tax_included_type TaxIncludedType 取引明細の単価(unit_price), 小計(amount)の値が税込(included)か税抜(excluded)かを示します。返り値が空の場合は旧形式での登録時に指定されなかったことを表します。

    TransactionPayload

    {
      "amount": 5440,
      "amounts_per_tax_rate_type": [
        {
          "amount": 2200,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 3240,
          "tax_rate_type": "reduced_8"
        }
      ],
      "authorization_id": "WNAV-37R6",
      "billing_condition": "passed",
      "canceled_transaction_id": "79NR-9WR6",
      "date": "2019-04-10",
      "destination_id": "WNAV-37R6",
      "due_date": "2019-04-30",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "issue_date": "2019-04-20",
      "number": "Transaction-0001",
      "transaction_details": [
        {
          "amount": 3000,
          "description": "商品名A",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": 3000,
          "description": "商品名B",
          "tax_included_type": "excluded",
          "tax_rate_type": "reduced_8",
          "quantity": 3,
          "unit_price": 1000
        },
        {
          "amount": -1000,
          "description": "商品名A 返品",
          "tax_included_type": "excluded",
          "tax_rate_type": "normal_10",
          "quantity": 1,
          "unit_price": -1000
        }
      ]
    }
    
    

    取引登録情報です。取引登録で利用します。

    Property

    項目名 説明
    amount integer
    minimum: 1
    maximum: 2147483647
    取引の税込合計金額です。各課税種別毎の税込金額(amounts_per_tax_rate_type)の合計である必要があります。
    負の値を指定することはできません。また、複数取引が請求としてまとまる際に請求金額が2147483647円を超えないようにする必要があります。
    請求モードの設定によって項目の要否が変わります。
    - 区分記載請求書モード:必須項目
    - インボイスモード(請求単位):任意項目
    - インボイスモード(取引単位):必須項目
    amounts_per_tax_rate_type [AmountPerTaxRateType]
    minItems: 1
    各課税種別毎の税込の合計金額です。各課税種別の取引明細行の小計を合計した値の税込金額になっていなければなりません。
    請求モードの設定によって項目の要否が変わります。
    - 区分記載請求書モード:必須項目
    - インボイスモード(請求単位):任意項目
    - インボイスモード(取引単位):必須項目
    authorization_id string
    minLength: 1
    オーソリゼーションIDです。事前に取得したオーソリゼーションを指定してください。利用できないオーソリゼーションである場合は取引登録もできません。 canceled_transaction_idと同時に指定はできません。
    billing_condition BillingCondition 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    canceled_transaction_id string
    minLength: 1
    先行してキャンセルした取引のIDです。与信に利用するキャンセル済み取引を指定します。指定された場合、キャンセル済み取引の与信を利用して審査を行います。利用できないキャンセル取引である場合は取引登録もできません。 authorization_idと同時に指定はできません。(本フィールドを利用する場合は審査が必要になります。利用をご希望の場合は営業担当までご連絡ください。)
    date
    required
    string(date) 取引日です。売り手様と顧客の間で取引を行った日付を指定してください。
    destination_id
    required
    string
    minLength: 1
    請求先IDです。取引の請求先を指定してください。
    due_date
    required
    string(date) 支払期限です。
    取引登録時の制約事項についてはサポートページを確認してください。
    invoice_delivery_methods
    required
    [InvoiceDeliveryMethod]
    minItems: 1
    maxItems: 2
    請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    issue_date
    required
    string(date) 請求書発行日です。請求書が発行される日付を指定します。指定した日付が営業日でない場合は翌営業日になります。また、請求書送付日についてはこちらを参照ください。
    取引登録時の制約事項についてはサポートページを確認してください。
    number
    required
    string
    minLength: 1
    maxLength: 100
    取引に付与できる任意の取引番号です。Money Forward Kessaiが自動で付与する取引IDとは別で、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の所有する取引間で一意である必要があります。
    transaction_details
    required
    [TransactionDetailPayload]
    minItems: 1
    maxItems: 500
    取引明細行です。

    TransactionDetailPayload

    {
      "amount": 3000,
      "description": "商品名A",
      "tax_included_type": "excluded",
      "tax_rate_type": "normal_10",
      "quantity": 3,
      "unit_price": 1000
    }
    
    

    Property

    項目名 説明
    amount number
    minimum: -2147483648
    maximum: 2147483647
    multipleOf: 0.0001
    小計です。単価(unit_price)×数量(quantity)の金額を指定してください。またはその金額の税込金額も指定可能です。
    amount_str string
    minLength: 1
    maxLength: 16
    小計を文字列で指定してください。こちらが指定されている場合、数値型のamountは無視されます。単価(unit_price)×数量(quantity)の金額を指定してください。
    description
    required
    string
    minLength: 1
    maxLength: 250
    商品名などです。
    Sandbox環境において取引審査で任意の結果を指定するためにこの値を用います。詳しくは審査結果の操作を参照ください。
    tax_included_type
    required
    TaxIncludedType 取引明細の単価(unit_price), 小計(amount)の値が税込(included)か税抜(excluded)かを示します。返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    tax_rate_type
    required
    TaxRateType 税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    quantity number
    minimum: -2147483648
    maximum: 2147483647
    multipleOf: 0.0001
    数量を指定してください。
    quantity_str string
    minLength: 1
    maxLength: 16
    数量を文字列で指定してください。こちらが指定されている場合、数値型のquantityは無視されます。
    unit_price number
    minimum: -2147483648
    maximum: 2147483647
    multipleOf: 0.0001
    単価を指定してください。
    unit_price_str string
    minLength: 1
    maxLength: 16
    単価を文字列で指定してください。こちらが指定されている場合、数値型のunit_priceは無視されます。

    Billing

    {
      "account_transfer_notification_ids": [
        "7MW6-AW6A"
      ],
      "amount": 21800,
      "amounts_per_tax_rate_type": [
        {
          "amount": 11000,
          "tax_rate_type": "normal_10"
        },
        {
          "amount": 10800,
          "tax_rate_type": "reduced_8"
        }
      ],
      "customer_id": "WNAV-37R6",
      "destination_id": "7679-YW36",
      "due_date": "2019-04-30",
      "id": "9R6M-VMAN",
      "invoice_delivery_method": [
        "posting",
        "email"
      ],
      "invoice_ids": [
        "W47N-7WNM",
        "AY9N-VPN3"
      ],
      "issue_date": "2019-04-01",
      "object": "billing",
      "status": "scheduled",
      "unpaid": {
        "shortage_amount": 12000,
        "updated_date": "2019-04-30"
      },
      "uri": "mfk:billing:9R6M-VMAN"
    }
    
    

    請求です。取引のうち、請求先・支払期限・請求書発行日・取引登録方式が同一の取引が同じ請求にまとめられます。

    Property

    項目名 説明
    account_transfer_notification_ids [string] 口座振替通知書IDです。取引が紐づく口座振替通知書を示します。口座振替通知書が発行され次第非同期に値が追加されます。
    amount integer 請求の税込の合計金額です。区分記載請求書モードの請求では請求に含まれる取引金額の合計となり、インボイスモードの請求では含まれる全ての明細情報からインボイス制度の端数処理方法に則り算出した金額となります。インボイスモードでは審査中の取引を含んだ請求金額となり、請求対象の取引がなければ0になります。
    amounts_per_tax_rate_type [AmountPerTaxRateType] 各税率種別毎の税込の合計金額です。
    customer_id string 顧客IDです。請求の顧客を示します。
    destination_id string 請求先IDです。請求先を示します。
    due_date string(date) 支払期限です。
    id string 請求IDです。一意の識別子として自動で付与されます。請求先ID・支払期限・請求書発行日・取引登録方式が同一の取引がこの請求によってまとめられます。請求書は請求をもとに発行されます。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。
    invoice_ids [string] 請求書IDです。請求に紐づく請求書を示します。請求書が発行され次第非同期で値が追加されます。
    issue_date string(date) 請求書発行日です。請求書送付日についてはこちらをご参照ください。
    object string このObjectの種別を示します。ここでは必ずbillingが入ります。
  • billing
  • status string 請求ステータスです。請求予定(scheduled)、請求書発行済(invoice_issued) 、口座振替通知済(account_transfer_notified)、請求停止(stopped)で指定されます。 請求停止(stopped)は請求モードがインボイスモードの場合のみ返却されます。
    値は以下のうちの一つになります。
    • scheduled
    • invoice_issued
    • account_transfer_notified
    • stopped
    unpaid object 未入金情報です。請求に対して支払期限後未入金がある場合のみ返却されます。
    » shortage_amount integer 未入金額です。
    » updated_date string(date) 入金情報が最後に更新された日付です。この日付以降に入金されている可能性があります。
    uri string 請求URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Address1

    "東京都千代田区1-2-3"
    
    

    都道府県・市区町村・番地です。必ず都道府県名から始めてください。

    Property

    項目名 説明
    - string
    minLength: 1
    maxLength: 100
    都道府県・市区町村・番地です。必ず都道府県名から始めてください。

    Address2

    "サンプルビル3F"
    
    

    建物名・部屋番号などです。

    Property

    項目名 説明
    - string
    maxLength: 100
    建物名・部屋番号などです。

    Tel

    "03-1234-5678"
    
    

    電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)

    Property

    項目名 説明
    - string 電話番号です。ハイフン有無は任意になります。一部の形式は許容していません。(例:0570-XXX-XXX、0800-XXX-XXXXなど)

    ZipCode

    "111-1111"
    
    

    郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    Property

    項目名 説明
    - string 郵便番号です。ハイフン有無は任意になります。但しハイフン無しで登録されますと、請求書にもハイフン無しで記載されます。

    Email

    "[email protected]"
    
    

    メールアドレスです。email形式で指定してください。

    Property

    項目名 説明
    - string
    maxLength: 255
    メールアドレスです。email形式で指定してください。

    BillingCondition

    "passed"
    
    

    請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。

    Property

    項目名 説明
    - string 請求される条件です。登録時は審査結果に関わらずすべて請求する(all)、審査通過の取引のみ請求する(passed)のうちから選択してください。
    空の場合は管理画面の「請求対象の設定」で設定された条件で登録されます。請求対象について詳しくはこちらを参照ください。
    値は以下のうちの一つになります。
    • passed
    • all

    InvoiceDeliveryMethod

    "posting"
    
    

    請求書送付方法です。登録時は郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。

    Property

    項目名 説明
    - string 請求書送付方法です。登録時は郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。
    値は以下のうちの一つになります。
    • posting
    • email

    TaxRateType

    "normal_10"
    
    

    税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。

    Property

    項目名 説明
    - string 税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    値は以下のうちの一つになります。
    • non_taxable
    • normal_8
    • normal_10
    • reduced_8
    • transitional_measures_8
    • inapplicable

    AmountPerTaxRateType

    {
      "amount": 11000,
      "tax_rate_type": "normal_10"
    }
    
    

    各税率種別毎の税込の合計金額です。

    Property

    項目名 説明
    amount
    required
    integer
    minimum: -2147483648
    maximum: 2147483647
    対象税率種別毎の合計金額です。税込金額になります。
    tax_rate_type
    required
    TaxRateType 税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。

    TaxIncludedType

    "included"
    
    

    取引明細の単価(unit_price), 小計(amount)の値が税込(included)か税抜(excluded)かを示します。返り値が空の場合は旧形式での登録時に指定されなかったことを表します。

    Property

    項目名 説明
    - string 取引明細の単価(unit_price), 小計(amount)の値が税込(included)か税抜(excluded)かを示します。返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    値は以下のうちの一つになります。
    • included
    • excluded

    Payout

    {
      "amount": 300800,
      "collected_amount": 200000,
      "receivables_amount": 110000,
      "deduction": {
        "amount": 9400,
        "returned_credit_amount": 500,
        "tax_free": {
          "amount": 3200,
          "commission_amount": 2200,
          "early_payout_commission_amount": 1000
        },
        "taxable": {
          "amount": 7000,
          "convenience_billing": {
            "charge": 15000,
            "quantity": 100,
            "unit_price": 150
          },
          "basic_monthly_charge": 4500,
          "billing_charge": {
            "amount": 2000,
            "unit_price": 200,
            "quantity": 10
          },
          "posting": {
            "amount": 500,
            "unit_price": 100,
            "quantity": 5
          }
        },
        "tax": {
          "rate_type": "normal_10",
          "amount": 500
        },
        "untaxable": {
          "amount": 15000,
          "revenue_stamp": {
            "amount": 15000,
            "quantity": 100,
            "unit_price": 150
          }
        }
      },
      "id": "7679-YW36",
      "payout_date": "2019-07-29",
      "status": "completed",
      "type": "normal",
      "uri": "mfk:payout:7679-YW36"
    }
    
    

    Money Forward Kessaiから売り手様への金額確定済みの振込です。

    Property

    項目名 説明
    amount integer 振込金額です。
    collected_amount integer 振込の対象となる回収金額です。
    deduction Deduction 振込から控除される金額とその内訳です。
    id string 振込IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayoutが入ります。
  • payout
  • payout_date string(date) 振込予定日です。
    receivables_amount integer 振込の対象となる債権金額です。
    status string 振込ステータスです。振込手続中(in_progress)、振込完了(completed)があります。
    値は以下のうちの一つになります。
    • in_progress
    • completed
    type string 振込種別です。通常振込(normal)、早期振込(early)があります。
    値は以下のうちの一つになります。
    • normal
    • early
    uri string 振込URIです。すべてのリソースで一意の識別子として自動で付与されます。

    Deduction

    {
      "amount": 10000,
      "returned_credit_amount": 500,
      "tax": {
        "rate_type": "normal_10",
        "amount": 500
      },
      "taxable": {
        "amount": 20000,
        "convenience_billing": {
          "charge": 15000,
          "quantity": 100,
          "unit_price": 150
        },
        "basic_monthly_charge": 4500,
        "billing_charge": {
          "amount": 2000,
          "unit_price": 200,
          "quantity": 10
        },
        "posting": {
          "amount": 500,
          "unit_price": 100,
          "quantity": 5
        }
      },
      "tax_free": {
        "amount": 4000,
        "commission_amout": 3000,
        "early_payout_commission_amount": 1000
      },
      "untaxable": {
        "amount": 15000,
        "revenue_stamp": {
          "amount": 15000,
          "quantity": 100,
          "unit_price": 150
        }
      }
    }
    
    

    振込から控除される金額とその内訳です。

    Property

    項目名 説明
    amount integer 債権合計額から控除される合計金額です。
    canceled_reconciliation_amount integer 入金消込の解除による回収金額の返金額です。
    returned_credit_amount integer キャンセルによる債権金額の返金額です。
    tax object 消費税です。
    » amount integer 消費税額です。
    » rate_type TaxRateType 税率種別です。登録時は非課税(non_taxable)、消費税8%(normal_8)、消費税10%(normal_10)、軽減税率8%(reduced_8)、経過措置8%(transitional_measures_8)、対象外(inapplicable)のうちいずれかを指定してください。 返り値が空の場合は旧形式での登録時に指定されなかったことを表します。
    taxable object 課税対象の控除金額とその内訳です。郵送料と月額基本料が課税対象となります。
    » amount integer 課税対象の控除金額です。
    » basic_monthly_charge integer 月額基本料金です。
    » billing_charge object 付随請求業務手数料とその内訳です。
    »» amount integer 付随請求業務手数料です。
    »» quantity integer 請求件数です。
    »» unit_price integer 請求1件あたりの付随請求業務手数料です。
    » posting object 郵送料金とその内訳です。
    »» amount integer 郵送料です。
    »» quantity integer 郵送件数です。
    »» unit_price integer 郵送1件あたりの郵送料です。
    » convenience_billing object コンビニ払込手数料とその内訳です。
    »» charge integer コンビニ払込手数料です。
    »» quantity integer コンビニ払込件数です。
    »» unit_price integer コンビニ払込1件あたりの手数料です。
    » tax_free object 非課税の控除金額とその内訳です。手数料と早期振込手数料が非課税となります。
    »» amount integer 非課税の控除金額です。
    »» commission_amount integer 手数料の金額です。
    »» early_payout_commission_amount integer 早期振込手数料の金額です。
    » untaxable object 不課税の控除金額とその内訳です。収入印紙代が不課税となります。
    »» amount integer 不課税の控除金額です。
    »» revenue_stamp object 収入印紙代とその内訳です。
    »»» amount integer 収入印紙代です。
    »»» quantity integer 収入印紙件数です。
    »»» unit_price integer 収入印紙1件あたりの料金です。

    PayoutTransaction

    {
      "accepted_at": "2019-04-01T10:36:43+09:00",
      "amount": 10000,
      "commission_amount": 200,
      "commission_rate": 2,
      "early_payout_commission_amount": 400,
      "early_payout_commission_rate": 4,
      "id": "9NR3-P9A6",
      "payout_date": "2019-04-15",
      "payout_id": "7679-YW36",
      "standard_payout_date": "2019-05-01",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:payout_transaction:9NR3-P9A6"
    }
    
    

    売り手様へ振込に紐づく債権です。

    Property

    項目名 説明
    accepted_at string(date-time) 債権譲受日時です。
    amount integer 債権金額です。
    commission_amount integer 手数料の金額です。
    commission_rate number 手数料率です。
    early_payout_commission_amount integer 早期振込手数料です。
    early_payout_commission_rate number 早期振込手数料率です。
    id string 債権IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayout_transactionが入ります。
  • payout_transaction
  • payout_date string(date) 振込予定日です。早期振込の場合、standard_payout_dateよりも早くなります。
    payout_id string 債権が含まれる振込のIDです。
    standard_payout_date string(date) 通常の振込予定日です。
    transaction_id string 取引IDです。この債権が紐づく取引を示します。
    uri string 債権URIです。すべてのリソースで一意の識別子として自動で付与されます。

    PayoutRefund

    {
      "amount": 10000,
      "commission_amount": 100,
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "object": "payout_refund",
      "payout_id": "7679-YW36",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:payout_refund:9NR3-P9A6"
    }
    
    

    売り手さまへの振込金額確定後に発生した取引キャンセルに伴う返金です。

    Property

    項目名 説明
    amount integer 返金金額です。
    commission_amount integer 手数料の金額です。
    customer_id string 顧客IDです。この返金が紐づく顧客を示します。
    id string 返金IDです。一意の識別子として自動で付与されます。
    object string このObjectの種別を示します。ここでは必ずpayout_refundが入ります。
  • payout_refund
  • payout_id string 返金が含まれる振込のIDです。
    transaction_id string 取引IDです。この返金が紐づく取引を示します。
    uri string 返金URIです。すべてのリソースで一意の識別子として自動で付与されます。

    CustomersList

    {
      "items": [
        {
          "created_at": "2019-04-01T10:36:43+09:00",
          "has_alert": false,
          "id": "7679-YW36",
          "name": "サンプル顧客",
          "number": "CUSTOEMR001",
          "object": "customer",
          "payment_method": {
            "bank_transfer": {
              "object": "bank_transfer",
              "account_number": "123456789",
              "bank_name": "MEKESSAI銀行",
              "branch_name": "大手町支店",
              "holder_name": "マネ-フオワ-ドケツサイ(カ",
              "type": "current"
            },
            "object": "payment_method"
          },
          "uri": "mfk:customer:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Customer] 条件に該当する顧客の一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    DestinationsList

    {
      "items": [
        {
          "address1": "東京都千代田区1-2-3",
          "address2": "サンプルビル3F",
          "cc_emails": [
            "[email protected]",
            "[email protected]"
          ],
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "7679-YW36",
          "department": "経理部",
          "email": "[email protected]",
          "id": "WNAV-37R6",
          "name": "担当 太郎",
          "name_kana": "タントウ タロウ",
          "object": "destination",
          "tel": "03-1234-5678",
          "title": "部長",
          "uri": "mfk:destination:WNAV-37R6",
          "zip_code": "111-1111"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Destination] 請求先一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    CustomerExaminationsList

    {
      "items": [
        {
          "address1": "東京都千代田区1-2-3",
          "address2": "サンプルビル3F",
          "amount": 20000,
          "business_description": "クラウド型企業間決済サービス",
          "business_type": "corporate",
          "corporate_number": "1234567890123",
          "created_at": "2019-02-18T10:20:34+09:00",
          "customer_id": "7679-YW36",
          "email": "[email protected]",
          "end_date": "2019-04-30",
          "id": "WNAV-37R6",
          "remark": "一部上場企業です。",
          "representative_name": "代表太郎",
          "start_date": "2019-04-01",
          "status": "passed",
          "tel": "03-1234-5678",
          "type": "auto",
          "uri": "mfk:customer_examination:WNAV-37R6",
          "website": "https://mfkessai.co.jp",
          "zip_code": "111-1111"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [CustomerExamination] 与信枠審査一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    CreditFacilitiesList

    {
      "items": [
        {
          "amount": 200000,
          "balance": 100000,
          "customer_examination_id": "WNAV-37R6",
          "customer_id": "9R6M-VMAN",
          "end_date": "2019-04-30",
          "id": "7679-YW36",
          "start_date": "2019-04-01",
          "status": "inactive",
          "uri": "mfk:credit_facility:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [CreditFacility] 与信枠一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    TransactionsList

    {
      "items": [
        {
          "accepted_at": "2019-04-03T10:36:43+09:00",
          "amount": 5440,
          "amounts_per_tax_rate_type": [
            {
              "amount": 2200,
              "tax_rate_type": "normal_10"
            },
            {
              "amount": 3240,
              "tax_rate_type": "reduced_8"
            }
          ],
          "billing": true,
          "billing_accepted_at": "2019-04-22T10:36:43+09:00",
          "billing_condition": "passed",
          "billing_id": "9R6M-VMAN",
          "canceled_at": "2019-04-22T10:36:43+09:00",
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "9PNG-VYR6",
          "date": "2019-04-10",
          "destination_id": "WNAV-37R6",
          "due_date": "2019-04-30",
          "id": "7679-YW36",
          "invoice_delivery_method": [
            "posting",
            "email"
          ],
          "issue_date": "2019-04-20",
          "number": "Transaction-0001",
          "object": "transaction",
          "status": "passed",
          "transaction_details": [
            {
              "amount": 3000,
              "description": "商品名A",
              "tax_included_type": "excluded",
              "tax_rate_type": "normal_10",
              "quantity": 3,
              "unit_price": 1000
            },
            {
              "amount": 3000,
              "description": "商品名B",
              "tax_included_type": "excluded",
              "tax_rate_type": "reduced_8",
              "quantity": 3,
              "unit_price": 1000
            },
            {
              "amount": -1000,
              "description": "商品名A 返品",
              "tax_included_type": "excluded",
              "tax_rate_type": "normal_10",
              "quantity": -1,
              "unit_price": 1000
            }
          ],
          "uri": "mfk:transaction:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Transaction] 取引一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    BillingsList

    {
      "items": [
        {
          "account_transfer_notification_ids": [
            "7MW6-AW6A"
          ],
          "amount": 21800,
          "amounts_per_tax_rate_type": [
            {
              "amount": 11000,
              "tax_rate_type": "normal_10"
            },
            {
              "amount": 10800,
              "tax_rate_type": "reduced_8"
            }
          ],
          "customer_id": "WNAV-37R6",
          "destination_id": "7679-YW36",
          "due_date": "2019-04-30",
          "id": "9R6M-VMAN",
          "invoice_delivery_method": [
            "posting",
            "email"
          ],
          "invoice_ids": [
            "W47N-7WNM",
            "AY9N-VPN3"
          ],
          "issue_date": "2019-04-01",
          "object": "billing",
          "status": "scheduled",
          "unpaid": {
            "shortage_amount": 12000,
            "updated_date": "2019-04-30"
          },
          "uri": "mfk:billing:9R6M-VMAN"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Billing] 請求一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    PayoutsList

    {
      "items": [
        {
          "amount": 300800,
          "collected_amount": 200000,
          "receivables_amount": 110000,
          "deduction": {
            "amount": 9400,
            "returned_credit_amount": 500,
            "tax_free": {
              "amount": 3200,
              "commission_amount": 2200,
              "early_payout_commission_amount": 1000
            },
            "taxable": {
              "amount": 7000,
              "convenience_billing": {
                "charge": 15000,
                "quantity": 100,
                "unit_price": 150
              },
              "basic_monthly_charge": 4500,
              "billing_charge": {
                "amount": 2000,
                "unit_price": 200,
                "quantity": 10
              },
              "posting": {
                "amount": 500,
                "unit_price": 100,
                "quantity": 5
              }
            },
            "tax": {
              "rate_type": "normal_10",
              "amount": 500
            },
            "untaxable": {
              "amount": 15000,
              "revenue_stamp": {
                "amount": 15000,
                "quantity": 100,
                "unit_price": 150
              }
            }
          },
          "id": "7679-YW36",
          "payout_date": "2019-07-29",
          "status": "completed",
          "type": "normal",
          "uri": "mfk:payout:7679-YW36"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Payout] 振込一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    PayoutTransactionsList

    {
      "items": [
        {
          "accepted_at": "2019-04-01T10:36:43+09:00",
          "amount": 10000,
          "commission_amount": 200,
          "commission_rate": 2,
          "early_payout_commission_amount": 400,
          "early_payout_commission_rate": 4,
          "id": "9NR3-P9A6",
          "payout_date": "2019-04-15",
          "payout_id": "7679-YW36",
          "standard_payout_date": "2019-05-01",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:payout_transaction:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [PayoutTransaction] 債権一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    PayoutRefundsList

    {
      "items": [
        {
          "amount": 10000,
          "commission_amount": 100,
          "customer_id": "W463-AA6V",
          "id": "9NR3-P9A6",
          "object": "payout_refund",
          "payout_id": "7679-YW36",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:payout_refund:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [PayoutRefund] 返金一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    AuthorizationsList

    {
      "items": [
        {
          "amount": 10000,
          "canceled_at": "2019-04-22T10:36:43+09:00",
          "created_at": "2019-04-01T10:36:43+09:00",
          "credit_facility_id": "4N3W-ER7N",
          "customer_id": "W463-AA6V",
          "expiration_date": "2019-06-16",
          "id": "9NR3-P9A6",
          "max_due_date": "2019-06-30",
          "number": "AUTHORIZATION001",
          "object": "authorization",
          "status": "active",
          "transaction_id": "GY9N-EWNM",
          "uri": "mfk:authorization:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [Authorization] オーソリゼーション一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    CreateCustomerResponse

    {
      "customer": {
        "created_at": "2019-04-01T10:36:43+09:00",
        "has_alert": false,
        "id": "7679-YW36",
        "name": "サンプル顧客",
        "number": "CUSTOEMR001",
        "object": "customer",
        "payment_method": {
          "bank_transfer": {
            "object": "bank_transfer",
            "account_number": "123456789",
            "bank_name": "MEKESSAI銀行",
            "branch_name": "大手町支店",
            "holder_name": "マネ-フオワ-ドケツサイ(カ",
            "type": "current"
          },
          "object": "payment_method"
        },
        "uri": "mfk:customer:7679-YW36"
      },
      "destination": {
        "address1": "東京都千代田区1-2-3",
        "address2": "サンプルビル3F",
        "cc_emails": [
          "[email protected]",
          "[email protected]"
        ],
        "created_at": "2019-04-01T10:36:43+09:00",
        "customer_id": "7679-YW36",
        "department": "経理部",
        "email": "[email protected]",
        "id": "WNAV-37R6",
        "name": "担当 太郎",
        "name_kana": "タントウ タロウ",
        "object": "destination",
        "tel": "03-1234-5678",
        "title": "部長",
        "uri": "mfk:destination:WNAV-37R6",
        "zip_code": "111-1111"
      }
    }
    
    

    Property

    項目名 説明
    customer Customer 顧客です。取引登録や与信枠取得などあらゆる機能を利用する起点となります。
    destination Destination 請求先です。一つの顧客に対して複数作成することができます。請求先の情報を利用して請求書送付を行います。
    請求書の印字との対照についてはサポートページを確認してください。

    Authorization

    {
      "amount": 10000,
      "canceled_at": "2019-04-22T10:36:43+09:00",
      "created_at": "2019-04-01T10:36:43+09:00",
      "credit_facility_id": "4N3W-ER7N",
      "customer_id": "W463-AA6V",
      "expiration_date": "2019-06-16",
      "id": "9NR3-P9A6",
      "max_due_date": "2019-06-30",
      "number": "AUTHORIZATION001",
      "object": "authorization",
      "status": "active",
      "transaction_id": "GY9N-EWNM",
      "uri": "mfk:authorization:9NR3-P9A6"
    }
    
    

    Property

    項目名 説明
    amount integer オーソリゼーション金額です。税込金額になります。
    canceled_at string(date-time) オーソリゼーションがキャンセルされた日時です。未キャンセルの場合は空になります。
    created_at string(date-time) オーソリゼーションが登録された日時を示します。
    credit_facility_id string 与信枠IDです。このオーソリゼーションが紐づく与信枠を示します。
    customer_id string 顧客IDです。このオーソリゼーションが紐づく顧客を示します。
    expiration_date string(date) 有効期限日です。この日付を含む有効期間中はこのオーソリゼーションを利用して取引登録ができます。
    id string オーソリゼーションIDです。一意の識別子として自動で付与されます。
    max_due_date string(date) このオーソリゼーションを利用して取引登録する際に指定可能な最大支払期限です。
    number string オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。
    object string このObjectの種別を示します。ここでは必ずauthorizationが入ります。
  • authorization
  • status string オーソリゼーションステータスです。アクティブ(active)、有効期限切れ(expired)、取引登録済み(captured)、キャンセル済み(canceled)があります。
    値は以下のうちの一つになります。
    • active
    • expired
    • captured
    • canceled
    transaction_id string 取引IDです。このオーソリゼーションが紐づく取引を示します。空の場合はそのオーソリゼーションを利用して取引登録がまだされていないことを示します。
    uri string オーソリゼーションURIです。すべてのリソースで一意の識別子として自動で付与されます。

    AuthorizationPayload

    {
      "amount": 10000,
      "customer_id": "W463-AA6V",
      "number": "AUTHORIZATION001"
    }
    
    

    Property

    項目名 説明
    amount
    required
    integer
    minimum: 1
    maximum: 2147483647
    オーソリゼーション金額です。必ず税込金額を指定してください。
    customer_id
    required
    string
    minLength: 1
    顧客IDです。このオーソリゼーションが紐づく顧客を指定してください。
    number
    required
    string
    minLength: 1
    maxLength: 100
    オーソリゼーションに付与できる任意の番号です。自動で付与されるオーソリゼーションIDとは別に、売り手様が独自に管理する識別子を登録することができます。ただし、売り手様の管理されるオーソリゼーション間で一意でなければなりません。

    CustomerNameUpdatePayload

    {
      "customer_id": "W463-AA6V",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため"
    }
    
    

    Property

    項目名 説明
    customer_id
    required
    string
    minLength: 1
    顧客idです。顧客名を変更したい顧客を指定してください。
    name
    required
    string
    minLength: 1
    maxLength: 50
    変更後の顧客名です。
    reason
    required
    string
    minLength: 1
    maxLength: 500
    変更希望理由です。

    CustomerNameUpdatesList

    {
      "items": [
        {
          "created_at": "2019-04-01T10:36:43+09:00",
          "customer_id": "W463-AA6V",
          "id": "9NR3-P9A6",
          "name": "マネーフォワードケッサイ株式会社",
          "reason": "社名変更のため",
          "object": "customer_name_update",
          "status": "passed",
          "uri": "mfk:customer_name_update:9NR3-P9A6"
        }
      ],
      "object": "list",
      "pagination": {
        "end": "7679-YW36",
        "has_next": true,
        "has_previous": false,
        "limit": 20,
        "start": "9R6M-VMAN",
        "total": 143
      }
    }
    
    

    Property

    項目名 説明
    items [CustomerNameUpdate] 顧客名変更申請一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • pagination Pagination ページネーション情報です。各Objectの一覧取得の際にリストとともに返却されます。この情報をもとにページ繰りを行うことができます。

    CustomerNameUpdate

    {
      "created_at": "2019-04-01T10:36:43+09:00",
      "customer_id": "W463-AA6V",
      "id": "9NR3-P9A6",
      "name": "マネーフォワードケッサイ株式会社",
      "reason": "社名変更のため",
      "object": "customer_name_update",
      "status": "passed",
      "uri": "mfk:customer_name_update:9NR3-P9A6"
    }
    
    

    Property

    項目名 説明
    created_at string(date-time) 顧客名変更申請が登録された日時を示します。
    customer_id string 顧客IDです。この顧客名変更申請が紐づく顧客を示します。
    id string 顧客名変更申請IDです。一意の識別子として自動で付与されます。
    name string 変更後の顧客名です。
    reason string 変更希望理由です。
    object string このObjectの種別を示します。ここでは必ずcustomer_name_updateが入ります。
  • customer_name_update
  • status string 顧客名変更申請ステータスです。審査中(unexamined)、審査通過(passed)、審査否決(rejected)、申請キャンセル(canceled)があります。審査通過の場合には顧客名が変更されています。
    値は以下のうちの一つになります。
    • unexamined
    • passed
    • rejected
    • canceled
    uri string 顧客名変更申請URIです。すべてのリソースで一意の識別子として自動で付与されます。

    ReissuingPayload

    {
      "destination_id": "WNAV-37R6",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ]
    }
    
    

    Property

    項目名 説明
    destination_id
    required
    string
    minLength: 1
    請求先IDです。送付したい請求先を指定してください。
    invoice_delivery_methods
    required
    [InvoiceDeliveryMethod]
    minItems: 1
    maxItems: 2
    請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つを指定してください。どちらも選択された場合、どちらの方法でも送付されます。 また、各取引で指定しなかった送付方法でも、請求にまとまった取引のうちでその送付方法を選択しているものがあれば、そちらの送付方法も採用されます。

    Invoice

    {
      "amount": 20000,
      "billing_date": "2021-06-09",
      "billing_id": "79NR-9WR6",
      "created_at": "2021-06-15T10:21:34+09:00",
      "destination_id": "WNAV-37R6",
      "id": "79NR-AP96",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "object": "invoice",
      "uri": "mfk:invoice:7679-YW36"
    }
    
    

    Property

    項目名 説明
    amount integer 請求書に記載される請求金額です。
    billing_date string(date) 請求書に記載される請求日です。
    billing_id string
    minLength: 1
    請求IDです。
    created_at string(date-time) 請求書の発行日時です。
    destination_id string 請求先IDです。送付したい請求先を指定してください。
    id string 請求書IDです。
    invoice_delivery_methods [InvoiceDeliveryMethod] 請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。
    object string このObjectの種別を示します。ここでは必ずinvoiceが入ります。
  • invoice
  • uri string 請求書URIです。すべてのリソースで一意の識別子として自動で付与されます。

    AccountTransferNotification

    {
      "account_transfer_date": "2021-06-09",
      "amount": 20000,
      "billing_id": "79NR-9WR6",
      "created_at": "2021-06-15T10:21:34+09:00",
      "destination_id": "WNAV-37R6",
      "id": "79NR-AP96",
      "invoice_delivery_methods": [
        "posting",
        "email"
      ],
      "object": "account_transfer_notification",
      "uri": "mfk:account_transfer_notification:7679-YW36"
    }
    
    

    Property

    項目名 説明
    account_transfer_date string(date) 口座振替通知書兼請求書に記載される口座振替日です。
    amount integer 口座振替通知書兼請求書に記載される請求金額です。
    billing_id string
    minLength: 1
    請求IDです。
    created_at string(date-time) 口座振替通知書兼請求書の発行日時です。
    destination_id string 請求先IDです。送付したい請求先を指定してください。
    id string 口座振替通知書兼請求書IDです。
    invoice_delivery_methods [InvoiceDeliveryMethod] 口座振替通知書兼請求書送付方法です。郵送(posting) またはメール送付(email)のうちから少なくとも1つになります。
    object string このObjectの種別を示します。ここでは必ずaccount_transfer_notificationが入ります。
  • account_transfer_notification
  • uri string 口座振替通知書兼請求書URIです。すべてのリソースで一意の識別子として自動で付与されます。

    ReissuingResponse

    {
      "account_transfer_notification": {
        "account_transfer_date": "2021-06-09",
        "amount": 20000,
        "billing_id": "79NR-9WR6",
        "created_at": "2021-06-15T10:21:34+09:00",
        "destination_id": "WNAV-37R6",
        "id": "79NR-AP96",
        "invoice_delivery_methods": [
          "posting",
          "email"
        ],
        "object": "account_transfer_notification",
        "uri": "mfk:account_transfer_notification:7679-YW36"
      },
      "invoice": {
        "amount": 20000,
        "billing_date": "2021-06-09",
        "billing_id": "79NR-9WR6",
        "created_at": "2021-06-15T10:21:34+09:00",
        "destination_id": "WNAV-37R6",
        "id": "79NR-AP96",
        "invoice_delivery_methods": [
          "posting",
          "email"
        ],
        "object": "invoice",
        "uri": "mfk:invoice:7679-YW36"
      },
      "type": "invoice"
    }
    
    

    Property

    項目名 説明
    account_transfer_notification AccountTransferNotification
    invoice Invoice
    type string 請求種別です。請求書(invoice)もしくは口座振替通知書(account_transfer_notification)のいずれかになります。
    値は以下のうちの一つになります。
    • account_transfer_notification
    • invoice

    UploadSignedUrlPayload

    {
      "content_type": "application/pdf"
    }
    
    

    Property

    項目名 説明
    content_type
    required
    string アップロードするファイルのメディアタイプです。MIME タイプに準拠した文字列を指定します。
    値は application/pdf, application/json, text/csv, text/plain の中から指定します。
    値は以下のうちの一つになります。
    • application/pdf
    • application/json
    • text/csv
    • text/plain

    UploadSignedURL

    {
      "url": "https://upload.mfk.jp/billings/7679-YW36/billing_files?signature=mfkrandomsignature",
      "expires_at": "2023-03-08T10:36:43+09:00"
    }
    
    

    Property

    項目名 説明
    url string ファイルアップロード用の署名付きURLです。
    expires_at string(date-time) ファイルアップロード用の署名付きURLの有効期限です。

    DownloadSignedURL

    {
      "signed_url": "https://download.mfk.jp/api/billings/7679-YW36/content?Signature=mfkrandomsignature",
      "expired_at": "2023-03-08T10:36:43+09:00",
      "type": "pdf"
    }
    
    

    Property

    項目名 説明
    signed_url string ファイルダウンロード用の署名付きURLです。
    expired_at string(date-time) ファイルダウンロード用の署名付きURLの有効期限です。
    type string ダウンロードするファイルの種別です。
    値は以下のうちの一つになります。
    • pdf
    • excel

    DownloadSignedURLList

    {
      "items": [
        {
          "signed_url": "https://download.mfk.jp/api/billings/7679-YW36/content?Signature=mfkrandomsignature",
          "expired_at": "2023-03-08T10:36:43+09:00",
          "type": "pdf"
        }
      ],
      "object": "list"
    }
    
    

    Property

    項目名 説明
    items [DownloadSignedURL] ファイルダウンロード用の署名付きURLの一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list
  • Issue

    {
      "id": "i/79NR-AP96",
      "type": "invoice",
      "created_at": "2019-04-01T10:36:43+09:00"
    }
    
    

    Property

    項目名 説明
    id string 発行済の請求書または口座振替通知書を表すIDです。請求書の場合は「i/」、口座振替通知書の場合は「a/」がprefixとして付きます。ファイルダウンロード用URL発行エンドポイントでそのままこのIDを使うことができます。
    type string 請求種別です。請求書(invoice)もしくは口座振替通知書(account_transfer_notification)のいずれかになります。
    値は以下のうちの一つになります。
    • account_transfer_notification
    • invoice
    created_at string(date-time) 請求書または口座振替通知書の発行日時です。

    IssuesList

    {
      "items": [
        {
          "id": "i/79NR-AP96",
          "type": "invoice",
          "created_at": "2019-04-01T10:36:43+09:00"
        }
      ],
      "object": "list"
    }
    
    

    Property

    項目名 説明
    items [Issue] 発行済請求情報の一覧です。
    object string このObjectの種別を示します。ここでは必ず listが設定されます。
  • list