# Payment Query
###### The Payment Query is an optional step in the workflow in which merchants can allow their customers to select the desired payment method dynamically.
The Ratepay risk management system detects the appropriate payment methods for the given context and returns a list of the permitted Ratepay payment products. The used subtype influences the RMS in constructing the list of permitted products. This list can be empty if no Ratepay product is available for this customer.
Please contact your Ratepay representative for **contractual terms for using this feature**.
## Request Parameters
### `
` Section
| Parameter | Condition | Enumeration |
| --- | --- | --- |
| `system-id` | Mandatory | |
| `transaction-id` | Mandatory | |
| `operation` | Mandatory | `PAYMENT_QUERY` |
| `operation@subtype` | Mandatory | `full` |
| `credential` | Mandatory | |
| `customer-device` | Optional | |
| `external` | Optional | |
| `meta` | Optional | |
### `` Section
The `` section of the **PAYMENT_QUERY request** contains customer and shopping basket data.
| Parameter | Condition | Restriction |
| --- | --- | --- |
| `customer` | Mandatory | |
| `shopping-basket` | Mandatory | Contains one or more `item` elements |
### XML Example
```xml
myshop
xx-xxxxxxxxxxxxxx
PAYMENT_QUERY
INTEGRATION_TE_DACH
4c0a11923fa3433fb168f9c7176429e9
12345
vip
Max
Mustermann
Dr.
M
1982-10-31
127.0.0.1
test@test.de
030123456
Nicht-Versenden-Straße 1
2
12345
Testhausen
DE
DE
yes
- Article 1
- Article 2
```
## Response Parameters
### `` Section
| Parameter | Condition | Enumeration |
| --- | --- | --- |
| `system-id` | Mandatory | |
| `transaction-id` | Mandatory | |
| `operation` | Mandatory | `PAYMENT_QUERY` |
| `operation@subtype` | Mandatory | `full` |
| `response-type` | Mandatory | - success:`PAYMENT_PERMISSION`- failure:`STATUS_ERROR` |
| `external` | Optional | |
| `processing` | Mandatory | |
### `` Section
The `` section of the **PAYMENT_QUERY response** contains a list of allowed Ratepay products.
| Parameter | Condition | Restriction |
| --- | --- | --- |
| `products` | Mandatory for:- response-type`PAYMENT_PRODUCTS`N/A for:- other response-types | Contains zero, one or more `product` elements. |
### XML Examples
#### All allowed
```xml
myshop
xx-xxxxxxxxxxxxxx
PAYMENT_QUERY
PAYMENT_PRODUCTS
12345
vip
2012-04-30T12:27:39.234
Successfully
Request successful
Transaction result pending
```
#### None allowed
```xml
myshop
xx-xxxxxxxxxxxxxx
PAYMENT_QUERY
PAYMENT_PRODUCTS
12345
vip
2012-04-30T12:27:39.234
Successfully
Request successful
Transaction result pending
```
#### Tech error
```xml
myshop
xx-xxxxxxxxxxxxxx
PAYMENT_QUERY
STATUS_ERROR
12345
vip
2016-12-22T14:21:07.000
Error
billing address not valid
Processing failed
```