Notify Transaction Status

Notify Transaction Status

Use notifications to receive timely status updates for successful payment transactions. Merchant will need to provide a callback URL that can receive requests from ShopeePay notification server during onboarding.

Each callback request will contain a HMAC signature in the request header that should be verified to ensure authenticity of the callback content. This signature is generated using the ShopeePay issued secret key, assigned to the Merchant receiving the callback request.

It is essential for the merchant to validate that payment amount andpayment_reference_id matches the original /qr/create request before considering the payment as successful.

Note: merchants are highly recommended to implement Check Transaction Status endpoint to query the updated status of the transaction.

Common Fields

FieldTypeDescription
amountint64Amount of the transaction, inflated by a factor of 100. A positive integer in the smallest currency unit, with no decimal point.Example:Smallest amount will be 1, which represents 0.01.For currencies that do not have denomination in cents, the smallest amount will be 100, which represents 1 IDR (Rp 1) or 1 VND (₫ 1).
transaction_snstringTransaction identifier in ShopeePay system.
payment_methoduint32Indicates the product flows used. Refer to Point of Initiation for the respective product flows.Note: Do not set this as default value for validation
user_id_hashstringUnique identifier of the customer making the payment.
merchant_ext_idstringUnique identifier of the merchant in merchant’s system.
store_ext_idstringUnique identifier of the store in merchant’s system.
terminal_idstringThis field is present when there is terminal_id in merchant’s MPM or CPM API request
payment_channeluint32Indicates the source of fund used. Refer to Payment Channels for the respective source of fund.
co_fundingobjectWill return empty if no co-funding involved.Note: This field is currently used in Thailand and Vietnam only.
* promotion_ext_namestringName of the promotion for merchant’s reference.
* redeemed_promotion_amountint64Amount of the promotion benefit obtained by customer, inflated by a factor of 100. A positive integer in the smallest currency unit, with no decimal point.Note: for refund transaction types, this will be the amount of promotion benefit ShopeePay clawbacks from the customer in that refund transaction.Example:Smallest amount will be 1, which represents 0.01.For currencies that do not have denomination in cents, the smallest amount will be 100, which represents 1 IDR (Rp 1) or 1 VND (₫ 1).
* redeemed_promotion_typeuint32Refer to Promotion Types for specific transaction types.
* co_funding_cost_amountint64Amount of cost born by merchant for the promotion benefit, inflated by a factor of 100. A positive integer in the smallest currency unit, with no decimal point.Example:Smallest amount will be 1, which represents 0.01.For currencies that do not have denomination in cents, the smallest amount will be 100, which represents 1 IDR (Rp 1) or 1 VND (₫ 1).

Additional Fields for Indonesia, Malaysia, Philippines and Singapore

APIFieldTypeDescription
  • CPM
  • MPM
  • Checkout
payment_reference_idstringUnique identifier of payment transaction generated by merchant.
  • CPM
  • MPM
  • Checkout
payment_statusuint32

Successful payment: payment_status = 1

Refer to Payment Status for the respective payment status.

  • Link & Pay
  • Subscription
reference_idstring

A new field introduced to generalise the notify callback for all types of transactions. This could be either payment_reference_id or capture_reference_id.

transaction_typeuint32

A new field introduced to generalise the notify callback for all types of transactions.

Refer to Transaction Types for specific transaction types.

transaction_statusuint32

A new field introduced to generalise the notify callback for all types of transactions.

Refer to Transaction Status for specific transaction statuses.

Additional Fields for Thailand and Vietnam

APIFieldTypeDescription
  • CPM
  • MPM
  • Checkout
  • Link & Pay
  • Subscription
reference_idstringA new field introduced to generalise the notify callback for all types of transactions. This could be either payment_reference_id or capture_reference_id.
transaction_typeuint32

A new field introduced to generalise the notify callback for all types of transactions.

Refer to Transaction Types for specific transaction types.

transaction_statusuint32

A new field introduced to generalise the notify callback for all types of transactions.

Refer to Transaction Status for specific transaction statuses.

Response Parameters

  • In Indonesia, Malaysia, the Philippines, and Singapore, merchants are advised to respond with code=0 to acknowledge the notification. ShopeePay will send the notification only once.
  • In Thailand and Vietnam, if a merchant does not respond with code=0, ShopeePay will resend the notification up to 2 times at 5-minute intervals.
FieldTypeMandatoryDescription
errcodeint32YError code to specify the error returned0: success
debug_msgstringNDebug message to provide more information

Sample Callback for MPM, CPM and Checkout Payment Transaction

JS EXAMPLE

{
"amount": 10000,
"transaction_sn": "019703251690639893",
"payment_method": 2,
"user_id_hash": "15e455125fba426a4a2bb9145b3af2906813a7f222f6eab93b026ead62dc8d76",
"merchant_ext_id": "external-merchant",
"store_ext_id": "external-store",
"terminal_id": "A88",
"payment_reference_id": "ref-must-be-unique",
"payment_status": 1,
"payment_channel": 1
}
arrow-svg

Copy

JS EXAMPLE

{
"amount": 10000,
"transaction_sn": "019703251690639893",
"payment_method": 128,
"user_id_hash": "15e455125fba426a4a2bb9145b3af2906813a7f222f6eab93b026ead62dc8d76",
"merchant_ext_id": "external-merchant",
"store_ext_id": "external-store",
"reference_id": "ref-must-be-unique",
"transaction_type": 13,
"transaction_status": 3,
"payment_channel": 1
}
arrow-svg

Copy