> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# View a PayIn (Klarna)

<Note>
  **Note – Pay-in data retained for 13 months**

  An API call to retrieve a pay-in whose `CreationDate` is older than 13 months may return 404 Not Found.

  For more information, see the <a href="/api-reference/overview/data-availability-periods">Data availability periods</a> article.
</Note>

### Path parameters

<ParamField path="PayInId" type="string" required>
  The unique identifier of the pay-in.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200 - Succeeded">
    <ResponseField name="Id" type="string">
      Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

      The unique identifier of the object.
    </ResponseField>

    <ResponseField name="Tag" type="string">
      Max. length: 255 characters

      Custom data that you can add to this object.\
      For transactions (pay-in, transfer, payout), you can use this parameter to identify corresponding information regarding the user, transaction, or payment methods on your platform.
    </ResponseField>

    <ResponseField name="CreationDate" type="Unix timestamp">
      The date and time at which the object was created.
    </ResponseField>

    <ResponseField name="AuthorId" type="string">
      The unique identifier of the user at the source of the transaction.
    </ResponseField>

    <ResponseField name="DebitedFunds" type="object">
      Information about the debited funds. The amount must be equal to the total of all `UnitAmount` and `TaxAmount` of all `LineItems`.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="CreditedFunds" type="object">
      Information about the credited funds (`CreditedFunds` = `DebitedFunds` - `Fees`).

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the funds.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Fees" type="object">
      Information about the fees.

      <Expandable title="properties">
        <ResponseField name="Currency" type="string">
          **Returned values:** The three-letter <a href="/api-reference/overview/data-formats" target="_blank">ISO 4217 code</a> (EUR, GBP, etc.) of a <a href="/guides/currencies" target="_blank">supported currency</a> (depends on feature, contract, and activation settings).

          The currency of the fees.
        </ResponseField>

        <ResponseField name="Amount" type="integer">
          An amount of money in the smallest sub-division of the currency (e.g., EUR 12.60 would be represented as `1260` whereas JPY 12 would be represented as just `12`).
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Status" type="string">
      **Returned values:** `CREATED`, `SUCCEEDED`, `FAILED`

      The status of the transaction.
    </ResponseField>

    <ResponseField name="ResultCode" type="string">
      The code indicating the result of the operation. This information is mostly used to <a href="/errors/codes">handle errors</a> or for filtering purposes.
    </ResponseField>

    <ResponseField name="ResultMessage" type="string">
      The explanation of the result code.
    </ResponseField>

    <ResponseField name="ExecutionDate" type="Unix timestamp">
      The date and time at which the status changed to `SUCCEEDED`, indicating that the transaction occurred. The statuses `CREATED` and `FAILED` return an `ExecutionDate` of `null`.
    </ResponseField>

    <ResponseField name="Type" type="string">
      **Returned values:** `PAYIN`, `TRANSFER`, `CONVERSION`, `PAYOUT`

      The type of the transaction.
    </ResponseField>

    <ResponseField name="Nature" type="string">
      **Returned values:** `REGULAR`, `REPUDIATION`, `REFUND`, `SETTLEMENT`

      The nature of the transaction, providing more information about the context in which the transaction occurred:

      * `REGULAR` – Relative to most of the transactions (pay-ins, payouts, and transfers) in a usual workflow.
      * `REPUDIATION` – Automatic withdrawal of funds from the platform’s repudiation wallet as part of the dispute process (when the user has requested a chargeback).
      * `REFUND` – Reimbursement of a transaction to the user (pay-in refund), to a wallet (transfer refund), or of a payout (payout refund, only initiated by Mangopay).
      * `SETTLEMENT` – Transfer made to the repudiation wallet by the platform to settle a lost dispute.
    </ResponseField>

    <ResponseField name="CreditedWalletId" type="string">
      The unique identifier of the credited wallet.
    </ResponseField>

    <ResponseField name="CreditedUserId" type="string">
      **Default value:** The unique identifier of the owner of the credited wallet.

      The unique identifier of the user whose wallet is credited.
    </ResponseField>

    <ResponseField name="PaymentType" type="string">
      **Returned values:** `KLARNA`

      The type of pay-in.
    </ResponseField>

    <ResponseField name="ExecutionType" type="string">
      **Returned values:** `WEB`, `DIRECT`, `EXTERNAL_INSTRUCTION`

      The type of execution for the pay-in.
    </ResponseField>

    <ResponseField name="ReturnURL" type="string">
      Max. length: 255 characters

      The URL to which the user is returned after the payment, whether the transaction is successful or not.
    </ResponseField>

    <ResponseField name="RedirectURL" type="string">
      The URL to which to redirect the user to complete the payment.

      **Caution:** This variable URL is specific to each payment. You must rely on the returned URL in full (host, path, and queries) and not hardcode any part of it.
    </ResponseField>

    <ResponseField name="StatementDescriptor" type="string">
      Max. length: 10 characters; only alphanumeric and spaces

      Custom description to appear on the user’s bank statement along with the platform name. Different banks may show more or less information. See the <a href="/bank-statements">Customizing bank statement references</a> article for details.
    </ResponseField>

    <ResponseField name="Billing" type="object">
      Information about the end user billing address.

      <Expandable title="properties">
        <ResponseField name="FirstName" type="string">
          The first name of the user.
        </ResponseField>

        <ResponseField name="LastName" type="string">
          Max. length: 100 characters

          The last name of the user.
        </ResponseField>

        <ResponseField name="Address" type="object">
          Information about the billing address.

          <Expandable title="properties">
            <ResponseField name="AddressLine1" type="string">
              Max. length: 255 characters

              The first line of the address.
            </ResponseField>

            <ResponseField name="AddressLine2" type="string">
              Max. length: 255 characters

              The second line of the address.
            </ResponseField>

            <ResponseField name="City" type="string">
              Max. length: 255 characters

              The city of the address.
            </ResponseField>

            <ResponseField name="Region" type="string">
              Max. length: 255 characters

              The region of the address. This field is optional except if the `Country` is US, CA, or MX.
            </ResponseField>

            <ResponseField name="PostalCode" type="string">
              Max. length: 255 characters

              The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
            </ResponseField>

            <ResponseField name="Country" type="string">
              Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

              The country of the address.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Shipping" type="object">
      Information about the end user’s shipping address.

      The shipping address `AddressLine1` must be formatted:

      * FR, UK, US: \[Number]\[StreetName], for example: 33 Cavendish Square
      * Rest of EU: \[StreetName]\[Number], for example: De Ruijterkade 7

      **Caution:** Failure to follow this formatting may result in an error.

      If no shipping address is sent, Klarna considers it to be the same as the billing address.

      <Expandable title="properties">
        <ResponseField name="FirstName" type="string">
          The first name of the user.
        </ResponseField>

        <ResponseField name="LastName" type="string">
          Max. length: 100 characters

          The last name of the user.
        </ResponseField>

        <ResponseField name="Address" type="object">
          Information about the shipping address.

          <Expandable title="properties">
            <ResponseField name="AddressLine1" type="string">
              Max. length: 255 characters

              The first line of the address.
            </ResponseField>

            <ResponseField name="AddressLine2" type="string">
              Max. length: 255 characters

              The second line of the address.
            </ResponseField>

            <ResponseField name="City" type="string">
              Max. length: 255 characters

              The city of the address.
            </ResponseField>

            <ResponseField name="Region" type="string">
              Max. length: 255 characters

              The region of the address. This field is optional except if the `Country` is US, CA, or MX.
            </ResponseField>

            <ResponseField name="PostalCode" type="string">
              Max. length: 255 characters

              The postal code of the address. The postal code can contain the following characters: alphanumeric, dashes, and spaces.
            </ResponseField>

            <ResponseField name="Country" type="string">
              Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

              The country of the address.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="LineItems" type="array (object)">
      Information about the items purchased in the transaction. The pay-in `DebitedFunds.Amount` must equal all `LineItems` objects' ((`UnitAmount` + `TaxAmount`) - `Discount`).

      <Expandable title="properties">
        <ResponseField name="Name" type="string">
          The name of the item.
        </ResponseField>

        <ResponseField name="Quantity" type="integer">
          The quantity of the item.
        </ResponseField>

        <ResponseField name="UnitAmount" type="integer">
          The cost of the item, excluding tax.
        </ResponseField>

        <ResponseField name="TaxAmount" type="integer">
          The tax amount applied to the item.
        </ResponseField>

        <ResponseField name="Sku" type="string">
          The unique identifier of the line item.
        </ResponseField>

        <ResponseField name="Category" type="string">
          Possible values: `DIGITAL_GOODS`, `PHYSICAL_GOODS`, `DISCOUNT`, `SHIPPING_FEE`, `SALES_TAX`, `GIFT_CARD`, `STORE_CREDIT`, `SURCHARGE`

          The category of the item, allowing line items of different types to be distinguished (for example, buyer protection as `DIGITAL_GOODS`).
        </ResponseField>

        <ResponseField name="Discount" type="integer">
          The discount applied to the item.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="Country" type="string">
      Format: Two-letter country code ([ISO 3166-1 alpha-2 format](/api-reference/overview/data-formats))

      The country of residence of the user.
    </ResponseField>

    <ResponseField name="Culture" type="string">
      Format: Two-letter language code ([ISO 639-1 alpha-2](/api-reference/overview/data-formats))

      The language in which the Klarna payment page is to be displayed.\
      The `Culture` must match the `Country` to show the checkout page in the desired language. If not, or if `Culture` is not sent, EN is the language by default.
    </ResponseField>

    <ResponseField name="Email" type="string">
      Format: A valid email address

      The user’s email address.
    </ResponseField>

    <ResponseField name="Phone" type="string">
      Format: International E.164 standard (preceded by plus sign and country code)

      The user's mobile phone number. If the phone matches the user’s Klarna account, their checkout experience involves one less step.
    </ResponseField>

    <ResponseField name="PaymentMethod" type="string">
      The payment option chosen by the user:

      * Pay Now (Card) – Pay now by card.
      * Pay Now (Direct Bank Transfer) – Pay now by bank wire.
      * Pay Now (Direct Debit) – Pay now by direct debit.
      * Pay Now (Klarna Bank Account) – Pay now from Klarna Bank Account (select regions only, e.g. Germany).
      * Pay in 30 days (by card) – Pay within 30 days by card.
      * Pay in 30 days – Pay within 30 days against an invoice (select regions only, e.g. Germany).
      * Slice it (3 installments) – Pay in 3 installments.
      * Slice it (Financing - X installments) – Pay via financing plan, where X is the number of monthly installments (6, 12, 24, or 36).

      The options available to users depend on their region. 

      **Note:** This parameter is not returned unless the `Status` is `SUCCEEDED`.
    </ResponseField>

    <ResponseField name="AdditionalData" type="string">
      Format: Serialized JSON object

      The extra merchant data required by Klarna for the transaction, as described in the <a href="https://mangopay.com/docs/concepts/payments/payment-methods/klarna" target="_blank">Klarna</a> guide.
    </ResponseField>

    <ResponseField name="Reference" type="string">
      The platform’s order reference for the transaction.
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 - Succeeded   theme={null}

  {
      "Id": "wt_5a175522-04c3-4115-88ef-3b1b3446c4c6",
      "Tag": "Created using the Mangopay API Postman collection",
      "CreationDate": 1706797249,
      "AuthorId": "213407540",
      "DebitedFunds": {
          "Currency": "EUR",
          "Amount": 1300
      },
      "CreditedFunds": {
          "Currency": "EUR",
          "Amount": 1000
      },
      "Fees": {
          "Currency": "EUR",
          "Amount": 300
      },
      "Status": "SUCCEEDED",
      "ResultCode": "000000",
      "ResultMessage": "Success",
      "ExecutionDate": 1706797396,
      "Type": "PAYIN",
      "Nature": "REGULAR",
      "CreditedWalletId": "213407543",
      "CreditedUserId": "213407540",
      "PaymentType": "KLARNA",
      "ExecutionType": "WEB",
      "ReturnURL": "http://www.mangopay.com/docs/please-ignore?transactionId=wt_5a175522-04c3-4115-88ef-3b1b3446c4c6",
      "RedirectURL": "https://pay.playground.klarna.com/eu/hpp/payments/2fuacUE",
      "StatementDescriptor": "Mangopay",
      "Billing": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "6 rue de la Cité",
              "AddressLine2": "Appartement 3",
              "City": "Paris",
              "Region": "île-de-france",
              "PostalCode": "75003",
              "Country": "FR"
          }
      },
      "Shipping": {
          "FirstName": "Alex",
          "LastName": "Smith",
          "Address": {
              "AddressLine1": "Rue de la Fourche 26",
              "AddressLine2": "Appartement 3",
              "City": "Bruxelles",
              "Region": "Bruxelles-Capitale",
              "PostalCode": "75003",
              "Country": "BE"
          }
      },
      "LineItems": [
          {
              "Name": "Running shoes",
              "Quantity": 2,
              "UnitAmount": 400,
              "TaxAmount": 100,
              "Description": "ID of Seller 1",
              "Category": "PHYSICAL_GOODS",
              "Sku": "example-item-123",
              "Discount": 100
          },
          {
              "Name": "Walking shoes",
              "Quantity": 1,
              "UnitAmount": 400,
              "TaxAmount": 100,
              "Description": "ID of Seller 2",
              "Category": "PHYSICAL_GOODS",
              "Sku": "example-item-456",
              "Discount": 100
          }
      ],
      "Country": "FR",
      "Culture": "FR",
      "Email": "alex.smith@example.com",
      "Phone": "[+33][689854321]",
      "PaymentMethod": "Pay in 30 days",
      "AdditionalData": "{\"customer_account_info\": [{\"unique_account_identifier\": \"382f5a69-c51c-45af-9707-6991eb08f7bf\",\"app_id\": \"81363501-3540-494a-8627-33bc6112035d\",\"loyalty_level\": \"high\",\"customer_email\": \"customer@email.com\",\"customer_phone\": \"0611223344\",\"customer_ranking\": 2,\"customer_reviews\": 5,\"last_login_time\": \"2023-10-21T19:11:34Z\",\"account_security\": {\"last_verification_method\": \"2FA TOTP\",\"last_verification_time\": \"2023-10-21T19:11:34Z\",\"device_id\": \"772af5a5-2d55-4a5e-bb79-85969f683810\",\"fraud_behavior\": false,\"devices_linked\": 2,\"phone_verified\": true,\"email_verified\": true,\"failed_transactions_attempts\": 0},\"account_registration_date\": \"2020-06-10T12:02:21Z\",\"account_last_modified\": \"2022-12-22T18:45:44Z\"}],\"marketplace_seller_info\": [{\"sub_merchant_id\": \"615a0e87-4941-45dc-978d-e6efcbd90ba0\",\"sub_merchant_name\": \"Marketbrick Ltd.\",\"sub_merchant_postal_code\": \"75010\",\"product_category\": \"Computers\",\"product_name\": \"Asus Zenbook 14\",\"account_registration_date\": \"2020-06-10T12:02:21Z\",\"account_last_modified\": {\"password\": \"2020-06-10T12:02:21Z\",\"email\": \"2020-06-10T12:02:21Z\",\"listing\": \"2020-06-10T12:02:21Z\",\"login\": \"2020-06-10T12:02:21Z\",\"address\": \"2020-06-10T12:02:21Z\"},\"digital_download\": false,\"seller_rating\": 4.5,\"number_of_trades\": 34,\"volume_of_trades\": 4500}],\"payment_history_full\": [{\"unique_account_identifier\": \"382f5a69-c51c-45af-9707-6991eb08f7bf\",\"number_paid_purchases\": 10,\"payment_option\": \"card\",\"total_amount_paid_purchases\": 1000.10,\"date_of_first_paid_purchase\": \"2020-06-10T12:12:34Z\",\"date_of_last_paid_purchase\": \"2023-10-26T18:52:38Z\"},{\"unique_account_identifier\": \"382f5a69-c51c-45af-9707-6991eb08f7bf\",\"number_paid_purchases\": 14,\"payment_option\": \"non klarna credit\",\"total_amount_paid_purchases\": 2322.10,\"date_of_first_paid_purchase\": \"2021-10-11T20:31:15Z\",\"date_of_last_paid_purchase\": \"2023-09-22T14:59:22Z\"}],\"marketplace_winner_info\": [{\"account_registration_date\": \"2020-06-10T12:02:21Z\",\"account_last_modified\": {\"password\": \"2022-12-22T18:45:44Z\",\"email\": \"2020-06-10T12:02:21Z\",\"listing\": \"2023-08-14T08:23:34Z\",\"login\": \"2020-06-10T12:02:21Z\",\"address\": \"2020-06-10T12:02:21Z\"},\"number_of_trades\": 24,\"volume_of_trades\": 3322}],\"other_delivery_address\": [{\"shipping_method\": \"pick-up point\",\"shipping_type\": \"express\",\"first_name\": \"Test\",\"last_name\": \"Person\",\"street_address\": \"Rue La Fayette\",\"street_number\": \"33\",\"postal_code\": \"75009\",\"city\": \"Paris\",\"country\": \"FR\"}]}",
      "Reference": "1234"
  }  
  ```
</ResponseExample>

<RequestExample>
  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'your-client-id';
  $api->Config->ClientPassword = 'your-api-key';
  $api->Config->TemporaryFolder = 'tmp/';

  try {
      $payinId = 'payin_m_01HYG8DRT5FHT1FV44MV9KR1BS';

      $response = $api->PayIns->Get($payinId);

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }  
  ```

  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk');
  const mangopay = new mangopayInstance({
      clientId: "your-client-id",
      clientApiKey: "your-api-key",
  })

  let myPayIn = {
      Id: 'wt_3bc9f70c-cc3e-481a-adf0-aff0a8941696',
    }
    
    const viewPayIn = async (payinId) => {
      return await mangopay.PayIns.get(payinId)
        .then((response) => {
          console.info(response)
          return response
        })
        .catch((err) => {
          console.log(err)
          return false
        })
    }
    
  viewPayIn(myPayIn.Id)  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  require 'PP'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def viewPayIn(payinId)
    begin
        response = MangoPay::PayIn.fetch(payinId)
        puts response
        return response
    rescue MangoPay::ResponseError => error
        puts "Failed to fetch PayIn: #{error.message}"
        puts "Error details: #{error.details}"
        return false
    end
  end

  myPayIn = {
    Id: 'wt_4502fd11-1aca-44ed-9fc5-fec8f41b6b05'
  }

  pp(viewPayIn(myPayIn[:Id]))  
  ```

  ```java Java theme={null}
  import com.google.gson.Gson;
  import com.google.gson.GsonBuilder;
  import com.mangopay.MangoPayApi;
  import com.mangopay.entities.PayIn;

  public class ViewPayIn {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");

          PayIn payin = mangopay.getPayInApi().get("your-payin-id");

          Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
          String prettyJson = prettyPrint.toJson(payin);

          System.out.println(prettyJson);
      }
  }
  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id='your-client-id'
  mangopay.apikey='your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import PayIn

  payin_id = 'wt_4fdf7754-6213-4016-be88-84587f093623'

  try:
      view_payin = PayIn.get(payin_id)
      pprint(view_payin._data)
  except PayIn.DoesNotExist:
      print('PayIn {} does not exist.'.format(payin_id))  
  ```

  <ViewPayinKlarnaNet />
</RequestExample>
