POST /v2/webhook-endpoints

Webhookエンドポイント作成

概要

Webhookを受信するURLを事前登録します。 登録したエンドポイントはWebhook登録時にwebhookEndpointIdで参照できます。 無料APIで使用量は消費されません。

リクエスト例

curl -X POST https://api.whereparcel.com/v2/webhook-endpoints \
  -H "Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Webhook",
    "url": "https://myapp.com/webhooks/whereparcel",
    "description": "프로덕션 환경 웹훅 수신 URL"
  }'
const response = await fetch('https://api.whereparcel.com/v2/webhook-endpoints', {
  method: 'POST',
  headers: {
    "Authorization": "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "name": "Production Webhook",
      "url": "https://myapp.com/webhooks/whereparcel",
      "description": "프로덕션 환경 웹훅 수신 URL"
    })
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/webhook-endpoints');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');

$headers = [
  'Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
  'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$data = [
  'name' => "Production Webhook",
  'url' => "https://myapp.com/webhooks/whereparcel",
  'description' => "프로덕션 환경 웹훅 수신 URL"
];
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

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

$result = json_decode($response, true);
print_r($result);
import requests
import json

url = 'https://api.whereparcel.com/v2/webhook-endpoints'

headers = {
    'Authorization': 'Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
    'Content-Type': 'application/json'
}

data = {
    'name': "Production Webhook",
    'url': "https://myapp.com/webhooks/whereparcel",
    'description': "프로덕션 환경 웹훅 수신 URL"
}

response = requests.post(url, headers=headers, json=data)

result = response.json()
print(result)
package main

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

func main() {
	url := "https://api.whereparcel.com/v2/webhook-endpoints"

	payload := []byte(`{"name":"Production Webhook","url":"https://myapp.com/webhooks/whereparcel","description":"프로덕션 환경 웹훅 수신 URL"}`)
	req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))

	req.Header.Add("Authorization", "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production")
	req.Header.Add("Content-Type", "application/json")

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

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
💡 注記: テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。

リクエストボディ

Name Type Required Description
name string Required
url string Required
secret string Optional
description string Optional

レスポンス

成功レスポンス (201)

201 Created

エンドポイントの作成に成功しました

Response Body

{
  "success": true,
  "data": {
    "endpointId": "endpoint_abc123",
    "name": "Production Webhook",
    "url": "https://myapp.com/webhooks/whereparcel",
    "secret": "whsec_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456",
    "description": "프로덕션 환경 웹훅 수신 URL",
    "isActive": true,
    "createdAt": "2026-02-05T10:00:00.000Z"
  }
}

エラーレスポンス (400)

400 Bad Request

不正なリクエスト (URL形式エラーなど)

Response Body

{
  "success": false,
  "error": {
    "code": "INVALID_REQUEST",
    "message": "The request parameters are invalid"
  }
}

エラーレスポンス (401)

401 Unauthorized

認証失敗

Response Body

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
GET /v2/webhook-endpoints

Webhookエンドポイント一覧取得

概要

登録されたすべてのWebhookエンドポイントを取得します。無料APIで使用量は消費されません。

リクエスト例

curl -X GET https://api.whereparcel.com/v2/webhook-endpoints \
  -H "Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production" \
  -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/webhook-endpoints', {
  method: 'GET',
  headers: {
    "Authorization": "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production",
    "Content-Type": "application/json"
  }
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/webhook-endpoints');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$headers = [
  'Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
  'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

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

$result = json_decode($response, true);
print_r($result);
import requests
import json

url = 'https://api.whereparcel.com/v2/webhook-endpoints'

headers = {
    'Authorization': 'Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
    'Content-Type': 'application/json'
}

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

result = response.json()
print(result)
package main

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

func main() {
	url := "https://api.whereparcel.com/v2/webhook-endpoints"

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

	req.Header.Add("Authorization", "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production")
	req.Header.Add("Content-Type", "application/json")

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

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
💡 注記: テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。

レスポンス

成功レスポンス (200)

200 OK

エンドポイント一覧の取得に成功しました

Response Body

{
  "success": true,
  "data": [
    {
      "endpointId": "endpoint_abc123",
      "name": "Production Webhook",
      "url": "https://myapp.com/webhooks/whereparcel",
      "description": "프로덕션 환경 웹훅 수신 URL",
      "isActive": true,
      "createdAt": "2026-02-05T10:00:00.000Z",
      "updatedAt": "2026-02-05T10:00:00.000Z"
    },
    {
      "endpointId": "endpoint_def456",
      "name": "Staging Webhook",
      "url": "https://staging.myapp.com/webhooks/whereparcel",
      "description": "스테이징 환경 웹훅 수신 URL",
      "isActive": false,
      "createdAt": "2026-02-04T15:30:00.000Z",
      "updatedAt": "2026-02-04T16:00:00.000Z"
    }
  ]
}

エラーレスポンス (401)

401 Unauthorized

認証失敗

Response Body

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}
PUT /v2/webhook-endpoints/{endpointId}

Webhookエンドポイント更新

概要

Webhookエンドポイントの情報を更新します。 URL、名前、説明、有効化状態などを変更できます。 無料APIで使用量は消費されません。

リクエスト例

curl -X PUT https://api.whereparcel.com/v2/webhook-endpoints/{endpointId} \
  -H "Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Webhook Name",
    "url": "https://myapp.com/webhooks/new-url",
    "enabled": true
  }'
const response = await fetch('https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}', {
  method: 'PUT',
  headers: {
    "Authorization": "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
      "name": "Updated Webhook Name",
      "url": "https://myapp.com/webhooks/new-url",
      "enabled": true
    })
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');

$headers = [
  'Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
  'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$data = [
  'name' => "Updated Webhook Name",
  'url' => "https://myapp.com/webhooks/new-url",
  'enabled' => true
];
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

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

$result = json_decode($response, true);
print_r($result);
import requests
import json

url = 'https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}'

headers = {
    'Authorization': 'Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
    'Content-Type': 'application/json'
}

data = {
    'name': "Updated Webhook Name",
    'url': "https://myapp.com/webhooks/new-url",
    'enabled': True
}

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

result = response.json()
print(result)
package main

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

func main() {
	url := "https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}"

	payload := []byte(`{"name":"Updated Webhook Name","url":"https://myapp.com/webhooks/new-url","enabled":true}`)
	req, _ := http.NewRequest("PUT", url, bytes.NewBuffer(payload))

	req.Header.Add("Authorization", "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production")
	req.Header.Add("Content-Type", "application/json")

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

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
💡 注記: テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。

パスパラメータ

Name Type Required Description
endpointId string Required
<p>更新するエンドポイントID</p>
Example: endpoint_abc123

リクエストボディ

Name Type Required Description
name string Optional
url string Optional
description string Optional
isActive boolean Optional

レスポンス

成功レスポンス (200)

200 OK

エンドポイントの更新に成功しました

Response Body

{
  "success": true,
  "data": {
    "endpointId": "endpoint_abc123",
    "name": "Updated Webhook Name",
    "url": "https://myapp.com/webhooks/new-url",
    "description": "Updated description",
    "isActive": true,
    "updatedAt": "2026-02-05T11:00:00.000Z"
  }
}

エラーレスポンス (401)

401 Unauthorized

認証失敗

Response Body

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

エラーレスポンス (404)

404 Not Found

endpointIdが見つかりません

Response Body

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "The requested resource was not found"
  }
}
DELETE /v2/webhook-endpoints/{endpointId}

Webhookエンドポイント削除

概要

Webhookエンドポイントを削除します。 このエンドポイントを使用中のWebhookがある場合は削除できません。 無料APIで使用量は消費されません。

リクエスト例

curl -X DELETE https://api.whereparcel.com/v2/webhook-endpoints/{endpointId} \
  -H "Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production" \
  -H "Content-Type: application/json"
const response = await fetch('https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}', {
  method: 'DELETE',
  headers: {
    "Authorization": "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production",
    "Content-Type": "application/json"
  }
});

const data = await response.json();
console.log(data);
<?php

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');

$headers = [
  'Authorization: Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
  'Content-Type: application/json'
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

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

$result = json_decode($response, true);
print_r($result);
import requests
import json

url = 'https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}'

headers = {
    'Authorization': 'Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production',
    'Content-Type': 'application/json'
}

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

result = response.json()
print(result)
package main

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

func main() {
	url := "https://api.whereparcel.com/v2/webhook-endpoints/{endpointId}"

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

	req.Header.Add("Authorization", "Bearer wp_test_public_demo_key_do_not_use_in_production:sk_test_public_demo_secret_do_not_use_in_production")
	req.Header.Add("Content-Type", "application/json")

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

	body, _ := io.ReadAll(res.Body)
	fmt.Println(string(body))
}
💡 注記: テスト用APIキーをダッシュボードで発行した実際のAPIキーに置き換えてください。

パスパラメータ

Name Type Required Description
endpointId string Required
<p>削除するエンドポイントID</p>
Example: endpoint_abc123

レスポンス

成功レスポンス (200)

200 OK

エンドポイントの削除に成功しました

Response Body

{
  "success": true,
  "message": "Webhook endpoint deleted successfully"
}

エラーレスポンス (401)

401 Unauthorized

認証失敗

Response Body

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or missing API key"
  }
}

エラーレスポンス (404)

404 Not Found

endpointIdが見つかりません

Response Body

{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "The requested resource was not found"
  }
}

エラーレスポンス (409)

409 409

使用中のエンドポイントは削除できません

Response Body

{
  "success": false,
  "error": {
    "code": "ERROR",
    "message": "An error occurred"
  }
}