# Marketplace Transaction API

### Tranzakciók lekérdezése

Ezzel a funkcióval lekérdezhetőek a Marketplace tranzakciók részletes adatai.

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

<table><thead><tr><th width="366.7279029462738">Szűrési feltétel</th><th>Leírás</th></tr></thead><tbody><tr><td><code>invoiceStatus</code></td><td><p>Számla státusza (adott tranzakcióhoz van-e már számla), lehetséges értékei:</p><ul><li><code>invoiced</code>,</li><li><code>uninvoiced</code>,</li><li><code>error</code>.</li></ul></td></tr><tr><td><code>dateFrom</code></td><td>Tranzakció létrehozás dátuma aznapi vagy frissebb.</td></tr><tr><td><code>dateTo</code></td><td>Tranzakció létrehozás dátuma aznapi vagy régebbi.</td></tr><tr><td><code>transactionRole</code></td><td><p>A tranzakcióban betöltött szerep, lehetséges értékek:</p><ul><li><code>supplier</code>,</li><li> <code>retailer</code>.</li></ul></td></tr></tbody></table>

A táblázatban megadott szűrési feltételek `ÉS` kapcsolatban állnak egymással, csak azokat a szűrőket kell megadni, amelyekre szűrni szeretnénk.

**XML** esetén:

Kérés (példa):

```
<?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>
```

Válasz (példa):

```
<?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>
```

Hibás kérés esetén (példa):

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

**JSON** esetén:

Kérés (példa):

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

Válasz (példa):

```
{
  "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"
      }
    }
  ]
}
```

Hibás kérés esetén (példa):

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

### Kiállított számla feltöltés

Ezzel a funkcióval a Marketplace beszállító partnerek a kiállított számláikat fel tudják tölteni a vonatkozó tranzakciókhoz. 1 api hívással n tranzakcióhoz lehet feltölteni számlát. 1 db számla feltöltés base64 formátumban tranzakciónként. Amennyiben a megadott tranzakció azonosítóhoz még nem szerepel nálunk számla, akkor az API létrehozza.

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

<table><thead><tr><th width="260.3333333333333">Mező</th><th width="150">Kötelező?</th><th>Leírás</th></tr></thead><tbody><tr><td><code>apiKey</code> </td><td>Igen</td><td>Az API kulcs.</td></tr><tr><td><code>transactionId</code></td><td>Igen</td><td>A tranzakció azonosítója.</td></tr><tr><td><code>invoiceSerialNumber</code></td><td>Igen</td><td>A számla sorszáma (a fájl neve).</td></tr><tr><td><code>fileInput</code></td><td>Igen</td><td>A számla base64 formátumban.</td></tr></tbody></table>

**XML** esetén:

Kérés (példa):

```
<?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>
```

Válasz (példa):

```
<?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>
```

Hibás kérés esetén (példa):

```
<?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>
```

**JSON** esetén:

Kérés (példa):

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

Válasz (példa):

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

Hibás kérés esetén (példa):

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

**További válasz lehetőségek** hibás kérés esetén:

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidoc.webshippy.com/webaruhaz-integraciok/marketplace-transaction-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
