Alipay In-store: Consumer Barcode

The consumer barcode is the Alipay in-store flow where the merchant scans the consumer's barcode to make the payment.

Payment Method Properties

Available country codes
Country where the merchant (POS device) is domiciled
CH, GB
Processing (Presentation) currenciesCHF, GBP
Settlement currenciesCHF, GBP
Consumer currenciesCNY
Channel member tagalipayconsumerbarcode
Scheme name in the settlement fileAlipay In-store
Minimum transaction amountCNY 0.1
Maximum transaction amountSingle transaction limit: CNY 50,000

Total transaction limit in a day: CNY 50,000

Total transaction limit in a month: CNY 200,000
Session timeout3 minutes
RefundFull, partial and multiple partial refunds are available.
Refund Validity360 days
ChargebackNo
Integration TypeAsynchronous
SandboxScheme-hosted

Transaction Flow

  1. The consumer presents the Alipay barcode code to the cashier.
  2. The cashier places an order on the Electronic Cash Register terminal.
  3. After placing the order, the cashier scans the barcode.
  4. The merchant sends a payment request to Alipay.
  5. Alipay sends a payment result to the consumer and the merchant.

Alipay In-store Integration

Specific input parameters for the TRANSACTION call

Field NameM/O/CTypeDescription
specin.buyeridentitycodeMasciiThe one-time identification code of the Alipay wallet user. It is scanned from the barcode that is shown by the mobile application.
specin.storeidMasciiThe identifier of the store, as boarded with Alipay. It can contain only [0-9a-zA-Z-_], up to 32 characters.
specin.storenameMutf-8The name of the store, as boarded with Alipay.

For standard input parameters, see Input parameters for the TRANSACTION call.

Specific output parameters for the TRANSACTION call

Field NameTypeDescription
SPECOUT.ALIPAYBUYERUSERIDnumericA unique Alipay user ID corresponding to the buyer’s Alipay account. 16 digits beginning with 2088.
SPECOUT.ALIPAYMERCHANTIDasciiThe merchant ID, as boarded with Alipay.
SPECOUT.ALIPAYMERCHANTNAMEutf-8The merchant’s name, as boarded with Alipay
SPECOUT.ALIPAYSTOREIDasciiThe identifier of the store, as boarded with Alipay. It can contain only [0-9a-zA-Z-_], up to 32 characters.
SPECOUT.ALIPAYSTORENAMEutf-8The name of the store, as boarded with Alipay.
SPECOUT.CNYAMOUNTutf-8CNY Amount in major units.
SPECOUT.SRCAMOUNTutf-8The transaction amount in the pricing currency. The value of this parameter is in the range of 001 - 10000000000 and with two decimal places. In minor units. Example: 3925
SPECOUT.SRCCURRENCYutf-8The currency used according to the wallet’s currency. Example: CNY.

For standard output parameters, see Output parameters for the TRANSACTION call.

Specific output parameters for the REFUND call

Field NameTypeDescription
SPECOUT.CNYAMOUNTutf-8CNY amount in major units
SPECOUT.DSTAMOUNTutf-8Transaction amount in CNY
SPECOUT.DSTCURRENCYutf-8CNY currency
SPECOUT.FXRATEutf-8The exchange rate used for the refund; this is the same exchange rate used for the original payment. Can have up to eight digits after the decimal point

TRANSACTION call input

tag=alipayconsumerbarcode
&txtype=TRANSACTION
&countrycode=DE
&currency=CNY
&amount=1055
&merchanttxid=GVk8ZenqKSQG
&login=johndoe
&password=wXBrpVporFVjGO4R
&contractid=JOHNDOECONTRACT
&channel=testchannel
&merchantredirecturl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Flanding.php
&notificationurl=https%3A%2F%2Fmerchant.com%2Fwork%2Fppro2%2Fnotification.php
&specin.dynamicdescriptor=DynDescriptor
&accountholdername=John%20Doe
&specin.storename=Widgets%20LLC
&specin.storeid=WIDGETS123
&specin.buyeridentitycode=123456789012345678
&returnmode=urlencodeext

TRANSACTION call output

STATUS=SUCCESSFUL
&RAND2112459470=f97243f8b9da2aa40c461652ff9cdc64312d1f9f
&TXID=643772308&MERCHANTTXID=GVk8ZenqKSQG
&FUNDSSTATUS=NOT_EXPECTED
&FLAGS=
&ERRMSG=
&CHANNEL=testchannel
&TAG=alipayconsumerbarcode
&REDIRECTSECRET=izReipLmavT6qIOHkxYpzoOf2sCMBni1
&SPECOUT.ALIPAYMERCHANTID=Merchant380
&SPECOUT.ALIPAYMERCHANTNAME=Merchant LTD
&SPECOUT.ALIPAYSTOREID=WIDGETS123
&SPECOUT.ALIPAYSTORENAME=Widgets LLC
&SPECOUT.PAYMENTPURPOSE=3VZKUHP
&SPECOUT.CNYAMOUNT=1055
&SPECOUT.SRCAMOUNT=1055
&SPECOUT.SRCCURRENCY=CNY

Customer Barcode Cancellation

Cancellation Flow

In Alipay in-store consumer barcode, there are 2 possible flows

  • No authentication (frictionless)
  • Authentication required

In the no-authentication flow
A CannotCancel error is returned. After the merchant scans the customer’s barcode the payment is completed immediately.

In the authentication required flow
When the merchant scans the customer’s barcode, the customer is prompted to enter their Alipay wallet PIN and for payment confirmation. At this point, cancellation is allowed.

After the customer completes authentication and confirms the payment, the CannotCancel error is returned because the payment has already been completed.

Additional information

With the exception of technical problems, the transaction will at first be in a PENDING state and the parameter SPECOUT.REDIRECTOPTIONAL is returned (see Well-known SPECOUT parameters). It is recommended not to redirect the terminal to the payment page (REDIRECTURL) – only a static page is shown because the flow continues on the POS terminal which should display a QR code image containing the value returned in SPECOUT.ALIPAYQRCODE. The terminal may poll for a final state (SUCCEEDED or FAILED) every few seconds (at least 5 seconds between retries), with a timeout of e.g. 180 seconds.