SQUAKE Integration Docs
  • πŸƒOverview
  • βœ‰οΈContact form
  • ⚠️Incident form
  • πŸ—„οΈCalculation API Examples
    • 🌐Travel
      • πŸ›ŒAccommodation
        • Accommodation: SQUAKE
      • 🚌Bus
        • Bus: SQUAKE
        • Bus: DEFRA πŸ‡¬πŸ‡§
      • πŸš—Car
        • Car: ACRISS
        • Car: DEFRA πŸ‡¬πŸ‡§
        • Car: EEA πŸ‡ͺπŸ‡Ί
        • Car: EPA πŸ‡ΊπŸ‡Έ
      • 🀝Event
        • Event: HCMI & CHSB
      • ⛴️Ferry
        • Ferry: ADEME πŸ‡«πŸ‡·
      • ✈️Flight
        • Flight: ADEME πŸ‡«πŸ‡·
        • Flight: Base Empreinte πŸ‡«πŸ‡·
        • Flight: CO2 emissiefactoren πŸ‡³πŸ‡±
        • Flight: DEFRA πŸ‡¬πŸ‡§
        • Flight: EPA πŸ‡ΊπŸ‡Έ
        • Flight: GATE4
        • Flight: ICAO
        • Flight: TIM
        • Flight: TU Chalmers πŸ‡ΈπŸ‡ͺ
      • 🏨Hotel
        • Hotel: DEFRA πŸ‡¬πŸ‡§
        • Hotel: HCMI & CHSB
        • Hotel: SQUAKE
      • πŸš†Train
        • Train: ADEME πŸ‡«πŸ‡·
        • Train: Base Empreinte πŸ‡«πŸ‡·
        • Train: CO2-emissiefactoren πŸ‡³πŸ‡±
        • Train: DEFRA πŸ‡¬πŸ‡§
        • Train: SQUAKE
    • πŸ“¦Logistics
      • ✈️Air Freight
        • Air Freight: DIN EN 16258
        • Air Freight: GLEC
      • πŸ›₯️Inland Waterways
        • Inland Waterways: GLEC
      • 🚧Logistics Site
        • Logistics Site: GLEC
      • 🚈Rail Freight
        • Rail Freight: DIN EN 16258
        • Rail Freight: ECTA
        • Rail Freight: GLEC
      • 🚚Road Freight
        • Road Freight: DIN EN 16258
        • Road Freight: GLEC
      • 🚒Sea Freight
        • Road Freight: Clean Cargo
        • Road Freight: DIN EN 16258
        • Road Freight: EMSA πŸ‡ͺπŸ‡Ί
        • Road Freight: GLEC
      • πŸš›Van
        • Van: EEA πŸ‡ͺπŸ‡Ί
  • πŸ†•Notable Changes
    • πŸ“ŠCalculation Changes
      • Events according to HCMI - 2024 updates
      • Train according to CO2 emissiefactoren - energy scope inclusion
      • Train: SQUAKE - April 2025 Update
      • Bus & Train According to DEFRA are Now Available
      • Base Empreinte for Flights and Trains Now Live
      • TIM Transition to Version 2.0
      • TIM & DEFRA: Distance Changes
      • Airline Code Support Update - December 2024
      • GLEC v3.1
      • Car: DEFRA is Now Available
      • Hotel: DEFRA is Now Available
      • Hotel: HCMI - 2024 Updates
      • Accommodation - September 2024 Updates
      • Bus: SQUAKE - September 2024 Update
      • Flight: DEFRA - July 2024 Update
      • GATE4 Methodology is Now Available
      • GLEC, ECTA, and CLEAN-CARGO November 2023 Update
      • Flight: ICAO v13 - July 2024 Update
      • TIM v1.3
      • Train: SQUAKE - August 2024 Update
  • πŸ’‘Use Cases
    • Fulfillment with API
    • Fulfillment with Self-Checkout
    • Webhooks
    • Webhooks API Reference
  • πŸ•΅οΈAudits
    • Retrieve the list of Audit logs
    • Retrieve a specific Audit log
  • πŸ§‘β€πŸ’»Migration Guide
    • From v1 to v2
  • ❓Sustainability FAQs
Powered by GitBook
On this page
  • Creating a Webhook
  • Endpoint
  • Request Parameters
  • Headers
  • Request
  • Response
  • Success (201 Created)
  • Updating a Webhook
  • Endpoint
  • Request Parameters
  • Example Request
  • Response
  • Success (200 OK)
  • Not Found (404)
  • Deleting a Webhook
  • Endpoint
  • Example Request
  • Important Notes

Was this helpful?

  1. Use Cases

Webhooks API Reference

SQUAKE Webhooks API reference for creating, updating and deleting webhooks

Creating a Webhook

To create a new webhook, send a POST request to the webhook endpoint.

Endpoint

POST /api/v2/webhooks

Request Parameters

Parameter
Type
Required
Description

kind

string

Yes

The type of webhook. Must be one of: order, confirmation_document_available, certificate_document_available

endpoint_url

string

Yes

The URL where webhook events will be sent

Headers

  • Authentication is required (based on the controller inheriting from BaseController)

Request

curl -X POST \\
  <https://api.squake.earth/v2/webhooks> \\
  -H 'Authorization: Bearer YOUR_API_TOKEN' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "kind": "order",
    "endpoint_url": "<https://your-domain.com/webhook-receiver>"
  }'

Response

Success (201 Created)

{
    "id": "webhook_id",
    "kind": "order",
    "endpoint_url": "<https://your-domain.com/webhook-receiver>",
    "signing_key": "webhook_signing_key",  // Only provided on creation
    "last_sent_at": null,
    "last_failed_at": null,
    "failed_attempts": 0
}

Updating a Webhook

Update an existing webhook configuration.

Endpoint

PUT /api/v2/webhooks/:id

Request Parameters

Parameter
Type
Required
Description

kind

string

No

The type of webhook. Must be one of: order, confirmation_document_available, certificate_document_available

endpoint_url

string

No

The URL where webhook events will be sent

Example Request

curl -X PUT \\
  <https://api.squake.earth/v2/webhooks/webhook_id> \\
  -H 'Authorization: Bearer YOUR_API_TOKEN' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "endpoint_url": "<https://your-domain.com/new-webhook-receiver>"
  }'

Response

Success (200 OK)


    "id": "webhook_id",
    "kind": "order",
    "endpoint_url": "<https://your-domain.com/new-webhook-receiver>"
}

Not Found (404)

Returned when the webhook ID doesn't exist or belongs to another client.

Deleting a Webhook

Remove an existing webhook configuration.

Endpoint

DELETE /api/v2/webhooks/:id

Example Request

curl -X DELETE \\
  <https://api.squake.earth/v2/webhooks/webhook_id> \\
  -H 'Authorization: Bearer YOUR_API_TOKEN'

Important Notes

  1. The webhook signing key is only returned once during webhook creation. Make sure to store it securely.

  2. The endpoint URL must be a valid HTTPS URL that can receive POST requests.

  3. Each client can create multiple webhooks for different purposes.

  4. Available webhook kinds:

    • order: Notifications about order-related even

    • confirmation_document_available: Notifications when confirmation documents become available

    • certificate_document_available: Notifications when certificate documents become available

PreviousWebhooksNextAudits

Last updated 4 months ago

Was this helpful?

πŸ’‘