Skip to content

Przykłady API

Praktyczne przykłady dla najważniejszych flow integracji HFT71.

1) Autoryzacja

Endpoint:

  • POST /authentication/login

Przykładowy request:

{
  "username": "api-user@example.com",
  "password": "your-password"
}

Przykładowy response:

{
  "access_token": "eyJhbGciOi...",
  "expires_in": 300,
  "token_type": "Bearer"
}

2) Wysłanie zamówienia

Endpoint:

  • POST /order

Przykładowy payload:

{
  "referenceId": "72774",
  "orderDate": "2026-03-02",
  "address": {
    "address1": "Main Street 10",
    "address2": "",
    "city": "Wroclaw",
    "zip": "50-001",
    "state": "DS",
    "country": "PL",
    "customerName": "John Doe",
    "email": "john@example.com",
    "mobile": "+48123456789"
  },
  "items": [
    {
      "sku": "GL64000-00007-0046",
      "quantity": 2
    }
  ]
}

3) Polling statusu

Endpoint:

  • GET /order/{orderId}/status

Przykładowy response:

[
  {
    "sku": "GL64000-00007-0046",
    "status": "In Production"
  }
]

4) Webhook do WooCommerce

Endpoint:

  • POST /wp-json/hft71/v1/order-status

Przykładowy body:

{
  "external_id": "123456",
  "status": "Closed"
}

5) Synchronizacja stocku

Endpoint:

  • GET /stock/available?page=1&count=200

Przykładowy response:

[
  {
    "sku": "GL64000-00007-0046",
    "stock": 18
  }
]

6) Aktualizacja dwukierunkowa

Endpoint:

  • PUT /order/{orderId}

Przykładowy payload statusu:

{
  "orderStatus": "Closed"
}