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

# Update merchant reference (/api-reference/admin/orders/update-merchant-reference)

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

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

Updates the `MerchantReference` of an order. For orders paid with a Qliro payment method, Qliro creates a new transaction and returns its `PaymentTransactionId`. For other payment methods, a successful update returns only the 200 status code.

## 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`
- `OrderId` (integer, required): The Qliro Checkout order ID. Format: `int64`
- `NewMerchantReference` (string, required): The new merchant reference. Length: `x >= 1`. Pattern: `^[A-Za-z0-9_|\-]{1,25}$`

## Responses

### 200 (application/json)

Reference updated.

- `discriminator` (string, required)

Example:

```json
{
  "discriminator": "string"
}
```

### 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/updatemerchantreference" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "HATS",
  "OrderId": 1215412,
  "NewMerchantReference": "merchant-reference-new"
}'
```
