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

# Save credit card (/api-reference/merchant/merchant-credit-card/create-merchant-saved-credit-card)

`POST https://payments.qliro.com/checkout/merchantapi/CreateMerchantSavedCreditCard`

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

This request returns an HTML snippet, the same way Create order does. When the customer registers the new credit card and the payment succeeds, Qliro redirects the customer to your `MerchantConfirmationUrl`.

Registering the card token can take some time, depending on the card provider. When it is done, Qliro sends the saved card details in a push notification to your `MerchantSavedCreditCardPushUrl`.

## Body (application/json)

- `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`
- `MerchantSavedCreditCardPushUrl` (string, required): Qliro will use this URL to send notifications on saved merchant credit card. Length: `x >= 1`
- `MerchantConfirmationUrl` (string | null): A URL to where Qliro will redirect the the customer once the payment is completed. Format: `uri`
- `Customer` (object, required): Customer information used to try to identify the customer without user interaction
  - `PersonalNumber` (string | null): A national identification number to identify the customer. Length: `0 <= x <= 50`
  - `VatNumber` (string | null): Value added tax number for Company use. Length: `0 <= x <= 50`
  - `Email` (string, required): The customer's email address. Length: `0 <= x <= 255`
  - `JuridicalType` (string, required): 'Physical' or 'Company'. If 'Company', the PersonalNumber parameter will be interpreted as an organization number. Length: `x >= 1`
  - `MobileNumber` (string, required): The customer's mobile number. Length: `0 <= x <= 50`
  - `PostalCode` (string | null): The customer’s  postal code. Length: `0 <= x <= 15`

## Responses

### 200 (application/json)

- `OrderId` (integer): Format: `int64`
- `OrderForRegistrationTokenHtmlSnippet` (string | null)

Example:

```json
{
  "OrderId": 12345,
  "OrderForRegistrationTokenHtmlSnippet": "{script tag}"
}
```

### 400 (application/json)

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

Example:

```json
{
  "ErrorCode": "ORDER_NOT_FOUND",
  "DetailedErrorMessage": "Order not found",
  "ErrorReference": "d7da92f4-1ad9-48c3-9cd3-26559c98e64c"
}
```

### 500 (application/json)

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

Example:

```json
{
  "ErrorCode": "ORDER_NOT_FOUND",
  "DetailedErrorMessage": "Order not found",
  "ErrorReference": "d7da92f4-1ad9-48c3-9cd3-26559c98e64c"
}
```

## Example request

```bash
curl -X POST "https://payments.qliro.com/checkout/merchantapi/CreateMerchantSavedCreditCard" \
  -H "Content-Type: application/json" \
  -d '{
  "MerchantApiKey": "MerchantApiKey",
  "MerchantReference": "MerchantUniqueReference",
  "Currency": "SEK",
  "Country": "SE",
  "Language": "sv-se",
  "MerchantSavedCreditCardPushUrl": "https://merchant.com/MerchantSavedCreditCardPushUrl/",
  "Customer": {
    "Email": "email@domain.com",
    "JuridicalType": "Physical",
    "MobileNumber": "+46101010101"
  }
}'
```
