# 21. Campaign Query

## Campaign Query

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/campaign/vpos/inquiry`

{% hint style="info" %}
**Important:** To use the campaign query service, you must include the **apikeypublic** and **apiclientpublic** parameters in the **Header**.\
\
[<mark style="color:green;">**PaymentAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

**Sent Header Information:**

<table><thead><tr><th width="173">Parameter</th><th width="110">Type</th><th width="142.25">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>The <strong>Public Key</strong> obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The <strong>Public Client</strong> obtained from the merchant panel.</td></tr></tbody></table>

{% hint style="info" %}
You can send a query request to the campaign query service either with a saved card (**IsSavedCard + UniqueCode**) or manually using unsaved card details.
{% endhint %}

**Sent Body Information:**

{% tabs %}
{% tab title="JSON" %}

```json
{
    "CurrencyId": 1,
    "Amount": 1,
    "Card": {
        "Partner": {
            "PartnerBased": false,
            "PartnerIdentity": ""
        },
        "IsSavedCard": false,
        "UniqueCode": "",
        "Number": "4799174799173828",
        "ExpireMonth": "12",
        "ExpireYear": "2028"
    }
}
```

{% endtab %}
{% endtabs %}

**Parameters Returned from the Service**

<table><thead><tr><th width="268">Parameter</th><th width="183.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>CurrencyId</td><td>short</td><td>Currency of the campaign<br><br>See: <a href="/pages/bahfUMz1dqpN1ZCnpVtM">Currency</a></td></tr><tr><td>Amount</td><td>decimal</td><td><p>Amount within the scope of the campaign</p><p></p><p><strong>Note:</strong> The value returned is the same as the amount sent during the query.</p></td></tr><tr><td>CampaignIndex</td><td>string</td><td>Order of the campaign on the queried provider side</td></tr><tr><td>CampaignCode</td><td>string</td><td><p>Campaign code on the queried provider side</p><p></p><p><strong>Note:</strong> This value must be sent during the payment initiation.</p></td></tr><tr><td>CampaignDescription</td><td>string</td><td>Campaign description on the queried provider side</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCodeType": 1,
    "ErrorMessage": null,
    "ErrorCode": 0,
    "Result": true,
    "Message": "Campaign Inquiry Successful",
    "Body": {
        "Campaigns": [
            {
                "CurrencyId": 1,
                "Amount": 1.0,
                "CampaignIndex": "1",
                "CampaignCode": "00000000",
                "CampaignDescription": "Kampanya Kullanma"
            },
            {
                "CurrencyId": 1,
                "Amount": 1.0,
                "CampaignIndex": "0",
                "CampaignCode": "00000001",
                "CampaignDescription": "+4 Taksit Imkani"
            }
        ]
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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://developer.paywall.one/payment-orchestration-integration-document/payment-service/21.-campaign-query.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.
