Download OpenAPI specification:Download
The Merchant Card Service (MCS) API is used to settle orders with virtual credit cards.
Read more on Merchant card service.
To create promise provide a purchase currency and the cards to be created. The old promise is automatically invalidated if a new promise is created for an order
successful operation
Bad Request
Service unavailable
{- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "cards": [
- {
- "amount": 10000,
- "currency": "USD",
- "fund_amount": 10000,
- "reference": "yPGw6i4lR0GTcyxGpS3Q6Q=="
}
]
}
{- "expires_at": "2019-08-24T14:15:22Z",
- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c"
}
To get the promise resource simply provide a promise identifier.
successful operation
Forbidden
Not found
curl -i -X GET \ 'https://api.klarna.com/merchantcard/v3/promises/{promise_id}'
{- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c",
- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "cards": [
- {
- "amount": 10000,
- "currency": "USD",
- "fund_amount": 10000,
- "reference": "yPGw6i4lR0GTcyxGpS3Q6Q=="
}
], - "created_at": "2018-12-03T10:26:06.000Z",
- "expire_at": "2018-12-04T10:26:06.000Z"
}
To create a settlement resource provide a completed order identifier and (optionally) a promise identifier.
successful operation
Bad Request
Forbidden
Service unavailable
{- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c",
- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "key_id": "16e4b85e-899b-4427-a39f-07a496e9515b"
}
{- "settlement_id": "b0ec0bbd-534c-4b1c-b28a-628bf33c3324",
- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c",
- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "cards": [
- {
- "reference": "yPGw6i4lR0GTcyxGpS3Q6Q==",
- "card_id": "b846430c-3656-43a1-812e-2ccff4531b7d",
- "amount": 10000,
- "currency": "USD",
- "pci_data": "string",
- "iv": "string",
- "aes_key": "string",
- "brand": "VISA",
- "holder": "Jane Doe"
}
], - "created_at": "2018-12-03T10:26:06.000Z",
- "expires_at": "2018-12-04T10:26:06.000Z"
}
To get the settlement resource provide the settlement identifier.
successful operation
Forbidden
Not Found
curl -i -X GET \ 'https://api.klarna.com/merchantcard/v3/settlements/{settlement_id}' \ -H 'KeyId: string'
{- "settlement_id": "b0ec0bbd-534c-4b1c-b28a-628bf33c3324",
- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c",
- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "cards": [
- {
- "reference": "yPGw6i4lR0GTcyxGpS3Q6Q==",
- "card_id": "b846430c-3656-43a1-812e-2ccff4531b7d",
- "amount": 10000,
- "currency": "USD",
- "pci_data": "string",
- "iv": "string",
- "aes_key": "string",
- "brand": "VISA",
- "holder": "Jane Doe"
}
], - "created_at": "2018-12-03T10:26:06.000Z",
- "expires_at": "2018-12-04T10:26:06.000Z"
}
To get the order's settlement resource provide the order identifier.
successful operation
Forbidden
Not Found
curl -i -X GET \ 'https://api.klarna.com/merchantcard/v3/settlements/order/{order_id}' \ -H 'KeyId: string'
{- "settlement_id": "b0ec0bbd-534c-4b1c-b28a-628bf33c3324",
- "promise_id": "ee4a8e3a-9dfd-49e0-9ac8-ea2b6c76408c",
- "order_id": "f3392f8b-6116-4073-ab96-e330819e2c07",
- "cards": [
- {
- "reference": "yPGw6i4lR0GTcyxGpS3Q6Q==",
- "card_id": "b846430c-3656-43a1-812e-2ccff4531b7d",
- "amount": 10000,
- "currency": "USD",
- "pci_data": "string",
- "iv": "string",
- "aes_key": "string",
- "brand": "VISA",
- "holder": "Jane Doe"
}
], - "created_at": "2018-12-03T10:26:06.000Z",
- "expires_at": "2018-12-04T10:26:06.000Z"
}
Request cancellation for an order. If the order is already cancelled, a 200
status is returned.
Otherwise, the order will be queued for cancellation with a 202
status. Actual order cancellation will happen asynchronously at a later time. You can call the corresponding GET endpoint to view the status of the request.
This cancellation endpoint is limited to the scope of the Virtual Credit Cards product. Therefore the order provided must have an associated Virtual Card Settlement, otherwise the call will fail.
Order is already cancelled.
Order was successfully queued for cancellation.
The check_after
field indicates when you should expect a decision to be made regarding cancellation. You can call the corresponding GET endpoint after this timestamp to see the resulting status.
Bad Request
You do not have permission to execute this operation.
Order does not exist or does not have an associated Virtual Credit Card Settlement.
Service unavailable
curl -i -X POST \ 'https://api.klarna.com/merchantcard/v3/orders/{order_id}/cancel-request'
{- "status": "CANCELLED"
}
Get the status of an order cancellation request. The order must have an associated Virtual Credit Card Settlement.
Successfully retrieved the status of the cancellation request for this order.
Bad Request, or the order was not previously requested for cancellation by calling the POST endpoint.
You do not have permission to execute this operation.
Order does not exist or does not have an associated Virtual Credit Card Settlement.
Service unavailable
curl -i -X GET \ 'https://api.klarna.com/merchantcard/v3/orders/{order_id}/cancel-request'
{- "status": "PENDING",
- "check_after": "2018-12-04T10:26:06.000Z",
- "reason_code": "CARD_IN_USE",
- "reason_message": "Cancellation request was rejected because the virtual credit card linked to this order is in use."
}