API Reference パートナー予約連携API

ゴルフ場APIガイド(連携・管理)

概要

ゴルフ場API は用途の異なる2系統で構成されます。パートナー予約連携API(会員向け)とは別物です。

系統パス認証用途
連携 (Integration)/api/integration/*APIキー(integration スコープ)外部予約システム・在庫システムとの双方向連携(ティータイム/在庫/予約/Webhook)。1キー = 1ゴルフ場
管理 (Management)/api/manage/*ゴルフ場ログイン(セッション)または JWTゴルフ場管理画面の操作(予約・予約枠・通知・設定・レポート)。golf_club_id は認証情報から特定。
すべてのレスポンスは JSON(CSVエクスポートを除く)。日時は特記なき限り YYYY-MM-DD / HH:MM 形式。金額は VND(整数)です。

認証

Integration/api/integration/*

APIキー認証。すべてのリクエストに X-API-Key ヘッダーを付与します。キーは管理者が発行し、integration タイプのキーは 1キーにつき1ゴルフ場owner_id)に紐づきます。リクエストの golf_club_id が紐づきと一致しない場合は 403(IDOR対策)。

リクエストヘッダー例
POST /api/integration/tee-times/sync.php HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY
Content-Type: application/json

スコープ: 参照系は integration:read、更新系は integration:write

Management/api/manage/*

ゴルフ場管理画面のログインセッション、または JWT Bearer トークンで認証します(GolfClubAuthService)。対象ゴルフ場は認証情報から特定されるため、golf_club_id をパラメータで渡す必要はありません。

リクエストヘッダー例(JWT)
GET /api/manage/reservations/list.php HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>

スコープ(リソース別): reservations:read/write / tee_times:read/write / notifications:read/write / settings:read/write / reports:read

レスポンス共通形式

CSVエクスポートを除き、すべて以下の JSON エンベロープで返ります。

成功
{
  "status": "success",
  "message": "...",
  "data": { ... }
}
エラー
{
  "status": "error",
  "message": "エラー内容",
  "data": null
}

エラーコード一覧

HTTP意味
400リクエスト不正(必須パラメータ不足・JSON不正など)
401認証失敗(APIキー無効 / 未ログイン / トークン期限切れ)
403権限不足(スコープ不足 / 対象ゴルフ場へのアクセス不可)
404対象リソースが存在しない
405許可されていない HTTP メソッド
429レート制限超過
500サーバ内部エラー
外部連携 API(Integration)

連携: ティータイム

POST/api/integration/tee-times/sync.phpintegration:write

外部システムのティータイム枠を GOVIGO に同期(外部→GOVIGO)。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID(APIキーの紐づきと一致)
slotsarray必須{course_id, tee_time (YYYY-MM-DD HH:MM), total_slots, available_slots, status?, plan_id?} の配列
リクエスト例
POST /api/integration/tee-times/sync.php HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY
Content-Type: application/json

{
  "golf_club_id": 1,
  "slots": [
    { "course_id": 10, "tee_time": "2026-07-01 07:30", "total_slots": 4, "available_slots": 4 }
  ]
}
GET/api/integration/tee-times/pull.phpintegration:read

GOVIGO 側のティータイムを取得(GOVIGO→外部)。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
date_fromstring必須取得開始日(YYYY-MM-DD)
date_tostring必須取得終了日(YYYY-MM-DD)
course_idinteger任意コースで絞り込み
リクエスト例
GET /api/integration/tee-times/pull.php?golf_club_id=1&date_from=2026-07-01&date_to=2026-07-07 HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY

連携: 在庫

POST/api/integration/inventory/sync.phpintegration:write

在庫(枠数)を期間・コース単位で同期します。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
date_from / date_tostring必須対象期間(YYYY-MM-DD)
inventoryarray必須{course_id, date, slots: [{time (HH:MM), total, available}]} の配列
リクエスト例
POST /api/integration/inventory/sync.php HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY
Content-Type: application/json

{
  "golf_club_id": 1,
  "date_from": "2026-07-01",
  "date_to": "2026-07-01",
  "inventory": [
    { "course_id": 10, "date": "2026-07-01", "slots": [ { "time": "07:30", "total": 4, "available": 2 } ] }
  ]
}
GET/api/integration/inventory/status.phpintegration:read

在庫状況のサマリーを取得します。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
date_from / date_tostring任意集計期間(YYYY-MM-DD)
リクエスト例
GET /api/integration/inventory/status.php?golf_club_id=1&date_from=2026-07-01&date_to=2026-07-31 HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY

連携: 予約

POST/api/integration/reservations/receive.phpintegration:write

外部システムで発生した予約を GOVIGO に取り込みます(外部→GOVIGO)。ボディは予約作成と同形式で、external_ref が必須(冪等キー)。

パラメータ必須説明
external_refstring必須外部システム側の予約参照キー(重複取込防止)
予約データobject必須golf_club_id / golf_plan_id / tee_date / tee_time / 顧客情報 / 人数 など(予約作成 API と同形式)
POST/api/integration/reservations/push.phpintegration:read

GOVIGO 側の予約を外部システムへ連携するための取得(プッシュ確認)。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
date_from / date_tostring任意対象期間(YYYY-MM-DD)
statusinteger任意予約ステータスで絞り込み
include_attendeesboolean任意同伴者情報を含める

連携: Webhook

POST/api/integration/webhooks/subscribe.phpintegration:write

予約・在庫などのイベント通知先 URL を登録します。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
urlstring必須Webhook受信URL(HTTPS必須)
eventsarray必須購読するイベント種別
リクエスト例
POST /api/integration/webhooks/subscribe.php HTTP/1.1
Host: govigolf.comX-API-Key: YOUR_API_KEY
Content-Type: application/json

{ "golf_club_id": 1, "url": "https://example.com/hook", "events": ["reservation.created"] }
GET/api/integration/webhooks/list.phpintegration:read

登録済み Webhook の一覧を取得します。

パラメータ必須説明
golf_club_idinteger必須ゴルフ場ID
POST/api/integration/webhooks/unsubscribe.phpintegration:write

登録済み Webhook を解除します。

パラメータ必須説明
subscription_idinteger必須解除対象のサブスクリプションID
POST/api/integration/webhooks/test.phpintegration:write

指定サブスクリプションにテストイベントを送信します。

パラメータ必須説明
subscription_idinteger必須テスト対象のサブスクリプションID
管理 API(Management)

管理: 予約

GET/api/manage/reservations/list.phpreservations:read

自ゴルフ場の予約一覧を取得します。

パラメータ必須説明
statusinteger任意予約ステータスで絞り込み
date_from / date_tostring任意プレー日で絞り込み(YYYY-MM-DD)
searchstring任意予約者名などのキーワード検索
page / per_pageinteger任意ページング
リクエスト例
GET /api/manage/reservations/list.php?date_from=2026-07-01&date_to=2026-07-31&page=1 HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>
GET/api/manage/reservations/detail.phpreservations:read

予約の詳細を取得します。

パラメータ必須説明
idinteger必須予約ID
POST/api/manage/reservations/update-status.phpreservations:write

予約ステータスを変更します(キャンセル処理を含む)。

パラメータ必須説明
reservation_idinteger必須予約ID
statusinteger必須変更後ステータス(0〜5, 9)
memostring任意変更メモ
リクエスト例
POST /api/manage/reservations/update-status.php HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>
Content-Type: application/json

{ "reservation_id": 123, "status": 2, "memo": "確認済み" }

管理: 予約枠

GET/api/manage/tee-times/list.phptee_times:read

指定日の予約枠一覧を取得します。

パラメータ必須説明
datestring必須対象日(YYYY-MM-DD)
course_idinteger任意コースで絞り込み
POST/api/manage/tee-times/update.phptee_times:write

予約枠を1件更新します。

パラメータ必須説明
slot_idinteger必須予約枠ID
total_slots / available_slotsinteger任意総数 / 空き数
statusinteger任意枠ステータス
allow_joinboolean任意相乗り許可
golf_club_plan_idinteger任意紐づくプラン
POST/api/manage/tee-times/bulk-update.phptee_times:write

複数の予約枠をまとめて更新します(最大 200 件)。

パラメータ必須説明
slotsarray必須{slot_id, total_slots?, available_slots?, status?, allow_join?} の配列(最大200)
リクエスト例
POST /api/manage/tee-times/bulk-update.php HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>
Content-Type: application/json

{ "slots": [ { "slot_id": 501, "available_slots": 0, "status": 1 }, { "slot_id": 502, "available_slots": 2 } ] }

管理: 通知

GET/api/manage/notifications/list.phpnotifications:read

通知一覧を取得します。

パラメータ必須説明
page / per_pageinteger任意ページング(per_page 最大100)
unread_onlyinteger任意1 で未読のみ
POST/api/manage/notifications/mark-read.phpnotifications:write

通知を既読にします。

パラメータ必須説明
notification_idsarrayいずれか必須既読にする通知IDの配列
allbooleanいずれか必須true で全件既読
GET/api/manage/notifications/unread-count.phpnotifications:read

未読通知数を取得します。パラメータなし。

管理: 設定

GET/api/manage/settings/get.phpsettings:read

ゴルフ場設定を取得します。

パラメータ必須説明
keystring任意指定すると当該キーのみ取得(省略時は全件)
POST/api/manage/settings/update.phpsettings:write

ゴルフ場設定を更新します。

パラメータ必須説明
settingsobject必須{ key: value, ... } 形式の設定オブジェクト
リクエスト例
POST /api/manage/settings/update.php HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>
Content-Type: application/json

{ "settings": { "auto_confirm": "1", "cancel_deadline_days": "3" } }

管理: レポート

GET/api/manage/reports/summary.phpreports:read

予約実績の集計を取得します。

パラメータ必須説明
date_from / date_tostring任意集計期間(既定: 当月。YYYY-MM-DD)
group_bystring任意date / course / status(既定: date)
GET/api/manage/reports/export.phpreports:read

予約データを CSV でエクスポートします。レスポンスは text/csv(JSONエンベロープではありません)。

パラメータ必須説明
date_from / date_tostring任意対象期間(既定: 当月。YYYY-MM-DD)
statusinteger任意予約ステータスで絞り込み
リクエスト例
GET /api/manage/reports/export.php?date_from=2026-07-01&date_to=2026-07-31 HTTP/1.1
Host: govigolf.comAuthorization: Bearer <JWT>