---
title: "Walley for API-only"
description: "Add Walley to an existing API-only integration."
url: "https://docs.adyen.com/payment-methods/walley/api-only"
source_url: "https://docs.adyen.com/payment-methods/walley/api-only.md"
canonical: "https://docs.adyen.com/payment-methods/walley/api-only"
last_modified: "2023-03-03T15:50:00+01:00"
language: "en"
---

# Walley for API-only

Add Walley to an existing API-only integration.

[View source](/payment-methods/walley/api-only.md)

Accept Walley payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

## Requirements

| Requirement          | Description                                                                                                                                                                                                                   |
| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Integration type** | Make sure that you have built your [API-only integration](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20Only%2F%3Ftarget%3D_blank). Walley for Web requires at least v66 of API-only. |
| **Setup steps**      | Before you begin, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to add Walley in your test Customer Area.                                                                    |

## Build your payment form for Walley

Include Walley in the list of available payment methods.

To make a Walley payment, collect the following shopper details:

* [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-telephoneNumber)
* [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail)
* [company.name](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-company-name) - in the case of a business-to-business payment (required)
* [company.registrationNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-company-registrationNumber) - in the case of a business-to-business payment (optional)

If you are using the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) endpoint to show available payment methods to the shopper, specify in your request one of the following combinations of [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) and [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount):

| Country/region | `countryCode` | `amount.currency` |
| -------------- | ------------- | ----------------- |
| Denmark        | **DK**        | **DKK**           |
| Finland        | **FI**        | **EUR**           |
| Norway         | **NO**        | **NOK**           |
| Sweden         | **SE**        | **SEK**           |

Payments in Denmark (**DK**) or with the **DKK** currency are available only for *B2C* payments.

The API response contains `paymentMethod.type`: **walley** for business-to-consumer and `paymentMethod.type`: **walley\_b2b** for business-to-business.

Adyen provides a logo for Walley that you can use on your payment form. For more information, refer to [Downloading logos](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only\&version=71#downloading-logos).

## Make a payment

You must include the following fields when making a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request:

| Parameter name                                                                                                                         | Required                                                                                    | Description                                                                                                                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [telephoneNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-telephoneNumber)                           | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's telephone number. You must collect a working mobile phone number (including country code) from the customer. Incorrect or missing numbers will fail Walley's validation. |
| [shopperEmail](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperEmail)                                 | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The shopper's email address.                                                                                                                                                           |
| [company.name](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-company-name)                                 | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The name of the company making the payment. This will be prefilled and presented to the shopper on Walley's payment form. Only required for **walley\_b2b** payments.                  |
| [company.registrationNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-company-registrationNumber)     |                                                                                             | Only relevant to business-to-business payments. The registration number of the company making the payment.                                                                             |
| [lineItems.id](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-id)                                 | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The ID of the line item.                                                                                                                                                               |
| [lineItems.description](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-description)               | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | A description of the line item. Maximum length: 50 characters.                                                                                                                         |
| [lineItems.amountExcludingTax](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-amountExcludingTax) | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The item amount excluding the tax, in minor units.                                                                                                                                     |
| [lineItems.taxAmount](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-taxAmount)                   | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The tax amount, in minor units.                                                                                                                                                        |
| [lineItems.taxPercentage](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-taxPercentage)           | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The tax percentage, in minor units.                                                                                                                                                    |
| [lineItems.quantity](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-lineItems-quantity)                     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The number of items.                                                                                                                                                                   |

#### curl

```bash
curl https://checkout-test.adyen.com/v72/payments \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
  "merchantAccount":"ADYEN_MERCHANT_ACCOUNT",
  "reference":"YOUR_ORDER_NUMBER",
  "amount":{
    "currency":"EUR",
    "value":1000
  },
  "paymentMethod":{
    "type":"walley"
  },
  "countryCode": "NO",
  "shopperLocale": "no_NO",
  "telephoneNumber": "+46 840 839 298",
  "shopperEmail":"youremail@email.com",
  "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy..",
  "lineItems":[
      {
         "quantity":"1",
         "amountExcludingTax":"331",
         "taxPercentage":"2100",
         "description":"Shoes",
         "id":"Item #1",
         "taxAmount":"69"
      },
      {
         "quantity":"1",
         "amountExcludingTax":"400",
         "taxPercentage":"2100",
         "description":"Shirt",
         "id":"Item #2",
         "taxAmount":"72"
      }
  ]
}'
```

#### Java

```java
// Set YOUR_X-API-KEY with the API key from the Customer Area.
// Change to Environment.LIVE and add the Live URL prefix when you are ready to accept live payments.
    Client client = new Client("ADYEN_API_KEY", Environment.TEST);
    Checkout checkout = new Checkout(client);

    PaymentsRequest paymentsRequest = new PaymentsRequest();

    String merchantAccount = "ADYEN_MERCHANT_ACCOUNT";
    paymentsRequest.setMerchantAccount(merchantAccount);

    Amount amount = new Amount();
    amount.setCurrency("EUR");
    amount.setValue(1000L);
    paymentsRequest.setAmount(amount);

    DefaultPaymentMethodDetails paymentMethodDetails = new DefaultPaymentMethodDetails();
    paymentMethodDetails.setType("walley");
    paymentsRequest.setPaymentMethod(paymentMethodDetails);

    paymentsRequest.setReference("YOUR_ORDER_NUMBER");
    paymentsRequest.setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");
    paymentsRequest.setCountryCode("NO");
    paymentsRequest.setShopperLocale("no_NO");
    paymentsRequest.setTelephoneNumber("+46 840 839 298");
    paymentsRequest.setShopperEmail("youremail@email.com");

    List<LineItem> lineItems = new ArrayList<>();
    lineItems.add(
        new LineItem()
        .quantity(1L)
        .taxPercentage(2100L)
        .description("Shoes")
        .id("Item #1")
        .amountExcludingTax(331L)
        .taxAmount(69L)
    );

    paymentsRequest.setLineItems(lineItems);

    PaymentsResponse paymentsResponse = checkout.payments(paymentsRequest);
```

#### PHP

```php
// SET YOUR ADYEN_API_KEY with the API key from the Customer Area.
$client = new \Adyen\Client();
$client->setXApiKey("ADYEN_API_KEY");
$service = new \Adyen\Service\Checkout($client);

$params = array(
  "amount" => array(
    "currency" => "EUR",
    "value" => 1000
  ),
  "reference" => "YOUR_ORDER_NUMBER",
  "paymentMethod" => array(
    "type" => "walley"
  ),
  "countryCode" => "NO",
  "shopperLocale" => "no_NO",
  "telephoneNumber" => "+46 840 839 298",
  "shopperEmail" => "youremail@email.com",
  "returnUrl" => "https://your-company.example.com/checkout?shopperOrder=12xy..",
  "merchantAccount" => "ADYEN_MERCHANT_ACCOUNT",
  "lineItems" => [
       [
          "quantity" => "1",
          "taxPercentage" => "2100",
          "description" => "Shoes",
          "id" => "Item #1",
          "amountExcludingTax" => "400",
          "taxAmount" => "69"
       ]
   ]
);
$result = $service->payments($params);
```

#### C\#

```cs
// SET YOUR ADYEN_API_KEY with the API key from the Customer Area.
var client = new Client ("ADYEN_API_KEY", Environment.Test);
var checkout = new Checkout(client);

var amount = new Model.Checkout.Amount("EUR", 1000);
var details = new Model.Checkout.DefaultPaymentMethodDetails{
  Type = "walley"
};
var paymentRequest = new Adyen.Model.Checkout.PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  ReturnUrl = @"https://your-company.example.com/checkout?shopperOrder=12xy..",
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  PaymentMethod = details,
  CountryCode = "NO",
  ShopperLocale = "no_NO",
  TelephoneNumber = "+46 840 839 298",
  ShopperEmail = "youremail@email.com",
  LineItems = new List<LineItem>
   {
       new LineItem(quantity:1, taxPercentage:2100,
       description:"Shoes", id:"Item #1", amountExcludingTax:331, taxAmount:69)
   };
var paymentResponse = checkout.Payments(paymentsRequest);
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v16.1.0
// Require the parts of the module you want to use
const { Client, CheckoutAPI } = require('@adyen/api-library');

// Initialize the client object
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object
const paymentRequest = {
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  reference: "YOUR_ORDER_NUMBER",
  amount: {
    currency: "EUR",
    value: 1000
  },
  paymentMethod: {
    type: "walley"
  },
  lineItems: [ {
       quantity: "1",
       taxPercentage: "2100",
       description: "Shoes",
       id: "Item #1",
       amountExcludingTax: "331",
       taxAmount: "69"
  }, {
       quantity: "1",
       taxPercentage: "2100",
       description: "Shirt",
       id: "Item #2",
       amountExcludingTax: "400",
       taxAmount: "72"
       } ],
  countryCode: "NO",
  shopperLocale: "no_NO",
  telephoneNumber: "+46 840 839 298",
  shopperEmail: "youremail@email.com",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

// Make the request
const checkoutAPI = new CheckoutAPI(client);
const response = checkoutAPI.PaymentsApi.payments(paymentRequest, { idempotencyKey: "UUID" });
```

#### Python

```py
# Adyen Python API Library v12.0.0
import Adyen

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
adyen.client.platform = "test" # The environment to use library in.

json_request = {
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "reference": "YOUR_ORDER_NUMBER",
  "amount": {
    "currency": "EUR",
    "value": 1000
  },
  "paymentMethod": {
    "type": "walley"
  },
  "countryCode": "NO",
  "shopperLocale": "no_NO",
  "telephoneNumber": "+46 840 839 298",
  "shopperEmail": "youremail@email.com",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy..",
  "lineItems": [ {
    "quantity": "1",
    "amountExcludingTax": "331",
    "taxPercentage": "2100",
    "description": "Shoes",
    "id": "Item #1",
    "taxAmount": "69"
  }
 ]
}

result = adyen.checkout.payments_api.payments(request=json_request, idempotency_key="UUID")
```

#### Ruby

```rb
# Adyen Ruby API Library v9.1.0
require "adyen-ruby-api-library"

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
adyen.env = :test # Set to "live" for live environment

request_body = {
  :merchantAccount => 'YOUR_MERCHANT_ACCOUNT',
  :reference => 'YOUR_ORDER_NUMBER',
  :amount => {
    :currency => 'EUR',
    :value => 1000
  },
  :paymentMethod => {
    :type => 'walley'
  },
  :countryCode => 'NO',
  :shopperLocale => 'no_NO',
  :telephoneNumber => '+46 840 839 298',
  :shopperEmail => 'youremail@email.com',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..',
  :lineItems => [ {
    :quantity => '1',
    :amountExcludingTax => '331',
    :taxPercentage => '2100',
    :description => 'Shoes',
    :id => 'Item #1',
    :taxAmount => '69'
  }
 ]
}

result = adyen.checkout.payments_api.payments(request_body, headers: { 'Idempotency-Key' => 'UUID' })
```

In the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, check the `action` object for the information that you must use to redirect the shopper.

**/payments response**

```json
{
  "resultCode":"RedirectShopper",
  "action":{
    "paymentMethodType":"walley",
    "method":"GET",
    "url":"https://checkoutshopper-test.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=...",
    "type":"redirect"
  }
}
```

## Handle the redirect

1. To complete the payment, redirect the shopper to the `action.url` returned in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response, taking into account the following recommendations:

   * **When using the HTTP GET method:**\
     For security reasons, when showing the redirect in the app, we recommend that you use [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) for iOS or [Chrome Custom Tabs](https://developer.chrome.com/multidevice/android/customtabs) for Android, instead of WebView objects. Also refer to the [security best practices](https://developer.android.com/topic/security/best-practices#webview) for WebView.

   * **Redirection for mobile integrations:**\
     For mobile integrations, we strongly recommended that you redirect the shopper to the default browser of their device. Redirecting to the default browser ensures the best compatibility, handling of multi-factor authentication, app-to-app redirection, and error handling.

2. After the shopper is redirected back to your website, check the payment result by making a POST [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) request, specifying:

   * `details`: object that contains the URL-decoded `redirectResult` returned when the shopper was redirected back to your site.

   **/payments/details request**

   ```bash
   curl https://checkout-test.adyen.com/v72/payments/details \
   -H 'x-api-key: ADYEN_API_KEY' \
   -H 'content-type: application/json' \
   -d '{
      "details": {
         "redirectResult": "eyJ0cmFuc1N0YXR1cyI6IlkifQ=="
      }
   }'
   ```

3. In the response note the following:

   * `resultCode`: use this to present the result to your shopper.
   * `pspReference`: our unique identifier for the transaction.

   **/payments/details response**

   ```json
   {
      "resultCode": "Authorised",
      "pspReference": "V4HZ4RBFJGXXGN82"
   }
   ```

## Show the payment result

1. Use the `resultCode` that you received in the [/payments/details](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/details) response to present the payment result to your shopper.

You can receive the following `resultCode` values for Walley:

| resultCode                  | Description                                                                                                                                                                                                                                         | Action to take                                                                                                                                                                                                                         |
| --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authorised**              | The shopper completed their payment, and it has been sent to the bank for processing. In most cases, this means that you will receive the funds. If you are using manual capture, you also need to [capture the payment](/online-payments/capture). | Inform the shopper that the payment has been successful.                                                                                                                                                                               |
| **Cancelled**               | The shopper cancelled the payment while on their bank's website.                                                                                                                                                                                    | Ask the shopper whether they want to continue with the order, or ask them to select a different payment method.                                                                                                                        |
| **Error**                   | There was an error when the payment was being processed.                                                                                                                                                                                            | Inform the shopper that there was an error processing their payment. The response contains a `refusalReason`, indicating the cause of the error.                                                                                       |
| **Pending** or **Received** | The shopper has completed the payment but the final result is not yet known.                                                                                                                                                                        | Inform the shopper that you have received their order, and are waiting for the payment to be completed. You will receive the final result of the payment in an [AUTHORISATION webhook](/development-resources/webhooks/webhook-types). |
| **Refused**                 | The payment was refused by the shopper's bank.                                                                                                                                                                                                      | Ask the shopper to try the payment again using a different payment method.                                                                                                                                                             |

You also receive the outcome of the payment asynchronously in a [webhook](/development-resources/webhooks). If the shopper failed to return to your website or app, wait for notification webhooks to know the outcome of the payment. You can receive the following notification webhooks for Walley:

| eventCode         | success field | Description                                     | Action to take                                                                      |
| ----------------- | ------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------- |
| **AUTHORISATION** | **false**     | The transaction failed.                         | Cancel the order and inform the shopper that the payment failed.                    |
| **AUTHORISATION** | **true**      | The shopper successfully completed the payment. | Inform the shopper that the payment has been successful and proceed with the order. |

## Capture the payment

After the goods have been sent, you also need to [capture the payment](/online-payments/capture/).\
If the capture is not performed within 90 days, the authorization will expire.

### Automatic captures

You can set up [automatic captures](/online-payments/capture). By default, this happens immediately after authorization.

However, due to the asynchronous nature of a `202 status` (success) response from Walley, it may take a few seconds before the update can be shown in all relevant systems and responses to API requests.

Therefore, an automatic capture may result in a `403 status` (forbidden) response.

Solutions:

* In the account settings, set an automatic capture delay of at least **1 day**, instead of **immediate**.

* Do a [manual capture](/online-payments/capture/#manual-capture):

  * For an account with the automatic capture turned on, include `captureDelayHours` in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request to override the automatic capture value.

  * For an account without automatic capture turned on, ensure your capture request is done at least 10s after the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request.

    | Parameter   | Description                                                                                                                                                                                                                                                                                                                                                                           |
    | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `amount`    | The amount that the shopper should pay.                                                                                                                                                                                                                                                                                                                                               |
    | `lineItems` | Price and product information for the items that the shopper should pay for. You only need to specify `lineItems` if you are sending a partial capture, not if you are sending a full capture, unless it is for B2B. The sum of the `lineItems` must match the amount declared in the capture call, otherwise Adyen will add a dummy `lineItems` entry to account for the difference. |

### Partial captures

To [partially capture](/online-payments/capture) a Walley payment, specify in your [/payments/{paymentPspReference}/captures](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/captures) request:

| Parameter   | Description                                                                                                                                                                                                                                                                                                                                                                           |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amount`    | The amount that the shopper should pay.                                                                                                                                                                                                                                                                                                                                               |
| `lineItems` | Price and product information for the items that the shopper should pay for. You only need to specify `lineItems` if you are sending a partial capture, not if you are sending a full capture, unless it is for B2B. The sum of the `lineItems` must match the amount declared in the capture call, otherwise Adyen will add a dummy `lineItems` entry to account for the difference. |

Only specify the items that you are capturing.

In the case of business-to-business payments:

* The `lineItems` values must match the values that were provided for authorization.
* Captures using only `amount` can be used with full captures, not with partial captures. When used, all authorized items will automatically be captured and included on the invoice.

The following example shows how to make a partial capture request if the shopper only kept item #1 of the order.

**Example /captures request**

```json
curl https: //checkout-test.adyen.com/checkout/v65/payments/TCG5XS42X8NKGK82/captures \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
    "reference": "YOUR_UNIQUE_REFERENCE",
    "amount": {
        "value": 1200,
        "currency": "EUR"
    },
    "paymentPspReference": "TCG5XS42X8NKGK82",
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "lineItems": [
        {
            "quantity": "1",
            "taxPercentage": "2000",
            "description": "Polo shirt",
            "id": "Item #1",
            "itemCategory": "Shirts",
            "amountIncludingTax": "1200",
            "taxAmount": "200",
            "amountExcludingTax": "1000",
            "productUrl": "https://www.mystoredemo.io/#/product/01",
            "imageUrl": "https://www.mystoredemo.io/1689f3f40b292d1de2c6.png"
        }
    ]
}
```

The following response is returned:

**Example /captures response**

```json
{
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "paymentPspReference": "R5WCJDJ890WZNN82",
    "pspReference": "TCG5XS42X8NKGK82",
    "reference": "YOUR_UNIQUE_REFERENCE",
    "status": "received",
    "amount": {
        "currency": "EUR",
        "value": 1200
    },
    "lineItems": [
        {
            "quantity": "1",
            "taxPercentage": "2000",
            "description": "Polo shirt",
            "id": "Item #1",
            "itemCategory": "Shirts",
            "amountIncludingTax": "1200",
            "taxAmount": "200",
            "amountExcludingTax": "1000",
            "productUrl": "https://www.mystoredemo.io/#/product/01",
            "imageUrl": "https://www.mystoredemo.io/1689f3f40b292d1de2c6.png"
        }
    ]
}
```

[Manually cancel](/online-payments/cancel) any amount that remains after partially capturing a payment.

## Refunds and cancellations

If you have not captured a Walley payment, you can [cancel](/online-payments/cancel) it. If you have captured the payment and you want to return the funds to the shopper, you need to [refund](/online-payments/refund/) it.

As with captures, you don’t need to specify `lineItems` in the refund request if you are doing a full refund. To partially refund a Walley payment, specify in your [/payments/{paymentPspReference}/refunds](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments/\(paymentPspReference\)/refunds) request:

| Parameter   | Description                                                                                                                                                                                                                                                 |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amount`    | The amount that is refunded to the shopper.                                                                                                                                                                                                                 |
| `lineItems` | Price and product information for the items that the shopper should pay for. The sum of the `lineItems` needs to match the amount declared in the refund call. If they do not match, Adyen will add a dummy `lineItem` entry to account for the difference. |

Only specify the items that you are refunding the money for.

The following example shows how to make a partial refund for item #1 of the above order.

**Example /refunds request**

```java
curl https://checkout-test.adyen.com/v65/payments/TCG5XS42X8NKGK82/refunds \
-H 'x-api-key: ADYEN_API_KEY' \
-H 'content-type: application/json' \
-d '{
    "reference": "YOUR_UNIQUE_REFERENCE",
    "amount": {
        "value": 1200,
        "currency": "EUR"
    },
    "paymentPspReference": "TCG5XS42X8NKGK82",
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "lineItems": [
        {
            "quantity": "1",
            "taxPercentage": "2000",
            "description": "Polo shirt",
            "id": "Item #1",
            "itemCategory": "Shirts",
            "amountIncludingTax": "1200",
            "taxAmount": "200",
            "amountExcludingTax": "1000",
            "productUrl": "https://www.mystoredemo.io/#/product/01",
            "imageUrl": "https://www.mystoredemo.io/1689f3f40b292d1de2c6.png"
        }
    ]
}
```

The following response is returned:

**Example /refunds response**

```java
{
    "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
    "paymentPspReference": "R5WCJDJ890WZNN82",
    "pspReference": "IHG5XS4FGKVLGK82",
    "reference": "YOUR_UNIQUE_REFERENCE",
    "status": "received",
    "amount": {
        "currency": "EUR",
        "value": 1200
    },
    "lineItems": [
        {
            "quantity": "1",
            "taxPercentage": "2000",
            "description": "Polo shirt",
            "id": "Item #1",
            "itemCategory": "Shirts",
            "amountIncludingTax": "1200",
            "taxAmount": "200",
            "amountExcludingTax": "1000",
            "productUrl": "https://www.mystoredemo.io/#/product/01",
            "imageUrl": "https://www.mystoredemo.io/1689f3f40b292d1de2c6.png"
        }
    ]
}
```

The `pspReference` is specifically for the refund transaction, not for the original payment.

## Test and go live

You can perform the test scenarios described on [Walley's technical documentation](https://dev.walleypay.com/docs/checkout/test-data) using Adyen's [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) endpoint. Consider the following:

* Include the `CivRegNo` as the [socialSecurityNumber](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-socialSecurityNumber).
* When testing a Walley B2B transaction, provide the company information as shown in the following example:
  ```json
  "company": {
      "name": "Adyen N.V.",
      "registrationNumber": "5562000116"
  }
  ```

Check the status of Walley verification payments in your **Customer Area** > **Transactions** > **Payments**.

## See also

* [API-only integration guide](/online-payments/build-your-integration/advanced-flow?platform=Web\&integration=API%20only)
* [Webhooks](/development-resources/webhooks)
* [Tokenization for recurring payments](/online-payments/tokenization)
* [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)
