> The index of all pages is at [llms.txt](https://developers.qliro.com/llms.txt). Add `.md` to any page URL for its Markdown.

# Create merchant payment (/api-reference/admin/merchant-payment/create-merchant-payment)

`POST https://payments.qliro.com/checkout/adminapi/v2/merchantpayment`

Production: `https://payments.qliro.com/checkout/adminapi`. Staging: `https://pago.qit.nu/checkout/adminapi`

Creates a recurring order and starts the purchase on behalf of the customer.

The response only confirms that Qliro received the request. Qliro sends the result in a notification with the `OrderId` and `PaymentTransactionId`.

## Body (application/json)

- `RequestId` (string): A GUID formatted string used to avoid the same request being executed multiple times. The GUID will be stored for 7 days, and during that time, any requests sent with the same GUID will be denied. https://guidgenerator.com/online-guid-generator.aspx. Format: `guid`
- `MerchantApiKey` (string, required): Will be provided by Qliro Checkout when setting up merchant account. Length: `0 <= x <= 50`
- `MerchantReference` (string, required): A string generated by the merchant to identify the order uniquely in their system. Maximum length is 25 characters. Length: `x >= 1`. Pattern: `^[A-Za-z0-9_|\-]{1,25}$`
- `Currency` (string, required): Three uppercase characters, in accordance with ISO 4217. Length: `x >= 1`
- `Country` (string, required): Two upper case characters. In accordance with ISO 3166-1. Length: `x >= 1`
- `Language` (string, required): Locale indicative for language & other location-specific details. Length: `x >= 1`
- `MerchantOrderManagementStatusPushUrl` (string | null): Qliro will use this URL to send notifications on payment status changes during the order management process
- `OrderItems` (object[], required): Array of items in order
  - `MerchantReference` (string, required): A string generated by the merchant to identify the order item. The combination of MerchantReference and PricePerItemIncVat is used to uniquely identify the order item. Maximum length is 200 characters. Length: `x >= 1`. Pattern: `^[\p{L}\s(.)'\-_&,\/–+0-9:|]{1,200}$`
  - `Description` (string | null): A name or description of the order item. Length: `x <= 4000`
  - `Type` (string | null): Can be 'Product', 'Discount', 'Fee' or 'Shipping'
  - `Quantity` (integer): The number of these items in the cart. Format: `int32`. Range: `1 <= x <= 2147483647`
  - `PricePerItemIncVat` (number): The price per item including Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `PricePerItemExVat` (number): The price per item excluding Value Added Tax. This can be specified with 0, 1 or 2 decimals, e.g. 99, 99.9 or 99.99. Format: `decimal`
  - `VatRate` (number): The VAT rate for the item. Always specified with 2 decimals, e.g. 25.00 = 2500. Format: `decimal`
- `Customer` (object | null): Customer information. Not required for CreditCard payment, required otherwise
  - `PersonalNumber` (string | null): A national identification number to identify the customer. Not required if Physical without personal number, required otherwise. Length: `0 <= x <= 50`
  - `VatNumber` (string | null): Value added tax number for 'Company' customers. Length: `0 <= x <= 50`
  - `Email` (string | null): The customer's email address. Length: `0 <= x <= 255`
  - `JuridicalType` (string | null): 'Physical' or 'Company'. If 'Company', the PersonalNumber parameter will be interpreted as an organization number
  - `MobileNumber` (string | null): The customer's mobile number. Length: `0 <= x <= 50`
- `BillingAddress` (object, required): Customer billing address
  - `FirstName` (string, required): The first name of a physical customer's address. Length: `0 <= x <= 100`
  - `LastName` (string, required): The Last name of a physical customer's address. Length: `0 <= x <= 100`
  - `CompanyName` (string | null): Address holders company name, only applicable for Company Customers. Length: `0 <= x <= 100`
  - `Street` (string, required): The street name and number of the address. Length: `0 <= x <= 100`
  - `Street2` (string | null): The secondary address line for apartment, suite, department, unit, building, floor etc. Used for company customers and for physical customers in the following countries: Australia, Bosnia and Herzegovina, Canada, Croatia, Cyprus, Czech Rebublic, Estonia, France, Greece, Hungary, Iceland, Ireland, Italy, Lithuania, Luxembourg, Macedonia, Malta, Montenegro, Poland, Portugal, Romania, Serbia, Slovakia, Slovenia, Spain, UK, US, Åland. Length: `0 <= x <= 40`
  - `PostalCode` (string, required): The postal code of the address. Length: `0 <= x <= 15`
  - `City` (string, required): The city of the address. Length: `0 <= x <= 100`
  - `CareOf` (string | null): Used if the addressee doesn't have a standard address. Length: `0 <= x <= 100`
  - `Area` (string | null): The State/Province/Region of the address. Used in the following countries: Australia, Bosnia and Herzegovina, Canada, Cyprus, Ireland, Italy, Lithuania,Luxembourg, Macedonia, Malta, Montenegro, Romania, US, Åland. Length: `0 <= x <= 100`
  - `AreaCode` (string | null): Geographical area code in ISO3166-2 format. Length: `0 <= x <= 10`
- `ShippingAddress` (object | null): Customer shipping address. If shipping address not provided billing address will be used as shipping address
  - `FirstName` (string, required): The first name of a physical customer's address. Length: `0 <= x <= 100`
  - `LastName` (string, required): The Last name of a physical customer's address. Length: `0 <= x <= 100`
  - `CompanyName` (string | null): Address holders company name, only applicable for Company Customers. Length: `0 <= x <= 100`
  - `Street` (string, required): The street name and number of the address. Length: `0 <= x <= 100`
  - `Street2` (string | null): The secondary address line for apartment, suite, department, unit, building, floor etc. Used for company customers and for physical customers in the following countries: Australia, Bosnia and Herzegovina, Canada, Croatia, Cyprus, Czech Rebublic, Estonia, France, Greece, Hungary, Iceland, Ireland, Italy, Lithuania, Luxembourg, Macedonia, Malta, Montenegro, Poland, Portugal, Romania, Serbia, Slovakia, Slovenia, Spain, UK, US, Åland. Length: `0 <= x <= 40`
  - `PostalCode` (string, required): The postal code of the address. Length: `0 <= x <= 15`
  - `City` (string, required): The city of the address. Length: `0 <= x <= 100`
  - `CareOf` (string | null): Used if the addressee doesn't have a standard address. Length: `0 <= x <= 100`
  - `Area` (string | null): The State/Province/Region of the address. Used in the following countries: Australia, Bosnia and Herzegovina, Canada, Cyprus, Ireland, Italy, Lithuania,Luxembourg, Macedonia, Malta, Montenegro, Romania, US, Åland. Length: `0 <= x <= 100`
  - `AreaCode` (string | null): Geographical area code in ISO3166-2 format. Length: `0 <= x <= 10`
- `PaymentMethod` (object, required): Payment method for the specific purchase
  - `Name` (string, required): Can be ‘CREDITCARDS’ , ‘QLIRO_INVOICE’. Length: `x >= 1`
  - `Subtype` (string | null): Can be 'INVOICE'. Required only if QLIRO_INVOICE
  - `SelectedLetterInvoiceOption` (boolean | null): If QLIRO_INVOICE Select True if customers require a letter invoice instead of e-mail. Additional fee may apply to the order. Letter Invoice item with type Fee will be added to the order with price dependent of merchant configuration
  - `MerchantSavedCreditCardId` (string | null): Required if CREDITCARDS Will be used to identify customer. Format: `guid`

## Responses

### 200 (application/json)

Request received.

- `OrderId` (integer): Format: `int64`
- `PaymentTransactions` (object[] | null)
  - `PaymentTransactionId` (integer): Format: `int64`
  - `Status` (InfrastructureConstantsPaymentTransactionStatus): Values: `0`, `1`, `2`, `3`, `4`, `5`, `6`

Example:

```json
{
  "OrderId": 0,
  "PaymentTransactions": [
    {
      "PaymentTransactionId": 0,
      "Status": 0
    }
  ]
}
```

### 400 (application/json)

- `ErrorCode` (string | null): Unique error code
- `ErrorMessage` (string | null): Detailed error message
- `ErrorReference` (string): A tracking ID from Qliro Checkout. Format: `guid`

Example:

```json
{
  "ErrorCode": "string",
  "ErrorMessage": "string",
  "ErrorReference": "string"
}
```

### 500 (application/json)

- `ErrorCode` (string | null): Unique error code
- `ErrorMessage` (string | null): Detailed error message
- `ErrorReference` (string): A tracking ID from Qliro Checkout. Format: `guid`

Example:

```json
{
  "ErrorCode": "string",
  "ErrorMessage": "string",
  "ErrorReference": "string"
}
```

## Example request

```bash
curl -X POST "https://payments.qliro.com/checkout/adminapi/v2/merchantpayment" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "HATS",
  "MerchantReference": "MerchantUniqueReference",
  "Currency": "SEK",
  "Country": "SE",
  "Language": "sv-se",
  "OrderItems": [
    {
      "MerchantReference": "Mobile-Phone"
    }
  ],
  "BillingAddress": {
    "FirstName": "John",
    "LastName": "Doe",
    "Street": "Sveavägen 151",
    "PostalCode": 17748,
    "City": "Stockholm"
  },
  "PaymentMethod": {
    "Name": "CREDITCARDS"
  }
}'
```
