# Introduction

This description demonstrates how the E-commerce services are able to use the Webshippy system. The API supports four main cases.

## Usable API endpoints

* [**Order API:**](/webshippy-api-guide/order-related-functions) Order synchronisation (generate, modification, delete, query)
* [**Product API:**](/webshippy-api-guide/product-related-functions) Product synchronisation (generate, modification, delete, query, stock info)
* [**Inventory Transfer API:**](/webshippy-api-guide/transfer-related-functions) Transfer management (generate, modification, delete, query)
* [**External Inventory API:**](/webshippy-api-guide/setting-external-warehouse-inventory) With this function you can set stock quantity for products available from external warehouse and name of the external warehouse.
* [**GetStock API**](/webshippy-api-guide/getstock-api): Product inventory data bulk query.
* [**Get Brack History API**](/webshippy-api-guide/get-brack-history-api): Brack history query.
* [**Create Bundle API**](/webshippy-api-guide/create-bundle-api): Create product bundle.
* [**Marketplace Price Change API**](/webshippy-api-guide/dropshippy-price-change-api): Modification of Marketplace wholesale prices.&#x20;
* [**Marketplace Transaction API**](/webshippy-api-guide/marketplace-transaction-api)**:** This function enables the request of Marketplace transaction details.
* [**Track Info API**](https://www.apidoc-en.webshippy.com/webshippy-api-guide/track-info-api): The delivery status of orders can be queried.

For safety reasons WSAPI uses HTTPS channel, supports UTF-8 character encoding and is capable to communicate both in XML and JSON formats as well.

* API XML url: `https://app.webshippy.com/wspyapi/{ACTION}/xml`
* API JSON url: `https://app.webshippy.com/wspyapi/{ACTION}/json`

Where the placeholder {ACTION} is the requested function/action.

## Authentication - Generating API key

In the Webshippy Admin's system each Webshippy API is a separate sales channel. In order to have a successful data communication you must have your own API key. So to create it navigate to Settings / Warehouse management page then click on the Webshippy.API button to create a new sales channel. After filling in the basic data the system will generate the API key which is ready for communication.

## API requests briefly

API only uses POST methods, and the `request` field contains the given data either as a JSON or XML String.

**An example for a PHP based API request:**

```
$request = '<?xml version="1.0" encoding="UTF-8"?>
<request>
  <apiKey>apiKey</apiKey>
  <filters>
    <lastMod>2018-01-01 00:00:00</lastMod>
  </filters>
</request>';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.webshippy.com/wspyapi/GetProduct/xml/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['request' => $request]));

$result = curl_exec($ch);
```


# Order API

Order-related API features

## **Order requests**

| Filtering terms  | Description                                                                                   |
| ---------------- | --------------------------------------------------------------------------------------------- |
| `limit`          | Hits within a page (default: 100, maximum: 1000)                                              |
| `page`           | Number of the requested page (default: 0)                                                     |
| `wspyId`         | Internal ID, API returns it when an order is created                                          |
| `referenceId`    | External ID, the ID given when an order is created                                            |
| `referenceName`  | Order's name, the name given when an order is created                                         |
| `paymentStatus`  | Payment status (e.g.: `paid`, `pending`, etc.)                                                |
| `paymentGateway` | Method of payment (e.g.: `cod`, `card`, etc.)                                                 |
| `lastMod`        | Last modification's date. Lists even several created or modified orders after the given date. |

&#x20;Filtering terms listed above are linked with `AND` , you need to add only the terms that you'd like to filter.&#x20;

&#x20;In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/GetOrder/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
  <apiKey>api-key-comes-here</apiKey>
  <page>0</page>
  <limit>10</limit>
  <filters>
    <wspyId></wspyId>
    <referenceId></referenceId>
    <referenceName></referenceName>
    <paymentStatus></paymentStatus>
    <paymentGateway></paymentGateway>
    <lastMod>2018-01-01 00:00:00</lastMod>
  </filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message/>
  <result>
    <elem>
      <wspyId>176</wspyId>
      <status>fulfilled</status>
      <referenceId>87962-110037</referenceId>
      <referenceName>87962-110037</referenceName>
      <createdAt>2018-02-14 13:04:33</createdAt>
      <fulfilledAt>2018-02-20 16:27:17</fulfilledAt>
      <paymentGateway>cod</paymentGateway>
      <paymentStatus>pending</paymentStatus>
      <paymentTotalPrice>8940.00</paymentTotalPrice>
      <paymentTotalDiscounts>1000.00</paymentTotalDiscounts>
      <paymentCurrency>HUF</paymentCurrency>
      <shippingMode>GLS</shippingMode>
      <shippingPrice>1290.00</shippingPrice>
      <shippingVat>0.27</shippingVat>
      <paidAt/>
      <codAmount>1500.00</codAmount>
      <codCurrency>HUF</codCurrency>
      <codStatus/>
      <codReceivedAt/>
      <trackingCode>WSHPY176</trackingCode>
      <invoiceStatus/>
      <invoiceCreatedAt>2018-02-16 00:00:00</invoiceCreatedAt>
      <invoiceNo>inv#00001</invoiceNo>
      <refusedInvoiceNo/>
      <invoiceUrl/>
      <refusedDate/>
      <updatedAt>2018-02-26 12:18:17</updatedAt>
      <products>
        <elem>
          <sku>szuperhos-polo-piros-xl</sku>
          <productName>Szuperhős Póló</productName>
          <variantName>Piros, XL</variantName>
          <priceGross>1890.00</priceGross>
          <vat>0.27</vat>
          <quantity>3</quantity>
        </elem>
        <elem>
          <sku>cicanaci-one-size</sku>
          <productName>CicaNaci - One Size</productName>
          <variantName/>
          <priceGross>990.00</priceGross>
          <vat>0.27</vat>
          <quantity>1</quantity>
        </elem>
        <elem>
          <sku>akcios-sapka</sku>
          <productName>Akciós sapka</productName>
          <variantName>Fekete</variantName>
          <priceGross>1990.00</priceGross>
          <vat>0.27</vat>
          <quantity>1</quantity>
        </elem>
      </products>
    </elem>
    <elem>
      [ ... ]
    </elem>
    [ ... ]
  </result>
</response>
```

In case of a failed request (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>error</status>
  <message>
    <elem>[field: lastMod]The field must be a valid datetime (eg. yyyy-mm-dd hh:ii:ss)</elem>
  </message>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/GetOrder/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "page": "0",
  "limit": "10",
  "filters": {
    "wspyId": "",
    "referenceId": "",
    "referenceName": "",
    "paymentStatus": "",
    "paymentGateway": "",
    "lastMod": "2018-01-01 00:00:00"
  }
}
```

Response (example):

```
{
  "status": "success",
  "message": [],
  "result": [
    {
      "wspyId": "176",
      "status": "fulfilled",
      "referenceId": "87962-110037",
      "referenceName": "87962-110037",
      "createdAt": "2018-02-14 13:04:33",
      "fulfilledAt": "2018-02-20 16:27:17",
      "paymentGateway": "cod",
      "paymentStatus": "pending",
      "paymentTotalPrice": "8940.00",
      "paymentTotalDiscounts": "1000.00",
      "paymentCurrency": "HUF",
      "shippingMode": "GLS",
      "shippingPrice": "1290.00",
      "shippingVat": "0.27",
      "paidAt": null,
      "codAmount": "1500.00",
      "codCurrency": "HUF",
      "codStatus": "",
      "codReceivedAt": null,
      "trackingCode": "WSHPY176",
      "invoiceStatus": "",
      "invoiceCreatedAt": "2018-02-16 00:00:00",
      "invoiceNo": "inv#00001",
      "refusedInvoiceNo": null,
      "invoiceUrl": null,
      "refusedDate": null,
      "updatedAt": "2018-02-26 12:18:17",
      "products": [
        {
          "sku": "szuperhos-polo-piros-xl",
          "productName": "Szuperhős Póló",
          "variantName": "Piros, XL",
          "priceGross": "1890.00",
          "vat": "0.27",
          "quantity": "3"
        },
        {
          "sku": "cicanaci-one-size",
          "productName": "CicaNaci - One Size",
          "variantName": null,
          "priceGross": "990.00",
          "vat": "0.27",
          "quantity": "1"
        },
        {
          "sku": "akcios-sapka",
          "productName": "Akciós sapka",
          "variantName": "Fekete",
          "priceGross": "1990.00",
          "vat": "0.27",
          "quantity": "1"
        }
      ]
    },
    {
      [ ... ]
    }
  ]
}
```

In case of a failed request (example):

```
{
  "status": "error",
  "message": [
    "[field: lastMod]The field must be a valid datetime (eg. yyyy-mm-dd hh:ii:ss)"
  ]
}
```

| Field              | Description                                                                                                                                                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `status`           | Action's result. Possible values: `success`, `error`                                                                                                                                                                           |
| `message`          | Error messages are in this field in case of a failed request                                                                                                                                                                   |
| `result`           | Results of a successful request are in this field as a block in each case                                                                                                                                                      |
| `wspyId`           | The Internal ID, API returns it when an order is created                                                                                                                                                                       |
| `status`           | <p>Order's status, possible values:<br><code>new</code>: New<br><code>draft</code>: Draft<br><code>ready</code>: Ready<br><code>packing</code>: Packing<br><code>fulfilled</code>: Packed<br><code>refused</code>: Refused</p> |
| `referenceId`      | External ID, the ID given when an order is created                                                                                                                                                                             |
| `referenceName`    | Order's name, the name given when an order is created                                                                                                                                                                          |
| `createdAt`        | (Original) time when the order got created                                                                                                                                                                                     |
| `fulfilledAt`      | Time when the order got packed                                                                                                                                                                                                 |
| `paymentStatus`    | Payment status                                                                                                                                                                                                                 |
| `paidAt`           | In case it is paid, the time of payment                                                                                                                                                                                        |
| `codAmount`        | Amount of Cash On Delivery                                                                                                                                                                                                     |
| `codCurrency`      | Currency of Cash On Delivery                                                                                                                                                                                                   |
| `codStatus`        | Status of Cash On Delivery                                                                                                                                                                                                     |
| `codReceivedAt`    | When the Cash On Delivery got recieved                                                                                                                                                                                         |
| `trackingCode`     | Tracking code of the courier service                                                                                                                                                                                           |
| `invoiceUrl`       | Invoice link to download ([https://example.com/invoice.pdf](http://example.com/invoice.pdf))                                                                                                                                   |
| `invoiceStatus`    | <p>Invoice status<br><code>uninvoiced</code>: Not yet invoiced<br><code>invoiced</code>: Invoiced<br><code>storno</code>: Canceled</p>                                                                                         |
| `invoiceCreatedAt` | Time when the invoice got created                                                                                                                                                                                              |
| `invoiceNo`        | ID number of invoice                                                                                                                                                                                                           |
| `refusedInvoiceNo` | Canceled invoice's ID number                                                                                                                                                                                                   |
| `refusedDate`      | Time of package return, and date of canceled invoice                                                                                                                                                                           |
| `updatedAt`        | Date of last modification in our system                                                                                                                                                                                        |
| `products`         | Products in an order, only in block form                                                                                                                                                                                       |
| `sku`              | Product's SKU, item number                                                                                                                                                                                                     |
| `productName`      | Product's name                                                                                                                                                                                                                 |
| `variantName`      | Product variant name                                                                                                                                                                                                           |
| `priceGross`       | Product's gross selling price                                                                                                                                                                                                  |
| `vat`              | VAT key                                                                                                                                                                                                                        |
| `quantity`         | Ordered quantity                                                                                                                                                                                                               |
| `serial`           | Unique identifier affixed to the product at the time of packaging (optional)                                                                                                                                                   |

## **Generating and modifying orders**

With this function you can create and modify your orders. In case the order does not have a `referenceId`, the API will generate one. In case you do have, and the status of the existing order is new, or draft, or there has not been manual modification, then the API modifies it. In case of a successful generation or modification, API gives back the order's Internal ID.

<table data-header-hidden><thead><tr><th>Field</th><th width="106.33333333333331">Required?</th><th>Description</th></tr></thead><tbody><tr><td>Field</td><td>Required?</td><td>Description</td></tr><tr><td><code>apiKey</code></td><td>Yes</td><td>API key</td></tr><tr><td><code>order</code></td><td>Yes</td><td>Order's details in generation or modification</td></tr><tr><td><code>referenceId</code></td><td>Yes</td><td><p>External ID, free word, recommended to use the order's ID</p><p></p></td></tr><tr><td><code>referenceName</code></td><td>No</td><td>Order name, free word, recommended to use the order's ID or a name created with it, for example <code>ORDER#1221</code></td></tr><tr><td><code>createdAt</code></td><td>Yes</td><td>Time of order's creation</td></tr><tr><td><code>shipping</code></td><td>Yes</td><td>Delivery data</td></tr><tr><td><code>shipping.name</code></td><td>Yes</td><td>Recipient's name</td></tr><tr><td><code>shipping.company</code></td><td>No</td><td>Company name</td></tr><tr><td><code>shipping.email</code></td><td>No</td><td>E-mail address</td></tr><tr><td><code>shipping.phone</code></td><td>No</td><td>Phone number</td></tr><tr><td><code>shipping.countryCode</code></td><td>Yes</td><td>Two-digit country code (e.g.: <code>HU</code>)</td></tr><tr><td><code>shipping.stateOrProvinceCode</code></td><td>No</td><td>State, Province ( especially when addressed abroad)</td></tr><tr><td><code>shipping.zip</code></td><td>Yes</td><td>Post code</td></tr><tr><td><code>shipping.city</code></td><td>Yes</td><td>City</td></tr><tr><td><code>shipping.address1</code></td><td>Yes</td><td>First line of address</td></tr><tr><td><code>shipping.address2</code></td><td>No</td><td>Second line of address</td></tr><tr><td><code>shipping.note</code></td><td>No</td><td>Title's note, use of <code>&#x3C;![CDATA[]]></code> recommended</td></tr><tr><td><code>shipping.mode</code></td><td>No</td><td><p>Transfer method, possible values: </p><ul><li><code>GLS-HU</code>,</li><li><code>DPD-HU,</code></li><li><code>FOXPOST-HU</code>,</li><li><code>DHL</code>,</li><li><code>SPRINTER</code>,</li><li><code>CSOMAGKULDO-HU</code></li><li><code>MPL.</code></li></ul></td></tr><tr><td><code>shipping.packPoint</code></td><td>No</td><td><p>Type of Pack point, possible values: </p><ul><li><code>GLS-HU</code>,</li><li><code>DPD-HU,</code></li><li><code>FOXPOST-HU</code>,</li><li><code>SPRINTER</code>,</li><li><code>CSOMAGKULDO-HU</code></li><li><code>MPL,</code></li><li><code>EUSHIPMENTS-328-ROMANIA-SAMEDAY,</code></li><li><code>EUSHIPMENTS-643-POLAND-INPOST-LOCKERS,</code></li><li><code>EUSHIPMENTS-722-CROATIA-GLS-LOCKERS,</code></li><li><code>EUSHIPMENTS-15-BULGARIA-ECONT.</code></li></ul></td></tr><tr><td><code>shipping.packPointId</code></td><td>No</td><td>Pack point's ID</td></tr><tr><td><code>billing</code></td><td>No*</td><td>Billing data, requested when we invoice</td></tr><tr><td><code>billing.name</code></td><td>Yes</td><td>Invoice name</td></tr><tr><td><code>billing.company</code></td><td>No</td><td>Company name</td></tr><tr><td><code>billing.taxNumber</code></td><td>No</td><td>Tax number</td></tr><tr><td><code>billing.phone</code></td><td>No</td><td>Phone number</td></tr><tr><td><code>billing.countryCode</code></td><td>Yes</td><td>Two-digit country code (e.g.: <code>HU</code>)</td></tr><tr><td><code>billing.zip</code></td><td>Yes</td><td>Post code</td></tr><tr><td><code>billing.city</code></td><td>Yes</td><td>City</td></tr><tr><td><code>billing.address1</code></td><td>Yes</td><td>First line of address</td></tr><tr><td><code>billing.address2</code></td><td>No</td><td>Second line of address</td></tr><tr><td><code>payment</code></td><td>Yes</td><td>Information about payment</td></tr><tr><td><code>payment.paymentMode</code></td><td>Yes</td><td>Payment method, uses smart surveying, recommended values:  <code>cod</code>, <code>card</code>, <code>paypal</code>, etc.</td></tr><tr><td><code>payment.codAmount</code></td><td>No</td><td>Amount of Cash On Delivery, may differ from total, courier recieves it as COD amount</td></tr><tr><td><code>payment.paymentStatus</code></td><td>Yes</td><td>Payment status, possible values: <code>paid</code>, <code>pending</code>. Other cases require consultation</td></tr><tr><td><code>payment.paidDate</code></td><td>No*</td><td>Date of payment, reuired if the status is paid</td></tr><tr><td><code>payment.shippingPrice</code></td><td>No</td><td>Price of delivery fee (Gross)</td></tr><tr><td><code>payment.shippingVat</code></td><td>No</td><td>Price of delivery fee's VAT key</td></tr><tr><td><code>payment.currency</code></td><td>Yes</td><td>Currency of order, three-digit (ISO) ID e.g.: <code>HUF</code> </td></tr><tr><td><code>payment.discount</code></td><td>No</td><td>Discount from Total</td></tr><tr><td><code>products</code></td><td>No</td><td>Products in the Order</td></tr><tr><td><code>products.sku</code></td><td>Yes</td><td>Product's SKU, item number</td></tr><tr><td><code>products.productName</code></td><td>Yes</td><td>Product's name</td></tr><tr><td><code>products.variantName</code></td><td>No</td><td>Product variant name</td></tr><tr><td><code>products.priceGross</code></td><td>Yes</td><td>Product's gross selling price</td></tr><tr><td><code>products.vat</code></td><td>Yes</td><td>VAT key</td></tr><tr><td><code>products.quantity</code></td><td>Yes</td><td>Ordered quantity</td></tr><tr><td><code>invoiceUrl</code></td><td>No</td><td><p>Invoice link to download (<a href="http://example.com/invoice.pdf">https://example.com/invoice.pdf</a>) </p><p><code>Required when API connection has Manual PDF invoice system (in this case the system uses it)</code> </p></td></tr><tr><td><code>pdfSource</code></td><td>No</td><td><p>PDF format invoice file with base64 coding</p><p><code>Required when API connection has Manual PDF invoice system</code></p></td></tr></tbody></table>

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/CreateOrder/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
  <apiKey>api-key-comes-here</apiKey>
  <order>
    <referenceId>87962-110037</referenceId>
    <referenceName>87962-110037</referenceName>
    <createdAt>2018-02-14 13:04:33</createdAt>
    <shipping>
      <name>Kováts Béla</name>
      <company>Virág Bt.</company>
      <email>bela@viragbt.hu</email>
      <phone>+36301234567</phone>
      <countryCode>HU</countryCode>
      <stateOrProvinceCode></stateOrProvinceCode>
      <zip>1234</zip>
      <city>Budapest</city>
      <address1>Virág utca 25.</address1>
      <address2></address2>
      <note><![CDATA[Szállításkor kérem a futárt, hogy ne csengessen!!!]]></note>
      <mode>GLS</mode>
    </shipping>
    <billing>
      <name>Kováts Béla</name>
      <company>Virág Bt.</company>
      <phone>+36301234567</phone>
      <countryCode>HU</countryCode>
      <zip>1234</zip>
      <city>Budapest</city>
      <address1>Virág utca 25.</address1>
      <address2></address2>
    </billing>
    <payment>
      <paymentMode>COD</paymentMode>
      <codAmount>1500.00</codAmount>
      <paymentStatus>pending</paymentStatus>
      <paidDate></paidDate>
      <shippingPrice>1290.00</shippingPrice>
      <shippingVat>0.27</shippingVat>
      <currency>HUF</currency>
      <discount>1000.00</discount>
    </payment>
    <products>
      <elem>
        <sku>szuperhos-polo-piros-xl</sku>
        <productName>Szuperhős Póló</productName>
        <variantName>Piros, XL</variantName>
        <priceGross>1890.00</priceGross>
        <vat>0.27</vat>
        <quantity>3</quantity>
      </elem>
      <elem>
        <sku>cicanaci-one-size</sku>
        <productName>CicaNaci - One Size</productName>
        <priceGross>990.00</priceGross>
        <vat>0.27</vat>
        <quantity>1</quantity>
      </elem>
      <elem>
        <sku>akcios-sapka</sku>
        <productName>Akciós sapka</productName>
        <variantName>Fekete</variantName>
        <priceGross>1990.00</priceGross>
        <vat>0.27</vat>
        <quantity>1</quantity>
      </elem>
    </products>
  </order>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>The order creation was successful</elem>
  </message>
  <wspyId>176</wspyId>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/CreateOrder/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "order": {
    "referenceId": "87962-110037",
    "referenceName": "87962-110037",
    "createdAt": "2018-02-14 13:04:33",
    "shipping": {
      "name": "Kov\u00e1ts B\u00e9la",
      "company": "Vir\u00e1g Bt.",
      "email": "bela@viragbt.hu",
      "phone": "+36301234567",
      "countryCode": "HU",
      "stateOrProvinceCode": "",
      "zip": "1234",
      "city": "Budapest",
      "address1": "Vir\u00e1g utca 25.",
      "address2": "",
      "note": "",
      "mode": "GLS"
    },
    "billing": {
      "name": "Kov\u00e1ts B\u00e9la",
      "company": "Vir\u00e1g Bt.",
      "phone": "+36301234567",
      "countryCode": "HU",
      "zip": "1234",
      "city": "Budapest",
      "address1": "Vir\u00e1g utca 25.",
      "address2": ""
    },
    "payment": {
      "paymentMode": "COD",
      "codAmount": "1500.00",
      "paymentStatus": "pending",
      "paidDate": "",
      "shippingPrice": "1290.00",
      "shippingVat": "0.27",
      "currency": "HUF",
      "discount": "1000.00"
    },
    "products": [
      {
        "sku": "szuperhos-polo-piros-xl",
        "productName": "Szuperh\u0151s P\u00f3l\u00f3",
        "variantName": "Piros, XL",
        "priceGross": "1890.00",
        "vat": "0.27",
        "quantity": "3"
      },
      {
        "sku": "cicanaci-one-size",
        "productName": "CicaNaci - One Size",
        "priceGross": "990.00",
        "vat": "0.27",
        "quantity": "1"
      },
      {
        "sku": "akcios-sapka",
        "productName": "Akci\u00f3s sapka",
        "variantName": "Fekete",
        "priceGross": "1990.00",
        "vat": "0.27",
        "quantity": "1"
      }
    ]
  }
}
```

Response (example):

```
{
  "status": "success",
  "message": [
    "The order creation was successful"
  ],
  "wspyId": 176
}
```

Additional response possibilities:

* `The order creation was successful`
* `The order modification was successful`

## **Order's delete**

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/deleteOrder/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "filters": {
    "wspyId": "917872738"
  }
}
```

**I**n case of **XML**:

Url: `https://app.webshippy.com/wspyapi/deleteOrder/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
 <apiKey>api-key-comes-here</apiKey>
 <filters>
    <wspyId>917872738</wspyId>
  </filters>
</request>
```

| Filtering terms | Description                                              |
| --------------- | -------------------------------------------------------- |
| `wspyId`        | The Internal ID, API returns it when an order is created |
| `referenceId`   | External ID, the ID given when an order is created       |
| `referenceName` | Order's name, the name given when an order is created    |

{% hint style="info" %}
Only one order can be deleted at a time! An order which has been manually modified by a user in Webshippy can not be deleted with API request.
{% endhint %}


# Product API

## **Product requests**

| Filtering terms | Description                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------- |
| `limit`         | Hits within a page (default: 100, maximum: 1000)                                              |
| `page`          | Number of the requested page (default: 0)                                                     |
| `wspyId`        | The Internal ID, API returns it when an order is created                                      |
| `referenceId`   | External ID, the ID given when an order is created                                            |
| `productName`   | Product name, name when the prodcut was created (SQL wildcards allowed)                       |
| `sku`           | Product's SKU, item number                                                                    |
| `barcode`       | Product's barcode                                                                             |
| `lastMod`       | Last modification's date. Lists even several created or modified orders after the given date. |
| `getAllProduct` | Query all products, not limited to the given store API key (true, false)                      |

Filtering terms listed above are linked with `ÉS` , you need to add only the terms that you'd like to filter.&#x20;

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/GetProduct/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
  <apiKey>api-key-comes-here</apiKey>
  <page>0</page>
  <limit>10</limit>
  <filters>
    <wspyId></wspyId>
    <referenceId></referenceId>
    <productName></productName>
    <sku></sku>
    <barcode></barcode>
    <lastMod>2018-01-01 00:00:00</lastMod>
  </filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message/>
  <result>
    <elem>
      <wspyId>74210</wspyId>
      <referenceId>1231</referenceId>
      <sku>szuperhos-polo-piros-xl</sku>
      <barcode>126510305031</barcode>
      <productName>Szuperhős Póló</productName>
      <variantName>Piros, XL</variantName>
      <hasSerial>no</hasSerial>
      <dutiable>yes</dutiable>
      <taricCode>12345</taricCode>
      <lowStock>5</lowStock>
      <price>1200.00</price>
      <vat>0.27</vat>
      <currency>HUF</currency>
      <isAdr>yes</isAdr>
      <adrCode>4</adrCode>
      <adrQuantity>2</adrQuantity>
      <coolingDemand>none</coolingDemand>
      <isFragile>no</isFragile>
      <category>Divat és ruházat</category>
      <subCategory>Gyermek divat</subCategory>
      <keepQuantity>5</keepQuantity>
      <dropshippyWholesalePrice>1000.00</dropshippyWholesalePrice>
      <dropshippyWholesaleVat>0.27</dropshippyWholesaleVat>
      <dropshippyRecommendedPrice>1200.00</dropshippyRecommendedPrice>
      <dropshippyPromotion>no</dropshippyPromotion>
      <productDescription>Szuperhős Póló leírás</productDescription>
      <type>product</type>
      <productType>clothes</productType>
      <imageUrls>https://micoedward.com/wp-content/uploads/2018/04/Love-your-product.png;https://www.noto.design/wp-content/uploads/18-06-14_Heritage_Render_Header-1-1100x619.jpg</imageUrls>
      <quantity>191</quantity>
      <available_quantity>189</available_quantity>
      <reserved_by_orders>2</reserved_by_orders>
      <updatedAt>2018-03-12 11:59:35</updatedAt>
    </elem> 
    <elem>
      <wspyId>74211</wspyId>
      <referenceId>1232</referenceId>
      <sku>cicanaci-one-size</sku>
      <barcode>126510305032</barcode>
      <productName>CicaNaci - One Size</productName>
      <variantName/>
      <hasSerial>no</hasSerial>
      <dutiable>yes</dutiable>
      <taricCode>12345</taricCode>
      <lowStock>5</lowStock>
      <price>1200.00</price>
      <vat>0.27</vat>
      <currency>HUF</currency>
      <isAdr>yes</isAdr>
      <adrCode>4</adrCode>
      <adrQuantity>2</adrQuantity>
      <coolingDemand>none</coolingDemand>
      <isFragile>no</isFragile>
      <category>Divat és ruházat</category>
      <subCategory>Gyermek divat</subCategory>
      <keepQuantity>5</keepQuantity>
      <dropshippyWholesalePrice>1000.00</dropshippyWholesalePrice>
      <dropshippyWholesaleVat>0.27</dropshippyWholesaleVat>
      <dropshippyRecommendedPrice>1200.00</dropshippyRecommendedPrice>
      <dropshippyPromotion>no</dropshippyPromotion>
      <productDescription>CicaNaci - One Size</productDescription>
      <type>product</type>
      <productType>clothes</productType>
      <imageUrls/>
      <quantity>197</quantity>
      <available_quantity>196</available_quantity>
      <reserved_by_orders>1</reserved_by_orders>
      <updatedAt>2018-03-12 11:59:32</updatedAt>
    </elem>
    <elem>
      [ ... ]
    </elem>
    [ ... ]
  </result>
</response>
```

In case of a failed request (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>error</status>
  <message>
    <elem>[field: lastMod]The field must be a valid datetime (eg. yyyy-mm-dd hh:ii:ss)</elem>
  </message>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/GetProduct/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "page": "0",
  "limit": "10",
  "filters": {
    "wspyId": "",
    "referenceId": "",
    "productName": "",
    "sku": "",
    "barcode": "",
    "lastMod": "2018-01-01 00:00:00",
    "getAllProduct": true
  }
}
```

Response (example):

```
{
  "status": "success",
  "message": [],
  "result": [
    {
      "wspyId": "74210",
      "referenceId": "1231",
      "sku": "szuperhos-polo-piros-xl",
      "barcode": "126510305031",
      "productName": "Szuperhős Póló",
      "variantName": "Piros, XL",
      "hasSerial": "no",
      "dutiable": "yes",
      "taricCode": "12345",
      "lowStock": "5",
      "price": "1200.00",
      "vat": "0.27",
      "currency": "HUF",
      "isAdr": "yes",
      "adrCode": "4",
      "adrQuantity": "2",
      "coolingDemand": "none",
      "isFragile": "no",
      "category": "Divat és ruházat",
      "subCategory": "Gyermek divat",
      "keepQuantity": "5",
      "dropshippyWholesalePrice": "1000.00",
      "dropshippyWholesaleVat": "0.27",
      "dropshippyRecommendedPrice": "1200.00",
      "dropshippyPromotion": "no",
      "productDescription": "Szuperhős Póló leírás",
      "type": "product",
      "productType": "clothes",
      "imageUrls": "https://micoedward.com/wp-content/uploads/2018/04/Love-your-product.png;https://www.noto.design/wp-content/uploads/18-06-14_Heritage_Render_Header-1-1100x619.jpg",
      "quantity": "191",
      "available_quantity": "189",
      "reserved_by_orders": "2",
      "updatedAt": "2018-03-12 11:59:35"
    },
    {
      "wspyId": "74211",
      "referenceId": "1232",
      "sku": "cicanaci-one-size",
      "barcode": "126510305032",
      "productName": "CicaNaci - One Size",
      "variantName": "",
      "hasSerial": "no",
      "dutiable": "yes",
      "taricCode": "12345",
      "lowStock": "5",
      "price": "1200.00",
      "vat": "0.27",
      "currency": "HUF",
      "isAdr": "yes",
      "adrCode": "4",
      "adrQuantity": "2",
      "coolingDemand": "none",
      "isFragile": "no",
      "category": "Divat és ruházat",
      "subCategory": "Gyermek divat",
      "keepQuantity": "5",
      "dropshippyWholesalePrice": "1000.00",
      "dropshippyWholesaleVat": "0.27",
      "dropshippyRecommendedPrice": "1200.00",
      "dropshippyPromotion": "no",
      "productDescription": "CicaNaci - One Size",
      "type": "product",
      "productType": "clothes",
      "imageUrls": "",
      "quantity": "197",
      "available_quantity": "196",
      "reserved_by_orders": "1",
      "updatedAt": "2018-03-12 11:59:32"
    },
    {
      [ ... ]
    }
  ]
}
```

In case of a failed request (example):

```
{
  "status": "error",
  "message": [
    "[field: lastMod]The field must be a valid datetime (eg. yyyy-mm-dd hh:ii:ss)"
  ]
}
```

| Field                        | Description                                                                                                                                                                                                    |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `status`                     | Action's result. Possible values: `success`, `error`                                                                                                                                                           |
| `message`                    | Error messages are in this field in case of a failed request                                                                                                                                                   |
| `result`                     | Results of a successful request are in this field as a block in each case                                                                                                                                      |
| `wspyId`                     | The Internal ID, API returns it when an product is created                                                                                                                                                     |
| `referenceId`                | External ID, the ID given when an product is created                                                                                                                                                           |
| `sku`                        | Product's SKU, item number                                                                                                                                                                                     |
| `barcode`                    | <p>Product's barcode. The first will be the product's default barcode, further alternative barcodes can be added seperated with ;</p><p>Format: \[a-zA-Z0-9-\_]</p><p>(e.g.: HU-324;WSPY\_3456;12345; AAA)</p> |
| `productName`                | Product name                                                                                                                                                                                                   |
| `variantName`                | Product variant name                                                                                                                                                                                           |
| `hasSerial`                  | Product has serial number ("yes", "no")                                                                                                                                                                        |
| `dutiable`                   | Clearance ("yes", "no")                                                                                                                                                                                        |
| `taricCode`                  | Customs tariff number                                                                                                                                                                                          |
| `lowStock`                   | Reorder (low stock) notification                                                                                                                                                                               |
| `price`                      | Product price (net)                                                                                                                                                                                            |
| `vat`                        | VAT (Product selling)                                                                                                                                                                                          |
| `currency`                   | <p>Currency.<br>If not defined, the currency of the specific country will be used as default setting.<br>(e.g.: HUF, EUR, CZK, RON)</p>                                                                        |
| `isAdr`                      | Is it hazardous product (ADR)? ("yes", "no")                                                                                                                                                                   |
| `adrCode`                    | ADR code                                                                                                                                                                                                       |
| `adrQuantity`                | ADR value                                                                                                                                                                                                      |
| `coolingDemand`              | Requires cooling ("refrigerator", "freezer", "none")                                                                                                                                                           |
| `isFragile`                  | Is the product fragile? ("yes", "no")                                                                                                                                                                          |
| `categoryUniqueId`           | Category ID                                                                                                                                                                                                    |
| `category`                   | Category name                                                                                                                                                                                                  |
| `subCategory`                | Subcategory name                                                                                                                                                                                               |
| `sub_subCategory`            | Sub-Subcategory name                                                                                                                                                                                           |
| `keepQuantity`               | Reserved own stock                                                                                                                                                                                             |
| `dropshippyWholesalePrice`   | Marketplace wholesale price (in Hungarian forint)                                                                                                                                                              |
| `dropshippyWholesaleVat`     | Marketplace wholesale VAT (ie. 0.27)                                                                                                                                                                           |
| `dropshippyRecommendedPrice` | Marketplace recommended retail price Net (in front)                                                                                                                                                            |
| `productDescription`         | Product description                                                                                                                                                                                            |
| `type`                       | Product type ("product", "virtual")                                                                                                                                                                            |
| `productType`                | Product description for customs                                                                                                                                                                                |
| `imageUrls`                  | Product image urls (with ; \[semicolon] separator, maximum 6 urls)                                                                                                                                             |
| `quantity`                   | Product's stock state (contains both available and reserved quantity)                                                                                                                                          |
| `available_quantity`         | Contains only the available stock (reserved for orders quantity is not included)                                                                                                                               |
| `reserved_by_orders`         | Contains the stock reserved for orders                                                                                                                                                                         |
| `updatedAt`                  | Product's date of last modification                                                                                                                                                                            |

## Generating and modifying a product

With this function you can create and modify a product. In case we do not have the product's `sku`  the API creates one, in case we do have, the API modifies it. All fields are free to modify, except `barcode` field, which is only modifiable if we do not have the data. In case of a successful generation or modification, API returns the order's Internal ID.

{% hint style="info" %}
For Dropshippy use, please go and refer to related [help](https://help.webshippy.com/hu/articles/3768583-sajat-termekek-belistazasa-a-dropshippy-katalogusba) which fields you need to specify
{% endhint %}

| Field                        | Required? | Description                                                                                                                                                                                                    |
| ---------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`                     | Yes       | API key                                                                                                                                                                                                        |
| `product`                    | Yes       | Created or modified product's data                                                                                                                                                                             |
| `referenceId`                | No        | External ID, free word, recommended to use the product's ID                                                                                                                                                    |
| `sku`                        | Yes       | Product's SKU, item number                                                                                                                                                                                     |
| `barcode`                    | No        | <p>Product's barcode. The first will be the product's default barcode, further alternative barcodes can be added seperated with ;</p><p>Format: \[a-zA-Z0-9-\_]</p><p>(e.g.: HU-324;WSPY\_3456;12345; AAA)</p> |
| `productName`                | Yes       | Product name                                                                                                                                                                                                   |
| `variantName`                | No        | Product variant name (e.g.: color, size)                                                                                                                                                                       |
| `type`                       | No        | Product type ("product", "virtual")                                                                                                                                                                            |
| `hasSerial`                  | No        | Product has serial number ("yes", "no")                                                                                                                                                                        |
| `dutiable`                   | No        | Clearance? ("yes", "no")                                                                                                                                                                                       |
| `productDescription`         | No        | Product description                                                                                                                                                                                            |
| `taricCode`                  | No        | Customs tariff number                                                                                                                                                                                          |
| `lowStock`                   | No        | Reorder (low stock) notification                                                                                                                                                                               |
| `price`                      | No        | Product price (net)                                                                                                                                                                                            |
| `vat`                        | No        | VAT (Product selling)                                                                                                                                                                                          |
| `Currency`                   | No        | <p>Currency.<br>If not defined, the currency of the specific country will be used as default setting.<br>(e.g.: HUF, EUR, CZK, RON)</p>                                                                        |
| `isAdr`                      | No        | Is it hazardous product (ADR)? ("yes", "no")                                                                                                                                                                   |
| `adrCode`                    | No        | ADR code                                                                                                                                                                                                       |
| `adrQuantity`                | No        | ADR value                                                                                                                                                                                                      |
| `coolingDemand`              | No        | Requires cooling ("refrigerator", "freezer", "none")                                                                                                                                                           |
| `isFragile`                  | No        | Is the product fragile? ("yes", "no")                                                                                                                                                                          |
| `productType`                | No        | Product description for customs                                                                                                                                                                                |
| `category`                   | No        | Main category ID or name                                                                                                                                                                                       |
| `subCategory`                | No        | Subcategory ID or name                                                                                                                                                                                         |
| `keepQuantity`               | No        | Reserved own stock                                                                                                                                                                                             |
| `dropshippyWholesalePrice`   | No        | Marketplace wholesale price (in forint)                                                                                                                                                                        |
| `dropshippyWholesaleVat`     | No        | Marketplace wholesale VAT (ie. 0.27)                                                                                                                                                                           |
| `dropshippyRecommendedPrice` | No        | Marketplace recommended retail price Net (in forint)                                                                                                                                                           |
| `imageUrls`                  | No        | Product image urls (with ; \[semicolon] separator, maximum 6 urls)                                                                                                                                             |

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/CreateProduct/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
  <apiKey>api-key-comes-here</apiKey>
  <product>
    <referenceId>1231</referenceId>
    <sku>szuperhos-polo-piros-xl</sku>
    <barcode>126510305031</barcode>
    <productName>Szuperhős Póló</productName>
    <variantName>Piros, XL</variantName>
    <type>product</type>
    <hasSerial>no</hasSerial>
    <dutiable>yes</dutiable>
    <productDescription>Szuperhős Póló leírás</productDescription>
    <taricCode>12345</taricCode>
    <lowStock>5</lowStock>
    <price>1200</price>
    <vat>0.27</vat>
    <currency>HUF</currency>
    <isAdr>yes</isAdr>
    <adrCode>4</adrCode>
    <adrQuantity>2</adrQuantity>
    <coolingDemand>none</coolingDemand>
    <isFragile>no</isFragile>
    <productType>clothes</productType>
    <category>Divat és ruházat</category>
    <subCategory>Gyermek divat</subCategory>
    <keepQuantity>5</keepQuantity>
    <dropshippyWholesalePrice>1000</dropshippyWholesalePrice>
    <dropshippyWholesaleVat>0.27</dropshippyWholesaleVat>
    <dropshippyRecommendedPrice>1200</dropshippyRecommendedPrice>
    <dropshippyPromotion>no</dropshippyPromotion>
    <imageUrls>https://micoedward.com/wp-content/uploads/2018/04/Love-your-product.png;https://www.noto.design/wp-content/uploads/18-06-14_Heritage_Render_Header-1-1100x619.jpg</imageUrls>
  </product>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>The product creation was successful</elem>
  </message>
  <wspyId>74210</wspyId>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/CreateProduct/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "product": {
    "referenceId": "1231",
    "sku": "szuperhos-polo-piros-xl",
    "barcode": "126510305031",
    "productName": "Szuperhős Póló",
    "variantName": "Piros, XL",
    "type": "product",
    "hasSerial": "no",
    "dutiable": "yes",
    "productDescription": "Szuperhős Póló leírás",
    "taricCode": "12345",
    "lowStock": "5",
    "price": "1200",
    "vat": "0.27",
    "currency": "HUF",
    "isAdr": "yes",
    "adrCode": "4",
    "adrQuantity": "2",
    "coolingDemand": "none",
    "isFragile": "no",
    "productType": "clothes",
    "category": "Divat és ruházat",
    "subCategory": "Gyermek divat",
    "keepQuantity": "5",
    "dropshippyWholesalePrice": "1000",
    "dropshippyWholesaleVat": "0.27",
    "dropshippyRecommendedPrice": "1200",
    "dropshippyPromotion": "no",
    "imageUrls": "https://micoedward.com/wp-content/uploads/2018/04/Love-your-product.png;https://www.noto.design/wp-content/uploads/18-06-14_Heritage_Render_Header-1-1100x619.jpg"
  }
}
```

Response (example):

```
{
  "status": "success",
  "message": [
    "The product creation was successful"
  ],
  "wspyId": 74210
}
```

Additional response possibilities:

* `The product creation was successful`
* `The product modification was successful`
* `No changes detected in product`

## **Product deletion**

Soon…


# Inventory Transfer API

## Creating transfer

You can create product transfers with this function.

| Field       | Required? | Description                                       |
| ----------- | --------- | ------------------------------------------------- |
| `apiKey`    | Yes       | API key                                           |
| `direction` | Yes       | Direction of transfer in creation (in/out)        |
| `note`      | No        | Note for transfer                                 |
| `date`      | Yes       | Date of expected transfer                         |
| `quantity`  | Yes       | Quantity of product transfered (positive integer) |
| `sku`       | Yes       | Sku of product transfered                         |

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/CreateTransfer/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
 <apiKey>api-key-comes-here</apiKey>
 <transfer>
     <direction>in</direction>
     <note>délután érkezik</note>
     <date>2018-01-01</date>
     <products>
       <elem>
         <quantity>3</quantity>
         <sku>4345</sku>
       </elem>
       <elem>
         <quantity>1</quantity>
         <sku>67657</sku>
       </elem>
       <elem>
         <quantity>1</quantity>
         <sku>56464</sku>
       </elem>
     </products>
 </transfer>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>The transfer creation was successful</elem>
  </message>
  <transfer_id>74210</transfer_id>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/CreateTransfer/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "transfer": {
  "direction": "in",
  "transfer_id": 59,
  "note": "délután viszik el",
  "date": "2018-08-20",
  "products": [
   {
     "quantity": 3,
     "sku": 343545
   },
   {
     "quantity": 2,
     "sku": 654564
   },
   {
     "quantity": 1,
     "sku": 32432432
   }
   ]
 }
}

```

Response (example):

```
{
  "status": "success",
  "message": [
    "The transfer creation was successful"
  ],
  "transfer_id": 176
}
```

```
```

Request:

Url: `https://app.webshippy.com/wspyapi/CreateTransfer/json`

In case of **JSON**:

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>The transfer creation was successful</elem>
  </message>
  <transfer_id>74210</transfer_id>
</response>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<request>
 <apiKey>api-key-comes-here</apiKey>
 <transfer>
     <direction>in</direction>
     <note>délután érkezik</note>
     <date>2018-01-01</date>
     <products>
       <elem>
         <quantity>3</quantity>
         <sku>4345</sku>
       </elem>
       <elem>
         <quantity>1</quantity>
         <sku>67657</sku>
       </elem>
       <elem>
         <quantity>1</quantity>
         <sku>56464</sku>
       </elem>
     </products>
 </transfer>
</request>
```

Request:

Url: `https://app.webshippy.com/wspyapi/CreateTransfer/xml`

## Requesting transfer details

| Field     | Required? | Description                                                                                   |
| --------- | --------- | --------------------------------------------------------------------------------------------- |
| `apiKey`  | Yes       | API key                                                                                       |
| `limit`   | No        | Hits within a page (default: 100, maximum: 1000)                                              |
| `page`    | No        | Number of the requested page (default: 0)                                                     |
| `lastMod` | No        | Last modification's date. Lists even several created or modified orders after the given date. |
| `wspyId`  | No        | Transfer's unique Webshippy ID                                                                |

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/getTransfer/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
 <apiKey>api-key-comes-here</apiKey>
 <page>0</page>
 <limit>1000</limit>
 <filters>
     <wspyId></wspyId>
     <lastMod>2019-01-01 00:00:00</lastMod>
 </filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message/>
  <result>
    <elem>
      <wspyId>7258</wspyId>
      <warehouseId/>
      <status>shipped</status>
      <direction>in</direction>
      <expectedArrival>2019-07-24</expectedArrival>
      <note>t-takács</note>
      <created>2019-07-23 10:54:33</created>
      <updated>2019-07-24 07:24:10</updated>
      <new>2019-07-23 11:51:25</new>
      <arrived>2019-07-24 07:28:57</arrived>
      <transfered>2019-07-24 07:30:45</transfered>
    </elem>
  </result>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/getTransfer/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "page": "0",
  "limit": "1000",
  "filters": {
    "wspyId": "",
    "lastMod": "2019-01-01 00:00:00"
  }
}
```

Response (example):

```
{
    "status": "success",
    "message": [],
    "result": [
        {
            "wspyId": "7258",
            "warehouseId": null,
            "status": "shipped",
            "direction": "in",
            "expectedArrival": "2019-07-24",
            "note": "t-takács",
            "created": "2019-07-23 10:54:33",
            "updated": "2019-07-24 07:24:10",
            "new": "2019-07-23 11:51:25",
            "arrived": "2019-07-24 07:28:57",
            "transfered": "2019-07-24 07:30:45"
        }
    ]
}
```

## Requesting a transfer's items

| Field    | Required? | Description                    |
| -------- | --------- | ------------------------------ |
| `apiKey` | Yes       | API key                        |
| `wspyId` | Yes       | Transfer's unique Webshippy ID |

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/getTransferDetails/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
 <apiKey>api-key-comes-here</apiKey>
 <filters>
     <wspyId>6526</wspyId>
 </filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message/>
  <result>
    <elem>
      <wspyProductId>267812</wspyProductId>
      <productName>Teszt termék 2</productName>
      <variantName/>
      <produtSku>TESZT-2</produtSku>
      <productBarcode>TESZT-2</productBarcode>
      <quantity>10</quantity>
      <checkedQuantity>15</checkedQuantity>
    </elem>
  </result>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/getTransferDetails/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "filters": {
    "wspyId": "6526"
  }
}
```

Response (example):

```
{
    "status": "success",
    "message": [],
    "result": [
        {
            "wspyProductId": "267812",
            "productName": "Teszt termék 2",
            "variantName": "",
            "produtSku": "TESZT-2",
            "productBarcode": "TESZT-2",
            "quantity": "10",
            "checkedQuantity": "15"
        }
    ]
}
```


# External Inventory API

With this function you can set stock quantity for products available from external warehouse and name of the external warehouse. Settings can be made for multiple products at once, the data must be listed by product. If a product (SKU) is listed more than once in the submitted data, the last correct data in the list will be saved for the product.

{% hint style="info" %}
For Marketplace use, please go and refer to related [help](https://help.webshippy.com/hu/articles/3768583-sajat-termekek-belistazasa-a-dropshippy-katalogusba) which fields you need to specify
{% endhint %}

| Filtering terms     | Required? | Desciption                                              |
| ------------------- | --------- | ------------------------------------------------------- |
| `apiKey`            | Yes       | API key                                                 |
| `products`          | Yes       | Data to be entered per product                          |
| `sku`               | Yes       | Product's SKU, item number                              |
| `externalQuantity`  | No        | The stock quantity available from an external warehouse |
| `externalWarehouse` | No        | Name of the external warehouse                          |

In case of **XML**:

Url: `https://app.webshippy.com/wspyapi/ExternalWarehouseInventory/xml`

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
    <apiKey>api-key-comes-here</apiKey>
    <products>
        <product>
        <sku>szuperhos-polo-piros-xl</sku>
        <externalQuantity>50</externalQuantity>
        <externalWarehouse>Külső raktár</externalWarehouse>
        </product>
    </products>
    <products>
        <product>
        <sku>cicanaci-one-size</sku>
        <externalQuantity>100</externalQuantity>
        <externalWarehouse>Külső raktár</externalWarehouse>
        </product>
    </products>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>2 updates successful.</elem>
  </message>
  <products>
    <elem>
      <sku>szuperhos-polo-piros-xl</sku>
      <message>Update successful.</message>
    </elem>
	<elem>
      <sku>cicanaci-one-size</sku>
      <message>Update successful.</message>
    </elem>
  </products>
</response>
```

In case of **JSON**:

Url: `https://app.webshippy.com/wspyapi/ExternalWarehouseInventory/json`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "products": [
    {
      "sku": "szuperhos-polo-piros-xl",
      "externalQuantity": "50",
      "externalWarehouse": "Külső raktár"
    },
    {
      "sku": "cicanaci-one-size",
      "externalQuantity": "100",
      "externalWarehouse": "Külső raktár"
    }
  ]
}
```

Response (example):

```
{
    "status": "success",
    "message": [
        "2 updates successful."
    ],
    "products": [
        {
            "sku": "szuperhos-polo-piros-xl",
            "message": "Update successful."
        },
        {
            "sku": "cicanaci-one-size",
            "message": "Update successful."
        },
    ]
}
```

Additional response possibilities:

* `X updates successful.`
* `X updates successful. Rest Y records caused warning.`
* `No products present`


# GetStock API

Bulk query of current product information in CSV format

### Queryable data <a href="#lekerdezheto-adatok" id="lekerdezheto-adatok"></a>

| Field                         | Description                                                                                                                           |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `sku`                         | The product's SKU (article number).                                                                                                   |
| `quantity`                    | <p>The warehouse quantity of the product.<br>(It includes the available inventory and the quantity reserved by order(s) as well.)</p> |
| `available_quantity`          | <p>The available quantity of the product.<br>(It does not include the quantity reserved by order(s).)</p>                             |
| `reserved_by_orders`          | The quantity reserved by order(s).                                                                                                    |
| `inventory_updated_at`        | Last update in the inventory.                                                                                                         |
| `available_external_quantity` | Available external stock (1-3 days delivery).                                                                                         |
| `immediate_quantity`          | The immediately available inventory.                                                                                                  |

### Filtering conditions <a href="#szuresi-feltetelek" id="szuresi-feltetelek"></a>

| Field                   | Description                        |
| ----------------------- | ---------------------------------- |
| `inventoryUpdatedSince` | The date of the last stock update. |

In case of XML:

Url: `https://app.webshippy.com/wspyapi/getStockInfoCsv/xml/`

Request:

```
<request> 
  <apiKey>api-key-comes-here</apiKey>
  <inventoryUpdatedSince>2020-12-01 00:00:00</inventoryUpdatedSince>
</request>
```

In case of JSON:

Url: `https://app.webshippy.com/wspyapi/getStockInfoCsv/json/`

Request:

```
{
  "apiKey": "api-key-comes-here",
  "inventoryUpdatedSince": "2020-12-01"
} 
```


# Get Brack History API

The Get Brack History API request is used to query the brack history.

| Filtering terms | Description                                                                                                            |
| --------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `page`          | The serial number of the page to be queried.                                                                           |
| `limit`         | <p>The number of results per page.<br>(Maximum 1000/page, above that, one page at a time using page parameter(s).)</p> |
| `dateFrom`      | The date created and restored.                                                                                         |

In case of **XML**:

Request (example):

```
<request>
    <apiKey>LJF7X3OWZdzMaSubHDqhfKC04PTospIA62mtrklj1ReVExGn9B</apiKey>
    <page>0</page>
    <limit>1000</limit>
    <filters>
        <dateFrom>2019-03-08 00:00:00</dateFrom>
    </filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
    <status>
        <![CDATA[success]]>
    </status>
    <message/>
    <result>
        <elem>
            <id>
                <![CDATA[1]]>
            </id>
            <sku>
                <![CDATA[T-SHIRT-SHIP-YOUR-IDEA-BLACK]]>
            </sku>
            <createdAt>
                <![CDATA[2019-03-19 10:45:11]]>
            </createdAt>
            <status>
                <![CDATA[restored]]>
            </status>
            <quantity>
                <![CDATA[1]]>
            </quantity>
            <description/>
            <restoredAt>
                <![CDATA[2022-03-01 16:09:49]]>
            </restoredAt>
            <restoreDescription/>
        </elem>
        <elem>
            <id>
                <![CDATA[5]]>
            </id>
            <sku>
                <![CDATA[T-SHIRT-SHIP-YOUR-IDEA-BLACK]]>
            </sku>
            <createdAt>
                <![CDATA[2019-04-04 16:42:21]]>
            </createdAt>
            <status>
                <![CDATA[restored]]>
            </status>
            <quantity>
                <![CDATA[1]]>
            </quantity>
            <description>
                <![CDATA[Róka tesztel]]>
            </description>
            <restoredAt>
                <![CDATA[2022-03-01 16:09:48]]>
            </restoredAt>
            <restoreDescription/>
        </elem>
        <elem>
            <id>
                <![CDATA[8]]>
            </id>
            <sku>
                <![CDATA[T-SHIRT-SHIP-YOUR-IDEA-GREEN]]>
            </sku>
            <createdAt>
                <![CDATA[2019-05-14 14:23:48]]>
            </createdAt>
            <status>
                <![CDATA[restored]]>
            </status>
            <quantity>
                <![CDATA[1]]>
            </quantity>
            <description>
                <![CDATA[Összetört a termék...]]>
            </description>
            <restoredAt>
                <![CDATA[2022-03-08 08:12:29]]>
            </restoredAt>
            <restoreDescription>
                <![CDATA[Mégsem tört el annyira.]]>
            </restoreDescription>
        </elem>
        <elem>
            <id>
                <![CDATA[9]]>
            </id>
            <sku>
                <![CDATA[T-SHIRT-SHIP-YOUR-IDEA-BLACK]]>
            </sku>
            <createdAt>
                <![CDATA[2019-06-13 13:55:29]]>
            </createdAt>
            <status>
                <![CDATA[bracked]]>
            </status>
            <quantity>
                <![CDATA[1]]>
            </quantity>
            <description>
                <![CDATA[Már nem is tudom]]>
            </description>
            <restoredAt/>
            <restoreDescription/>
        </elem>
    </result>
</response>
```

In case of a failed request (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
    <status>
        <![CDATA[error]]>
    </status>
    <message>
        <elem>
            <![CDATA[API key not present]]>
        </elem>
    </message>
</response>
```

In case of **JSON**:

Request (example):

```
{
    "apiKey": "LJF7X3OWZdzMaSubHDqhfKC04PTospIA62mtrklj1ReVExGn9B",
    "page": 0,
    "limit": 1000,
    "filters": {
        "dateFrom": "2019-03-08 00:00:00”
    }
}
```

Response (example):

```
{
    "status": "success",
    "message": [],
    "result": [
        {
            "id": "1",
            "sku": "T-SHIRT-SHIP-YOUR-IDEA-BLACK",
            "createdAt": "2019-03-19 10:45:11",
            "status": "restored",
            "quantity": "1",
            "description": "",
            "restoredAt": "2022-03-01 16:09:49",
            "restoreDescription": null
        },
        {
            "id": "5",
            "sku": "T-SHIRT-SHIP-YOUR-IDEA-BLACK",
            "createdAt": "2019-04-04 16:42:21",
            "status": "restored",
            "quantity": "1",
            "description": "Róka tesztel",
            "restoredAt": "2022-03-01 16:09:48",
            "restoreDescription": null
        },
        {
            "id": "8",
            "sku": "T-SHIRT-SHIP-YOUR-IDEA-GREEN",
            "createdAt": "2019-05-14 14:23:48",
            "status": "restored",
            "quantity": "1",
            "description": "Összetört a termék...",
            "restoredAt": "2022-03-08 08:12:29",
            "restoreDescription": "Mégsem tört el annyira."
        },
        {
            "id": "9",
            "sku": "T-SHIRT-SHIP-YOUR-IDEA-BLACK",
            "createdAt": "2019-06-13 13:55:29",
            "status": "bracked",
            "quantity": "1",
            "description": "Már nem is tudom",
            "restoredAt": null,
            "restoreDescription": null
        }
    ]
}
```

In case of a failed request (example):

```
{
    "status": "error",
    "message": [
        "API key not present"
    ]
}
```


# Create Bundle API

Creating product bundles

### Creating a product bundle

| Mező           | Kötelező | Leírás                                |
| -------------- | -------- | ------------------------------------- |
| apiKey         | Igen     | API key                               |
| bundleSku      | Igen     | bundle's SKU                          |
| bundleName     | Igen     | bundle's name                         |
| bundlePriceNet | Igen     | product bundle's net price            |
| bundleCurrency | Igen     | Currency of the price                 |
| productSku     | Igen     | SKU of the product in the bundle      |
| quantity       | Igen     | quantity of the product in the bundle |

in case of **XML** :

Url: `https://app.webshippy.com/wspyapi/createBundle/xml`

in case of **JSON** esetén:

Url: `https://app.webshippy.com/wspyapi/createBundle/json`

Request:

```
{
	"apiKey": "xxx-own-apikey-xxx",  
	"bundleSku": "bundlesku-001",    
	"bundleName": "bundlename-001",
	"bundlePriceNet": "1000",
	"bundleCurrency": "HUF",
	"products": [{    
	"productSku": "09002",
	"quantity": "1"
	},
	{    
	"productSku": "09004",
	"quantity": "1"
	}
	]
	}
```


# Marketplace Price Change API

### Product wholesale price setting

| Mező               | Kötelező? | Leírás                                        |
| ------------------ | --------- | --------------------------------------------- |
| `apiKey`           | Igen      | API key                                       |
| `sku`              | Igen      | SKU of the product                            |
| `wholesalePrice`   | Igen      | Wholesale price of the product (net)          |
| `recommendedPrice` | Igen      | Recommended retail price of the product (net) |

in case of **XML**:

Url: <https://app.webshippy.com/wspyapi/DropshippyPriceChange/xml>

Request:

```
<?xml version="1.0" encoding="utf-8"?>
<request>
<apiKey>api-key-comes-here</apiKey>
<products>
<sku>piros-polo</sku>
<wholesalePrice>1000</wholesalePrice>
<recommendedPrice>1700</recommendedPrice>
</products>
<products>
<sku>zold-sapka</sku>
<wholesalePrice>300</wholesalePrice>
<recommendedPrice>800</recommendedPrice>
</products>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="utf-8"?>
<response>
  <status>success</status>
  <message>
    <elem>2 records were processed.</elem>
    <elem>2 updates successful.</elem>
  </message>
  <products>
    <elem>
      <sku>piros-polo</sku>
      <message>Update successful.</message>
    </elem>
    <elem>
      <sku>zold-sapka</sku>
      <message>Update successful.</message>
    </elem>
  </products>
</response>
```

in case of **JSON**:

Url: [https://app.webshippy.com/wspyapi/DropshippyPriceChange/](https://app.webshippy.com/wspyapi/DropshippyPriceChange/xml)json

Request:

```
{
 "apiKey": "api-key-comes-here",
 "products": [ 
 {
 "sku": "piros-polo",
 "wholesalePrice": "1000",
 "recommendedPrice": "1700" 
},
 {
 "sku": "zold-sapka",
 "wholesalePrice": "300",
 "recommendedPrice": "800"
  } ]
}
```

Response (example):

```
{
    "status": "success",
    "message": [
        "2 records were processed.",
        "2 updates successful."
    ],
    "products": [
        {
            "sku": "piros-polo",
            "message": "Update successful."
        },
        {
            "sku": "zold-sapka",
            "message": "Update successful."
        }
    ]
}
```

###

### Error messages that occur

Missing SKU. \
Property wholesalePrice missing. \
Property recommendedPrice missing. \
No price was provided. \
Product is not dropshipped or SKU doesn't exists. \
Incorrect price format, only positive numbers allowed!


# Marketplace Transaction API

## **Transaction request**

This function enables the request of Marketplace transaction details.

Url: <https://app.webshippy.com/wspyapi/getMarketplaceTransactions/{contentType}>

| Filtering terms   | Description                                                                                                                                                                                                   |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invoiceStatus`   | <p></p><p>Status of the invoice (if the given transaction has an invoice attached), possible values:</p><ul><li><code>invoiced</code>,</li><li><code>uninvoiced</code>,</li><li><code>error</code>.</li></ul> |
| `dateFrom`        | Date the transaction was created, same day or newer.                                                                                                                                                          |
| `dateTo`          | Date the transaction was created, same day or older.                                                                                                                                                          |
| `transactionRole` | <p>Role in the transaction, possible values:</p><ul><li><code>supplier</code>,</li><li><code>reatiler</code>.</li></ul>                                                                                       |

The filtering terms given in the table are in an `AND` relationship with one another, only the filtering terms to be filtered for need to be specified.

In case of **XML**:

Request (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<request>
	<apiKey>your-api-key</apiKey>
	<filters>
		<invoiceStatus>invoiced</invoiceStatus>
		<dateFrom>2021-04-21</dateFrom>
		<dateTo>2022-01-12</dateTo>
		<transactionRole>supplier</transactionRole>
	</filters>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>success</status>
	<result>
		<transactionId>DSPY1000134</transactionId>
		<date>2021-02-14 13:09:11</date>
		<paymentStatus>paid</paymentStatus>
		<transferredAt>2021-06-12 14:12:00</transferredAt>
		<parties>
			<supplier>
				<name>Webshippy</name>
			</supplier>
			<retailer>
				<name>Koala Adventures Teszt Bt.</name>
				<address>7621 Hungary Pécs Asd street</address>
				<email>retail@now.com</email>
				<billingTaxNumber>000000000000-99</billingTaxNumber>
			</retailer>
		</parties>
		<payment>
			<paymentId>500864504</paymentId>
		</payment>
		<products>
			<name>Premium Quality Shirt</name>
			<sku>ws2_dspy_rules_11</sku>
			<barcode>ws2_dspy_rules_11-b</barcode>
			<quantity>2</quantity>
			<transactionAmountNet>3800</transactionAmountNet>
			<vat>0</vat>
			<vatSum>0</vatSum>
			<transactionAmountGross>3800</transactionAmountGross>
			<currency>HUF</currency>
		</products>
		<invoice>
			<url>http://webshippy.lh/dropshippy/getTransactionInvoice/1000134</url>
			<status>invoiced</status>
			<serialNumber>Invoice-12345-1-54365</serialNumber>
		</invoice>
	</result>
</response>
```

In case of a failed request (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>error</status>
	<notagname>Invalid API key</notagname>
</response>
```

In case of **JSON**:

Request (example):

```
{
  "apiKey": "your-api-key",
  "filters": {
    "invoiceStatus": "invoiced",
    "dateFrom": "2021-04-21",
    "dateTo": "2022-01-12",
    "transactionRole": "supplier"
  }
}
```

Response (example):

```
{
  "status": "success",
  "result": [
    {
      "transactionId": "DSPY1000134",
      "date": "2021-02-14 13:09:11",
      "paymentStatus": "paid",
      "transferredAt": "2021-06-12 14:12:00",
      "parties": {
        "supplier": {
          "name": "Webshippy"
        },
        "retailer": {
          "name": "Koala Adventures Teszt Bt.",
          "address": "7621 Hungary Pécs Asd street",
          "email": "retail@now.com",
          "billingTaxNumber": "000000000000-99"
        }
      },
      "payment": {
        "paymentId": 500864504
      },
      "products": [
        {
          "name": "Premium Quality Shirt",
          "sku": "ws2_dspy_rules_11",
          "barcode": "ws2_dspy_rules_11-b",
          "quantity": 2,
          "transactionAmountNet": 3800,
          "vat": 0,
          "vatSum": 0,
          "transactionAmountGross": 3800,
          "currency": "HUF"
        }
      ],
      "invoice": {
        "url": "http://webshippy.lh/dropshippy/getTransactionInvoice/1000134",
        "status": "invoiced",
        "serialNumber": "Invoice-12345-1-54365"
      }
    }
  ]
}
```

In case of a failed request (example):

```
{
  "status": "error",
  "message": [
    "Invalid API key"
  ]
}
```

### Upload of invoice issued

This function enables the Marketplace suppliers to upload the invoice related to a specific transaction. A single api call allows invoice upload for multiple transactions simultaneously, but only one invoice per transaction is supported. The invoice upload is in base64 format. If there's no invoice associated with a specific transaction ID, the API will create one.

Url: <https://app.webshippy.com/wspyapi/uploadMarketplaceTransactionInvoice/{contentType}>

<table><thead><tr><th>Field</th><th width="164.33333333333331">Required?</th><th>Description</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td>Yes</td><td>The API key.</td></tr><tr><td><code>transactionId</code></td><td>Yes</td><td>The transaction ID.</td></tr><tr><td><code>invoiceSerialNumber</code></td><td>Yes</td><td>The serial number of the invoice (name of the file).</td></tr><tr><td><code>fileInput</code></td><td>Yes</td><td>The invoice in base64 format.</td></tr></tbody></table>

In case of **XML**:

Request (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<request>
	<apiKey>your-api-key</apiKey>
	<invoice>
		<transactionId>DSPY1000134</transactionId>
		<invoiceSerialNumber>Invoice-12345-1-54365</invoiceSerialNumber>
		<fileInput>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==</fileInput>
	</invoice>
</request>
```

Response (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>success</status>
	<result>
		<transactionId>DSPY1000134</transactionId>
		<invoiceSerialNumber>Invoice-12345-1-54365</invoiceSerialNumber>
		<fileInput>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==</fileInput>
	</result>
</response>
```

In case of a failed request (example):

```
<?xml version="1.0" encoding="UTF-8"?>
<response>
	<status>error</status>
	<result>
		<transactionId>DSPY1000134</transactionId>
		<invoiceSerialNumber>Invoice-12345-1-54365</invoiceSerialNumber>
		<fileInput>iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==</fileInput>
	</result>
	<message>Invoice [invoiceSerialNumber] upload failed, due to: [error]</message>
</response>
```

In case of **JSON**:

Request (example):

```
{
  "apiKey": "your-api-key",
  "invoice": [
    {
      "transactionId": "DSPY1000134",
      "invoiceSerialNumber": "Invoice-12345-1-54365",
      "fileInput": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
    }
  ]
}
```

Response (example):

```
{
  "status": "success",
  "result": [
    {
      "transactionId": "DSPY1000134",
      "invoiceSerialNumber": "Invoice-12345-1-54365",
      "fileInput": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
    }
  ]
}
```

In case of a failed request (example):

```
{
  "status": "error",
  "result": [
    {
      "transactionId": "DSPY1000134",
      "invoiceSerialNumber": "Invoice-12345-1-54365",
      "fileInput": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg=="
    }
  ],
  "message": [
    "Invoice [invoiceSerialNumber] upload failed, due to: [error]"
  ]
}
```

**Additional response options** in case of failed request:

* `"[field:example] Example field has to be integer"`
* `"Invalid API key"`
* `"Entity not found"`
* `"Already existing entity"`


# Shipping Mode API

Shipping mode API is a tool designed for web store engine developers that does everything to dynamically return the delivery methods available to Webshippy visitors to a web store's payment process through cart content and shipping address (input). The customer can choose from the returned partner companies on the web store interface.

{% file src="/files/-Meiedxc3hOU5MZpuiKr" %}
Webshippy Shipping AI v1.0.0
{% endfile %}

​

{% hint style="info" %}

1. To open this file, use: <https://editor.swagger.io/> > File > Import file
2. About authentication: <https://apidoc.webshippy.com/#authnetikacio-api-kulcs-generalasa>
   {% endhint %}

​


# Push API

Indication of the status change of the order and the delivery of goods based on physical events.

The notification is sent to predefined (separate) endpoints fixed in the settings of the Webshippy API sales channel (webshippy.api).

{% hint style="info" %}
The push api arrives at the endpoints defined in the first active sales channel.
{% endhint %}

In addition to the status of the process, the notification contains the ID and name of the order, the ID and nickname of the goods delivery, as well as when the status change occurred.

#### **Order** <a href="#megrendeles" id="megrendeles"></a>

| Field       | Description                                                                                                |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| `id`        | The unique Webshippy ID of the order.                                                                      |
| `name`      | Name of the order. The name entered when the order was created.                                            |
| `status`    | <p>Order status, possible values:</p><ul><li><code>refused</code></li><li><code>fulfilled</code></li></ul> |
| `updatedAt` | Date and time of status change.                                                                            |

#### **Transfer** <a href="#aruszallitas" id="aruszallitas"></a>

| Field       | Description                                                                                                                                                                                       |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`        | The unique Webshippy identifier of the goods delivery.                                                                                                                                            |
| `nickname`  | The delivery of goods created with a fantasy name via the API can be searched on the list interface based on its name. When updating the delivery of goods, the fantasy name can also be updated. |
| `status`    | The status of the goods delivery (shipped).                                                                                                                                                       |
| `updatedAt` | Date and time of status change.                                                                                                                                                                   |

{% file src="/files/pGD33pRIV4aNEo3zp4Ox" %}


# Track Info API

The status of order shipments and the tracking URL can be queried for the following courier services:

|             | trackingNo | shippingStatus | trackingUrl | history |
| ----------- | :--------: | :------------: | :---------: | :-----: |
| GLS         |      ✅     |        ✅       |      ✅      |    ✅    |
| Foxpost     |      ✅     |        ✅       |      ✅      |    ✅    |
| MPL         |      ✅     |        ❌       |      ✅      |    ❌    |
| Sprinter    |      ✅     |        ✅       |      ✅      |    ✅    |
| Packeta     |      ✅     |        ✅       |      ✅      |    ✅    |
| DPD         |      ✅     |        ❌       |      ❌      |    ❌    |
| DHL         |      ✅     |        ❌       |      ✅      |    ❌    |
| Eushipments |      ✅     |        ✅       |  partially  |    ✅    |

| Parameter | Description                                                                            | Mandatory  |
| --------- | -------------------------------------------------------------------------------------- | ---------- |
| apiKey    | API key                                                                                | yes        |
| limit     | The number of elements in the list (maximum 1000).                                     | no         |
| page      | The page number to query.                                                              | no         |
| orderIds  | The webshippy identifiers of the orders are separated by commas.                       | optional\* |
| updatedAt | The time of the earliest update by the courier service, given in Y-m-d\TH:i:sP format. | optional\* |

{% hint style="info" %}

```
* At least one of the orderIds and updatedAt fields is mandatory.
```

{% endhint %}

Sample request (XML):

```
https://app.webshippy.com/wspyapi/getTrackInfo/xml?apiKey={{apiKey}}&page=0&orderIds=32042911
```

Sample request (JSON):

```
https://app.webshippy.com/wspyapi/getTrackInfo/json?apiKey={{apiKey}}&page=0&orderIds=32042911
```

Response (JSON):

```
{
    "status": "success",
    "message": [],
    "result": {
        "274": {
            "orderId": "274",
            "trackingNo": "3300597015",
            "shippingStatus": "completed",
            "trackingUrl": "https://gls-group.eu/HU/hu/csomagkovetes?match=3300597015",
            "history": [
                {
                    "status": "delivered",
                    "statusCode": "05",
                    "date": "2024-01-03 14:31:49"
                },
                {
                    "status": "Can be picked up from GLS parcel locker",
                    "statusCode": "54",
                    "date": "2024-01-02 10:44:03"
                },
                {
                    "status": "Data sent",
                    "statusCode": "51",
                    "date": "2023-12-29 13:15:05"
                }
            ]
        }
    }
}
```

Response on incorrect request:

```
{
    "status": "error",
    "message": [
        "Error: At least one field is required: orderIDs, updatedAt"
    ]
}
```


# External Inventory Feed

Synchronization of external stock of products using XML feed

By using the feed, you can mass-adjust the amount of stock available from the external warehouse of already recorded products. If the same sku appears more than once in the feed, the value belonging to the last one is recorded.&#x20;

Feeds are processed every day at 07:00 and 17:00 (UTC).

Send the completed feed url to <support@webshippy.com>.

#### Usable fields:

| Field   | Leírás                                                   |
| ------- | -------------------------------------------------------- |
| `sku`   | Item number of the product.                              |
| `stock` | The quantity of available external stock of the product. |

#### Sample feed:

```
<?xml version="1.0" encoding="utf-8"?>
<products>
  <product>
    <sku>shirt001</sku>
    <stock>30</stock>
  </product>
  <product>
    <sku>boot234</sku>
    <stock>15</stock>
  </product>
</products>
```

{% hint style="info" %}
If it is necessary to connect an existing feed, then in addition to the same structure as above, it is also possible to use different field names, but a separate consultation is required for this!

If the XML file contains additional data in addition to the sku and stock fields, the additional information will not be processed.
{% endhint %}


