---
title: "Japanese convenience stores for API only"
description: "Add payments through Japanese convenience stores to an existing API-only integration."
url: "https://docs.adyen.com/payment-methods/econtext-konbini/api-only"
source_url: "https://docs.adyen.com/payment-methods/econtext-konbini/api-only.md"
canonical: "https://docs.adyen.com/payment-methods/econtext-konbini/api-only"
last_modified: "2020-06-12T10:21:00+02:00"
language: "en"
---

# Japanese convenience stores for API only

Add payments through Japanese convenience stores to an existing API-only integration.

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

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

To accept payments from Japanese convenience stores, you need to collect the shopper's full name, phone number, and email. When the shopper proceeds to pay, handle the transaction depending on which convenience store they selected:

* 7-Eleven: Redirect your shopper to a 7-Eleven page where they see the voucher.
* Other Japanese convenience stores: Present the voucher.

The shopper can then note the voucher reference or print the voucher, and pay in cash either at 7-Eleven or other convenience stores.

If you offer Pay-easy ATM with an API-only integration, you must update the following:

* Display the `collectionInstitutionNumber`, `reference`, and `alternativeReference` from the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response on the voucher.
* Use the [/cancels](https://docs.adyen.com/api-explorer/Checkout/latest/post/cancels) endpoint for expiry management.\
  For more information, see our documentation for [canceling payments](/online-payments/cancel).

The last day to implement these changes is **23 February 2026**. On 24 February 2026 00:00AM JST, every shopper action with the old payment number will be rejected at the Pay-easy ATM.

## Requirements

| Requirement          | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| -------------------- |   |
| **Integration type** | Make sure that you have built your [API-only integration](/online-payments//).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| **Setup steps**      | Before you begin:- [Add **eContext Convenience Stores** in your Customer Area](/payment-methods/add-payment-methods) to support payments made through Lawson, Mini Stop, Family Mart, and Seicomart.
- [Add **eContext PayEasy ATM** in your Customer Area](/payment-methods/add-payment-methods) to support ATM payments made through Pay-easy.
- [Add **eContext PayEasy Online Banking** in your Customer Area](/payment-methods/add-payment-methods) to support online payments made through Pay-easy.
- [Add **eContext 7Eleven** in your Customer Area](/payment-methods/add-payment-methods) to support payments made through 7-Eleven. |

## Build your payment form for 7-Eleven and other Japanese convenience stores

To include 7-Eleven and other Japanese convenience stores in your payment form, you need to:

1. Show 7-Eleven and other Japanese convenience stores as an available payment method.

   We provide a 7-Eleven and other Japanese convenience stores logo which 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#downloading-logos).

2. After the shopper selects 7-Eleven or other Japanese convenience stores , collect the following details from the shopper:

   | Category         | Details to collect                                                                    |
   | ---------------- | ------------------------------------------------------------------------------------- |
   | Shopper name     | The shopper's first name and last name.                                               |
   | Email            | The shopper's email. Vouchers are sent to their email (except for 7-Eleven vouchers). |
   | Telephone number | The shopper's telephone number.                                                       |

You can also get the required shopper details from the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response, as explained in the [API-only integration guide](/online-payments/build-your-integration/advanced-flow/?platform=Web\&integration=API%20only\&version=71#get-available-payment-methods).

When you make a POST [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request, specify:

* [countryCode](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods): **JP**
* [amount.currency](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): **JPY**
* [amount.value](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods#request-amount): The value of the payment, [in minor units](/development-resources/currency-codes).

The required fields for 7-Eleven or other Japanese convenience stores are included in the object with the following `type`. You'll also use `type` to make a payment in the next step:

* **econtext\_seven\_eleven**: For 7-Eleven Japan.
* **econtext\_atm**: For Pay-easy ATM payments.
* **econtext\_online**: For Pay-easy online payments.
* **econtext\_stores**: For other Japanese convenience stores.

## Make a payment

From your server, make a POST [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, specifying the following:

| Parameters      | Required                                                                                    | Description                                                                                                                      |
| --------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `paymentMethod` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Object that contains the `type`, and the shopper's `firstName`, `lastName`, `telephoneNumber`, and `shopperEmail`.               |
| `shopperLocale` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Language and country code to be used in the payment. For example, **ja-JP**.                                                     |
| `returnUrl`     | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The URL where the shopper will be redirected back to after they see the voucher. This URL can have a maximum of 1024 characters. |

Select a convenience store in the tabs below to see how to make a payment with a value of **1,000 JPY**, and how to show the voucher to the shopper:

### Tab: 7-Eleven

#### 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":"JPY",
    "value":1000
  },
  "paymentMethod":{
    "type":"econtext_seven_eleven",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

#### Java

```java
// Adyen Java API Library v27.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.checkout.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.model.RequestOptions;
import com.adyen.service.checkout.*;

// For the live environment, additionally include your liveEndpointUrlPrefix.
Client client = new Client("ADYEN_API_KEY", Environment.TEST);

// Create the request object(s)
Amount amount = new Amount()
  .currency("JPY")
  .value(1000L);

EcontextVoucherDetails econtextVoucherDetails = new EcontextVoucherDetails()
  .firstName("Simon")
  .lastName("Hopper")
  .telephoneNumber("1234567890")
  .shopperEmail("s.hopper@email.com")
  .type(EcontextVoucherDetails.TypeEnum.SEVEN_ELEVEN);

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_ORDER_NUMBER")
  .amount(amount)
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .paymentMethod(new CheckoutPaymentMethod(econtextVoucherDetails))
  .shopperLocale("ja-JP")
  .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

// Send the request
PaymentsApi service = new PaymentsApi(client);
PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
```

#### PHP

```php
// Adyen PHP API Library v19.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Checkout\Amount;
use Adyen\Model\Checkout\CheckoutPaymentMethod;
use Adyen\Model\Checkout\PaymentRequest;
use Adyen\Service\Checkout\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
// For the live environment, additionally include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("JPY")
  ->setValue(1000);

$checkoutPaymentMethod = new CheckoutPaymentMethod();
$checkoutPaymentMethod
  ->setFirstName("Simon")
  ->setLastName("Hopper")
  ->setTelephoneNumber("1234567890")
  ->setShopperEmail("s.hopper@email.com")
  ->setType("seven_eleven");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_ORDER_NUMBER")
  ->setAmount($amount)
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setPaymentMethod($checkoutPaymentMethod)
  ->setShopperLocale("ja-JP")
  ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

$requestOptions['idempotencyKey'] = 'UUID';

// Send the request
$service = new PaymentsApi($client);
$response = $service->payments($paymentRequest, $requestOptions);
```

#### C\#

```cs
// Adyen .net API Library v17.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Checkout;
using Adyen.Service.Checkout;

// For the live environment, additionally include your liveEndpointUrlPrefix.
var config = new Config()
{
    XApiKey = "ADYEN_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
Amount amount = new Amount
{
  Currency = "JPY",
  Value = 1000
};

EcontextVoucherDetails econtextVoucherDetails = new EcontextVoucherDetails
{
  FirstName = "Simon",
  LastName = "Hopper",
  TelephoneNumber = "1234567890",
  ShopperEmail = "s.hopper@email.com",
  Type = EcontextVoucherDetails.TypeEnum.SevenEleven
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  PaymentMethod = new CheckoutPaymentMethod(econtextVoucherDetails),
  ShopperLocale = "ja-JP",
  ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

// Send the request
var service = new PaymentsService(client);
var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
const { Client, CheckoutAPI } = require('@adyen/api-library');
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const paymentRequest = {
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  reference: "YOUR_ORDER_NUMBER",
  amount: {
    currency: "JPY",
    value: 1000
  },
  paymentMethod: {
    type: "econtext_seven_eleven",
    firstName: "Simon",
    lastName: "Hopper",
    shopperEmail: "s.hopper@email.com",
    telephoneNumber: "1234567890"
  },
  shopperLocale: "ja-JP",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

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

#### Go

```go
// Adyen Go API Library v10.4.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/checkout"
)
// For the live environment, additionally include your liveEndpointUrlPrefix.
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
amount := checkout.Amount{
  Currency: "JPY",
  Value: 1000,
}

econtextVoucherDetails := checkout.EcontextVoucherDetails{
  FirstName: "Simon",
  LastName: "Hopper",
  TelephoneNumber: "1234567890",
  ShopperEmail: "s.hopper@email.com",
  Type: "econtext_seven_eleven",
}

paymentRequest := checkout.PaymentRequest{
  Reference: "YOUR_ORDER_NUMBER",
  Amount: amount,
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  PaymentMethod: checkout.EcontextVoucherDetailsAsCheckoutPaymentMethod(&econtextVoucherDetails),
  ShopperLocale: common.PtrString("ja-JP"),
  ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
}

// Send the request
service := client.Checkout()
req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
```

#### Python

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

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "reference": "YOUR_ORDER_NUMBER",
  "amount": {
    "currency": "JPY",
    "value": 1000
  },
  "paymentMethod": {
    "type": "econtext_seven_eleven",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

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

#### Ruby

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

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
  :reference => 'YOUR_ORDER_NUMBER',
  :amount => {
    :currency => 'JPY',
    :value => 1000
  },
  :paymentMethod => {
    :type => 'econtext_seven_eleven',
    :firstName => 'Simon',
    :lastName => 'Hopper',
    :shopperEmail => 's.hopper@email.com',
    :telephoneNumber => '1234567890'
  },
  :shopperLocale => 'ja-JP',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..'
}

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

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
import { Client, CheckoutAPI, Types } from "@adyen/api-library";
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const amount: Types.checkout.Amount = {
  currency: "JPY",
  value: 1000
};

const econtextVoucherDetails: Types.checkout.EcontextVoucherDetails = {
  firstName: "Simon",
  lastName: "Hopper",
  telephoneNumber: "1234567890",
  shopperEmail: "s.hopper@email.com",
  type: Types.checkout.EcontextVoucherDetails.TypeEnum.SevenEleven
};

const paymentRequest: Types.checkout.PaymentRequest = {
  reference: "YOUR_ORDER_NUMBER",
  amount: amount,
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  paymentMethod: econtextVoucherDetails,
  shopperLocale: "ja-JP",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

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

The [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response contains an `action` object with the information needed to redirect the shopper.

**/payments response**

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

## Handle the redirect to 7-Eleven

7-Eleven voucher payments can only be tested in the live environment. Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to set up 7-Eleven on the live environment for penny testing.

To show the voucher to the shopper, redirect the shopper to the `action.url` using the `action.method` returned in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response.

The voucher is presented to the shopper in the 7-Eleven page. They can then print the voucher and pay in cash at any 7-Eleven store. When the shopper completes the payment at 7-Eleven store, you'll get to know the outcome of the payment through [webhooks](#present).

### Tab: Other convenience stores

#### 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":"JPY",
    "value":1000
  },
  "paymentMethod":{
    "type":"econtext_stores",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

#### Java

```java
// Adyen Java API Library v27.0.0
import com.adyen.Client;
import com.adyen.enums.Environment;
import com.adyen.model.checkout.*;
import java.time.OffsetDateTime;
import java.util.*;
import com.adyen.model.RequestOptions;
import com.adyen.service.checkout.*;

// For the live environment, additionally include your liveEndpointUrlPrefix.
Client client = new Client("ADYEN_API_KEY", Environment.TEST);

// Create the request object(s)
Amount amount = new Amount()
  .currency("JPY")
  .value(1000L);

EcontextVoucherDetails econtextVoucherDetails = new EcontextVoucherDetails()
  .firstName("Simon")
  .lastName("Hopper")
  .telephoneNumber("1234567890")
  .shopperEmail("s.hopper@email.com")
  .type(EcontextVoucherDetails.TypeEnum.STORES);

PaymentRequest paymentRequest = new PaymentRequest()
  .reference("YOUR_ORDER_NUMBER")
  .amount(amount)
  .merchantAccount("ADYEN_MERCHANT_ACCOUNT")
  .paymentMethod(new CheckoutPaymentMethod(econtextVoucherDetails))
  .shopperLocale("ja-JP")
  .returnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

// Send the request
PaymentsApi service = new PaymentsApi(client);
PaymentResponse response = service.payments(paymentRequest, new RequestOptions().idempotencyKey("UUID"));
```

#### PHP

```php
// Adyen PHP API Library v19.0.0
use Adyen\Client;
use Adyen\Environment;
use Adyen\Model\Checkout\Amount;
use Adyen\Model\Checkout\CheckoutPaymentMethod;
use Adyen\Model\Checkout\PaymentRequest;
use Adyen\Service\Checkout\PaymentsApi;

$client = new Client();
$client->setXApiKey("ADYEN_API_KEY");
// For the live environment, additionally include your liveEndpointUrlPrefix.
$client->setEnvironment(Environment::TEST);


// Create the request object(s)
$amount = new Amount();
$amount
  ->setCurrency("JPY")
  ->setValue(1000);

$checkoutPaymentMethod = new CheckoutPaymentMethod();
$checkoutPaymentMethod
  ->setFirstName("Simon")
  ->setLastName("Hopper")
  ->setTelephoneNumber("1234567890")
  ->setShopperEmail("s.hopper@email.com")
  ->setType("stores");

$paymentRequest = new PaymentRequest();
$paymentRequest
  ->setReference("YOUR_ORDER_NUMBER")
  ->setAmount($amount)
  ->setMerchantAccount("ADYEN_MERCHANT_ACCOUNT")
  ->setPaymentMethod($checkoutPaymentMethod)
  ->setShopperLocale("ja-JP")
  ->setReturnUrl("https://your-company.example.com/checkout?shopperOrder=12xy..");

$requestOptions['idempotencyKey'] = 'UUID';

// Send the request
$service = new PaymentsApi($client);
$response = $service->payments($paymentRequest, $requestOptions);
```

#### C\#

```cs
// Adyen .net API Library v17.0.0
using Adyen;
using Environment = Adyen.Model.Environment;
using Adyen.Model;
using Adyen.Model.Checkout;
using Adyen.Service.Checkout;

// For the live environment, additionally include your liveEndpointUrlPrefix.
var config = new Config()
{
    XApiKey = "ADYEN_API_KEY",
    Environment = Environment.Test
};
var client = new Client(config);

// Create the request object(s)
Amount amount = new Amount
{
  Currency = "JPY",
  Value = 1000
};

EcontextVoucherDetails econtextVoucherDetails = new EcontextVoucherDetails
{
  FirstName = "Simon",
  LastName = "Hopper",
  TelephoneNumber = "1234567890",
  ShopperEmail = "s.hopper@email.com",
  Type = EcontextVoucherDetails.TypeEnum.Stores
};

PaymentRequest paymentRequest = new PaymentRequest
{
  Reference = "YOUR_ORDER_NUMBER",
  Amount = amount,
  MerchantAccount = "ADYEN_MERCHANT_ACCOUNT",
  PaymentMethod = new CheckoutPaymentMethod(econtextVoucherDetails),
  ShopperLocale = "ja-JP",
  ReturnUrl = "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

// Send the request
var service = new PaymentsService(client);
var response = service.Payments(paymentRequest, requestOptions: new RequestOptions { IdempotencyKey = "UUID"});
```

#### NodeJS (JavaScript)

```js
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
const { Client, CheckoutAPI } = require('@adyen/api-library');
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const paymentRequest = {
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  reference: "YOUR_ORDER_NUMBER",
  amount: {
    currency: "JPY",
    value: 1000
  },
  paymentMethod: {
    type: "econtext_stores",
    firstName: "Simon",
    lastName: "Hopper",
    shopperEmail: "s.hopper@email.com",
    telephoneNumber: "1234567890"
  },
  shopperLocale: "ja-JP",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

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

#### Go

```go
// Adyen Go API Library v10.4.0
import (
  "context"
  "github.com/adyen/adyen-go-api-library/v9/src/common"
  "github.com/adyen/adyen-go-api-library/v9/src/adyen"
  "github.com/adyen/adyen-go-api-library/v9/src/checkout"
)
// For the live environment, additionally include your liveEndpointUrlPrefix.
client := adyen.NewClient(&common.Config{
  ApiKey:      "ADYEN_API_KEY",
  Environment: common.TestEnv,
})

// Create the request object(s)
amount := checkout.Amount{
  Currency: "JPY",
  Value: 1000,
}

econtextVoucherDetails := checkout.EcontextVoucherDetails{
  FirstName: "Simon",
  LastName: "Hopper",
  TelephoneNumber: "1234567890",
  ShopperEmail: "s.hopper@email.com",
  Type: "econtext_stores",
}

paymentRequest := checkout.PaymentRequest{
  Reference: "YOUR_ORDER_NUMBER",
  Amount: amount,
  MerchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  PaymentMethod: checkout.EcontextVoucherDetailsAsCheckoutPaymentMethod(&econtextVoucherDetails),
  ShopperLocale: common.PtrString("ja-JP"),
  ReturnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy..",
}

// Send the request
service := client.Checkout()
req := service.PaymentsApi.PaymentsInput().IdempotencyKey("UUID").PaymentRequest(paymentRequest)
res, httpRes, err := service.PaymentsApi.Payments(context.Background(), req)
```

#### Python

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

adyen = Adyen.Adyen()
adyen.client.xapikey = "ADYEN_API_KEY"
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.client.platform = "test" # The environment to use library in.

# Create the request object(s)
json_request = {
  "merchantAccount": "ADYEN_MERCHANT_ACCOUNT",
  "reference": "YOUR_ORDER_NUMBER",
  "amount": {
    "currency": "JPY",
    "value": 1000
  },
  "paymentMethod": {
    "type": "econtext_stores",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl": "https://your-company.example.com/checkout?shopperOrder=12xy.."
}

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

#### Ruby

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

adyen = Adyen::Client.new
adyen.api_key = 'ADYEN_API_KEY'
# For the live environment, additionally include your liveEndpointUrlPrefix.
adyen.env = :test # Set to "live" for live environment

# Create the request object(s)
request_body = {
  :merchantAccount => 'ADYEN_MERCHANT_ACCOUNT',
  :reference => 'YOUR_ORDER_NUMBER',
  :amount => {
    :currency => 'JPY',
    :value => 1000
  },
  :paymentMethod => {
    :type => 'econtext_stores',
    :firstName => 'Simon',
    :lastName => 'Hopper',
    :shopperEmail => 's.hopper@email.com',
    :telephoneNumber => '1234567890'
  },
  :shopperLocale => 'ja-JP',
  :returnUrl => 'https://your-company.example.com/checkout?shopperOrder=12xy..'
}

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

#### NodeJS (TypeScript)

```ts
// Adyen Node API Library v18.0.0
// Require the parts of the module you want to use
import { Client, CheckoutAPI, Types } from "@adyen/api-library";
// Initialize the client object
// For the live environment, additionally include your liveEndpointUrlPrefix.
const client = new Client({apiKey: "ADYEN_API_KEY", environment: "TEST"});

// Create the request object(s)
const amount: Types.checkout.Amount = {
  currency: "JPY",
  value: 1000
};

const econtextVoucherDetails: Types.checkout.EcontextVoucherDetails = {
  firstName: "Simon",
  lastName: "Hopper",
  telephoneNumber: "1234567890",
  shopperEmail: "s.hopper@email.com",
  type: Types.checkout.EcontextVoucherDetails.TypeEnum.Stores
};

const paymentRequest: Types.checkout.PaymentRequest = {
  reference: "YOUR_ORDER_NUMBER",
  amount: amount,
  merchantAccount: "ADYEN_MERCHANT_ACCOUNT",
  paymentMethod: econtextVoucherDetails,
  shopperLocale: "ja-JP",
  returnUrl: "https://your-company.example.com/checkout?shopperOrder=12xy.."
};

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

The response contains `action.type` **voucher** along with the following parameters:

| Parameter      | Description or Value                                                                                                                                                                                                                                |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `pspReference` | Our unique reference for the payment.                                                                                                                                                                                                               |
| `resultCode`   | **PresentToShopper**                                                                                                                                                                                                                                |
| `action`       | Object containing information about the voucher:- `expiresAt`: The date and time when the voucher expires.
- `reference`: A 6-digit reference code reference number for the payment.
- `totalAmount`: The `currency` and `value` of the amount due. |

**/payments response**

```json
{
    "resultCode": "PresentToShopper",
    "action": {
        "paymentMethodType": "",
        "expiresAt": "2020-02-10T16:21:00",
        "initialAmount": {
            "currency": "",
            "value": 1000
        },
        "instructionsUrl": "https://www.econtext.jp/support/cvs/8brand.html",
        "maskedTelephoneNumber": "12******90",
        "merchantName": "YOUR_MERCHANT_ACCOUNT_NAME",
        "reference": "854573",
        "totalAmount": {
            "currency": "",
            "value": 10000
        },
        "type": "voucher"
    }
}
```

## Present the voucher for other convenience stores

Use the information in the `action` object in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to present the voucher to the shopper.

* `action.expiresAt`: The date and time when the voucher expires.
* `action.reference`: The 6-digit reference code reference number for the payment.
* `action.totalAmount`: The `currency` and `value` of the amount due.

The shopper can then print the voucher and pay in cash at convenience stores. When the shopper completes the payment at a convenience store, you'll get to know the outcome of the payment through [webhooks](#present).

### Tab: Pay-easy ATM

**Pay-easy ATM payment request**

```json
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":"JPY",
    "value":1000
  },
  "paymentMethod":{
    "type":"econtext_atm",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

## Present the voucher for Pay-easy

Use the information in the `action` object in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) response to present the voucher to the shopper:

| Parameter                     | Description                                                                                                                   |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `expiresAt`                   | The date and time when the voucher expires. This value always shows the time of end of the day in Japan Standard Time (GMT+9) |
| `collectionInstitutionNumber` | The 6-digit reference code reference number indicate the financial institution number of the payment. (収納期間番号)                |
| `reference`                   | The 20-digit reference code reference number for the shopper. (お客様番号)                                                         |
| `alternativeReference`        | The 6-digit reference code reference number for the payment. (確認番号)                                                           |
| `totalAmount`                 | The currency and value of the amount due.                                                                                     |

The shopper can then print the voucher and pay in cash at convenience stores. When the shopper completes the payment at a convenience store, you'll get to know the outcome of the payment through [webhooks](#present).

**Pay-easy ATM payment response**

```json
{
   "resultCode": "PresentToShopper",
   "action": {
       "paymentMethodType": "econtext_atm",
       "collectionInstitutionNumber": "58091",
       "expiresAt": "2025-11-26T23:59:00",
       "initialAmount": {
           "currency": "JPY",
           "value": 1292
       },
       "instructionsUrl": "https://pay.econ.ne.jp/index?odrno=8a867a***7706",
       "merchantName": "YOUR_MERCHANT_ACCOUNT",
       "passCreationToken": "Ab02b4c0!BQA***Nz4=",
       "reference": "00971999997932822848",
       "alternativeReference": "999196",
       "totalAmount": {
           "currency": "JPY",
           "value": 1000
       },
       "type": "voucher"
   }
}
```

### Tab: Pay-easy Online

**Pay-easy Online payment request**

```json
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":"JPY",
    "value":1000
  },
  "paymentMethod":{
    "type":"econtext_online",
    "firstName": "Simon",
    "lastName": "Hopper",
    "shopperEmail": "s.hopper@email.com",
    "telephoneNumber": "1234567890"
  },
  "shopperLocale": "ja-JP",
  "returnUrl":"https://your-company.example.com/checkout?shopperOrder=12xy.."
}'
```

The response contains an action object with the information needed to redirect the shopper.

**Pay-easy Online payment response**

```json
{
    "resultCode": "RedirectShopper",
    "action": {
        "paymentMethodType": "econtext_online",
        "url": "https://checkoutshopper-live.adyen.com/checkoutshopper/checkoutPaymentRedirect?redirectData=X3XtfG****%3D",
        "method": "GET",
        "type": "redirect"
}
```

## Handle the redirect to Pay-easy

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"
   }
   ```

## Present the payment result

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

The `resultCode` values you can receive for payments made through Japanese convenience stores are:

| resultCode           | Action to take                                                                                                                                      |
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| **RedirectShopper**  | After the shopper is redirected to 7-Eleven's page, reach out to the shopper and inform them that you are waiting for the payment to be completed.  |
| **PresentToShopper** | After the voucher is presented to the shopper, inform the shopper that you are waiting for the payment to be completed.                             |

[]()Wait for webhooks to know the outcome of the payment. The webhooks you can receive for Japanese convenience stores are:

| eventCode         | success field | Description                                                               | Action to take                                                                      |
| ----------------- | ------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| **PENDING**       | **true**      | The voucher reference is successfully created and the payment is pending. | Inform the shopper that you are waiting for the payment to be completed.            |
| **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. |
| **OFFER\_CLOSED** | **true**      | The shopper did not complete the payment before the offer expired.        | Cancel the order and inform the shopper that the payment timed out.                 |

## Test and go live

7-Eleven voucher payments can only be tested in the live environment. Contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) to set up 7-Eleven on the live environment for penny testing.

To test your integration, use the econtext simulator to complete voucher payments in Japanese convenience stores:

1. Log in to the [econtext Simulator](https://form.int.econ.ne.jp/paynotice) using the following credentials:

   * Username: `ectest`
   * Password: `#Gwecn25`

2. In the first box, provide **742001** as the shopID.

3. In the second box, provide the acquirer reference following the format below:
   * **\<pspReference>-262320-econtext\_stores**\
     For example, **DZ4DPSHB4WD2WN82-262320-econtext\_stores**\
     Get the `pspReference` from the webhook message with `eventType`: **AUTHORISATION**.

4. In the third box you select what you want to test.

   * Leave as default for Convenience Stores.
   * Select **セブンイレブン** for 7-Eleven.
   * Select **Pay-easy(Bank Name)** for Pay-easy ATM and Pay-easy Online Banking.

5. Leave the fourth box (入金日時, the time of payment) empty.

6. Click **送信** (Submit).

7. Wait for 15 minutes for the webhook.

Check the status of voucher payments in the test environment in your [Customer Area](https://ca-test.adyen.com/):

* Vouchers that are pending or that have expired are under **Transactions** > **Offers**.
* Vouchers that have been paid are under **Transactions** > **Payments**.

Before you can accept payments through Japanese convenience stores in live environment, you need to [submit a request to add 7-Eleven or other Japanese convenience stores](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/).

## See also

* [API-only integration guide](/online-payments/api-only)
* [Webhooks](/development-resources/webhooks)
* [API Explorer](https://docs.adyen.com/api-explorer/#/CheckoutService/latest/overview)
