Merchant Topup - PayPay Open Payment API Documentation (2024)

Introduction

Merchant Top Up's provides a service that allows users topup their wallet using merchant wallet balance.

TLS implementation

The PayPay Open Payment API requires that you use TLS 1.2 or higher as a security measure. Note that you cannot connect with TLS1.0 and TLS1.1.

Onboard merchant

To start utilizing our Open Payment API platform, at first the businessneeds to be onboarded as a PayPay merchant.

This process usually consists of information collection, manualverification, contract confirmation and credentials issuance.

After becoming a merchant on PayPay, the following items would be setup forthe client:

  • api key and secret
  • allowed authorization callback domains
  • user authorization validity time
  • webhook endpoints
  • client IP whitelist

This setup can be managed using our merchant panel/ getting in touch with the sales representative.

Acquire user authorization

To be able to collect payment from PayPay user’s wallet, you need to obtain user’s authorization explicitly.

Acquiring user authorization can be achieved using our simple account linking flow here.

Specify "merchant_topup" for SCOPE.

OPA API Authorization

Everything related to OPA API Authorization is described here.

Specify merchant in request

Every time an API is called, the merchant identifier needs to be passed along with the request. There are two ways to pass the merchant identifier:

In a query string parameter:

?assumeMerchant={MerchantId}

Or in HTTP headers:

X-ASSUME-MERCHANT: {MerchantId}

If both are provided, the query string parameter would take precedence.

Error Handling

PayPay OPA uses HTTP response status codes and OPA error code to indicatethe success or

failure of the requests. With these information, you can decide what errorhandling strategy

to use. In general, PayPay OPA return the following http status codes.

Response code list

Common response code

StatusCodeDescription
200SUCCESSSuccess
400INVALID_REQUEST_PARAMSThe infomation provided by the request contains invalid data, e.g., unsupported currency.
400MISSING_REQUEST_PARAMSThe set parameter is invalid.
401UNAUTHORIZEDNo valid api key and secret provided
401INVALID_USER_AUTHORIZATION_IDThe specified user authorization ID is invalid.
401EXPIRED_USER_AUTHORIZATION_IDThe user authorization ID expired
401OP_OUT_OF_SCOPEThe operation is not permitted.
404OPA_CLIENT_NOT_FOUNDOPA Client not found
429RATE_LIMITToo many requests
500SERVICE_ERRORA service error has occurred.
500INTERNAL_SERVER_ERRORThis code indicates that something went wrong, but we don't know exactly if the transaction has happened or not. It should be treated as unknown payment status.
503MAINTENANCE_MODESorry, we are down for scheduled maintenance.

Merchant Top Up

StatusCodeDescription
400INVALID_PARAMSThe set parameter is invalid.
400CANCELED_USERCanceled user
400SUSPECTED_DUPLICATE_ORDERThe same order is created multiple times.
400UNACCEPTABLE_OPThe requested operation is not able to be processed due to the current condition, e.g., the user is suspecious.
400USER_STATE_IS_NOT_ACTIVEThe request cannot be accepted because the user status is inactive.
400NO_SUFFICIENT_FUNDThere is no sufficient fund for the transaction.
400KYC_NOT_COMPLETEDThis is returned if user has not completed KYC in case of target account type (targetAccount) EMONEY.
400LIMIT_EXCEEDEDThis is returned when the topup amount is not under the limit or merchant wallet balance exceeded.
400DUPLICATE_TOPUP_REQUESTThis is returned when there is a topup request of same merchantTopupId with different amount.
404RESOURCE_NOT_FOUNDAccount not found
500TRANSACTION_FAILEDTransaction failed

Get topup details

StatusCodeDescription
404RESOURCE_NOT_FOUNDOrder not found

Unlink user

StatusCodeDescription
401INVALID_USER_AUTHORIZATION_IDThe specified user authorization ID is invalid.

Get user authorization status

StatusCodeDescription
400CANCELED_USERThe user has canceled their PayPay account.
401INVALID_USER_AUTHORIZATION_IDThe specified user authorization ID is invalid.

Timeout

The recommended timeout setting is specified in each API. The mostimportant one is for the

payment creation api, where the read timeout should not be less than 30seconds. When timeout

happens, it should be treated as unknown payment status.

Handle unknown payment status

There are two ways to react with this situation

  1. Use the query api to query the transaction status. If the originaltransaction was failed or not found in PayPay, you can start a new transaction for the same purpose.

  2. Or, you can cancel the transaction, if the cancel api is provided.After the cancellation is accepted, you can start a new transaction for the same purpose.

API execution result associated with user authorization status change

API execution may fail due to user authorization status change. The assumed user status and the corresponding API execution results are as follows. In other APIs, no error occurs due to status change.

Merchant Top up

user status
terminate PayPayuser authorization expiredDeauthorization in app operation
http status:401
Code="INVALID_USER_AUTHORIZATION_ID"
http status:401
Code="EXPIRED_USER_AUTHORIZATION_ID"
http status:401
Code="INVALID_USER_AUTHORIZATION_ID"

*If you execute Merchant Top up for users who terminated by 2022/2/25,
 The error code will be "VALIDATION_FAILED_EXCEPTION".


Get user authorization status

user status
terminate PayPayuser authorization expiredDeauthorization in app operation
http status:400
Code="CANCELED_USER"
http status:200
data.expiresAt < current date
http status:200
data.status="inactive"

Wallet

Everything related to PayPay Wallet balance

Merchant Top up

Transfer money to user balance

Timeout: 50s

query Parameters
agreeSimilarTransaction

string

(Optional) If the parameter is set to "true", the payment duplication check will be bypassed.

Request Body schema: application/json

CreateTopUp

merchantTopUpId

required

string (MerchantTopUpId) <= 64 characters

The unique user credit transaction id provided by merchant

userAuthorizationId

required

string (UserAuthorizationId) <= 64 characters

The PayPay user reference id returned by the user authorization flow

required

object (MoneyAmount)

requestedAt

required

integer (EpochTime)

Epoch timestamp in seconds

targetAccount

string

Enum: "PREPAID" "EMONEY"

The user account type.If you want to put money into PREPAID account explicitly, please set "PREPAID".If you want to put money into EMONEY account explicitly, please set "EMONEY" and the user's KYC must be completed.Otherwise(targetAccount is not specified), the account will be decided depend on user's KYC status.

orderDescription

string <= 255 characters

Description of the topup

metadata

object

This parameter is obsolete.
The item is retained for backward compatibility and will be removed in a future release.

Responses

Production server

https://api.paypay.ne.jp/v2/wallet/topups

Staging server

https://stg-api.paypay.ne.jp/v2/wallet/topups

Sandbox server

https://stg-api.sandbox.paypay.ne.jp/v2/wallet/topups

Request samples

  • Payload

Content type

application/json

{

  • "merchantTopUpId": "string",

  • "userAuthorizationId": "string",

  • "amount": {

    • "amount": 0,

    • "currency": "JPY"

    },

  • "requestedAt": 1704112496,

  • "targetAccount": "PREPAID",

  • "orderDescription": "string",

  • "metadata": { }

}

Response samples

  • 200
  • 400
  • 401
  • 404
  • 500

Content type

application/json

{

  • "resultInfo": {

    • "code": "string",

    • "message": "string",

    • "codeId": "string"

    },

  • "data": {

    • "topUpId": "string",

    • "status": "COMPLETED",

    • "acceptedAt": 1704112496,

    • "merchantTopUpId": "string",

    • "userAuthorizationId": "string",

    • "amount": {

      • "amount": 0,

      • "currency": "JPY"

      },

    • "requestedAt": 1704112496,

    • "targetAccount": "PREPAID",

    • "orderDescription": "string",

    • "metadata": { }

    }

}

Get top up details

Get topup details

Timeout: 15s

path Parameters
merchantTopUpId

required

string (MerchantTopUpId) <= 64 characters

The unique user credit transaction id provided by merchant

Responses

Production server

https://api.paypay.ne.jp/v2/wallet/topups/{merchantTopUpId}

Staging server

https://stg-api.paypay.ne.jp/v2/wallet/topups/{merchantTopUpId}

Sandbox server

https://stg-api.sandbox.paypay.ne.jp/v2/wallet/topups/{merchantTopUpId}

Response samples

  • 200
  • 401
  • 404
  • 500

Content type

application/json

{

  • "resultInfo": {

    • "code": "string",

    • "message": "string",

    • "codeId": "string"

    },

  • "data": {

    • "topUpId": "string",

    • "status": "COMPLETED",

    • "acceptedAt": 1704112496,

    • "merchantTopUpId": "string",

    • "userAuthorizationId": "string",

    • "amount": {

      • "amount": 0,

      • "currency": "JPY"

      },

    • "requestedAt": 1704112496,

    • "targetAccount": "PREPAID",

    • "orderDescription": "string",

    • "metadata": { }

    }

}

User

Unlink user

Unlink a user from the client

Timeout: 15s

path Parameters
userAuthorizationId

required

string (UserAuthorizationId-2) <= 64 characters

The PayPay user reference id returned by the user authorization flow

Responses

Production server

https://api.paypay.ne.jp/v2/user/authorizations/{userAuthorizationId}

Staging server

https://stg-api.paypay.ne.jp/v2/user/authorizations/{userAuthorizationId}

Sandbox server

https://stg-api.sandbox.paypay.ne.jp/v2/user/authorizations/{userAuthorizationId}

Response samples

  • 200
  • 401
  • 404
  • 500

Content type

application/json

{

  • "resultInfo": {

    • "code": "string",

    • "message": "string",

    • "codeId": "string"

    },

  • "data": { }

}

Get user authorization status.

Get the authorization status of a user

Timeout: 15s

path Parameters
userAuthorizationId

required

string (UserAuthorizationId) <= 64 characters

The PayPay user reference id returned by the user authorization flow

Responses

Production server

https://api.paypay.ne.jp/v2/user/authorizations?userAuthorizationId={userAuthorizationId}

Staging server

https://stg-api.paypay.ne.jp/v2/user/authorizations?userAuthorizationId={userAuthorizationId}

Sandbox server

https://stg-api.sandbox.paypay.ne.jp/v2/user/authorizations?userAuthorizationId={userAuthorizationId}

Response samples

  • 200
  • 401
  • 404
  • 500

Content type

application/json

{

  • "resultInfo": {

    • "code": "string",

    • "message": "string",

    • "codeId": "string"

    },

  • "data": {

    • "userAuthorizationId": "string",

    • "referenceIds": [

      • "string"

      ],

    • "status": "ACTIVE",

    • "scopes": [

      • "direct_debit"

      ],

    • "expireAt": 0,

    • "issuedAt": 0

    }

}

Recon file

PayPay generates a topup file by daily processing and notifies it by Webhook.

FAQ

Click here for the latest FAQ.

Changelog

Date of Documentation UpdateDate of ReleaseType of ChangeSectionUpdates
2023.07.04ReleasedDocumentation FixMerchant Top up, Get top up detailsUpdated the description of metadata.
2024.03.12ReleasedDocumentation FixMerchant Top up, Get top up detailsAdded that the metadata is obsolete.

File linkage specifications

CategoryDescriptionNote
File linkage methodWebhook
File Nametopup_<merchant_id>_<from>_<to>.csv
File creation unitmerchant_id
Processing cycle (JST)DailyTransactions from 00:00:00 to 23:59:59.
Notification time (JST)Between 2:00 and 10:00
formatCSV
File retention period20 daysIf the recon file cannot be obtained due to a merchant failure, etc., PayPay will be able to resend the webhook.
Please contact us if you would like to be notified again.
File acquisition period2hours
character code(Contents)Shift_JIS
character code(file name)UTF-8
newline codeCRLF

File layout

KeyValue fromNote
topup_idorder_idOrder ID issued by PayPay.
merchant_topup_idmerchantTopUpIdMerchant topup id issued by Merchant.
transaction_typeTOPUP / TOPUP_REVERSETransactions success and reversed types
merchant_idmerchant_idMerchant ID issued by PayPay.
amountamountTopup amount
currencycurrencyJPY
target_accounttarget_accounttarget_account specified by merchant, default PREPAID.
requested_atrequested_attopup requested time
processed_atpaidAtTopup processed time successfully
statestateCOMPLETED. For reversed transactions, there will be two records in the file, TOPUP and TOPUP_REVERSE, the state of both is COMPLETED. Failed topup transactions are not included in recon file

Download Sample File

Webhook notifications

Get the file from the path notified by the webhook.

{ "notification_type":"file.created", "notification_id": "<UUID>", "fileType":"topup_recon", "path":"https://<server_path>/<filename>?parameters", "requestedAt":"<epoch time>"}
Merchant Topup - PayPay Open Payment API Documentation (2024)
Top Articles
How to Backup Steam Cloud Saves in 2024
How to Uninstall Steam Games (and Reinstall Them Later) | Digital Trends
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Dmv In Anoka
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Weekly Math Review Q4 3
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Wyatt Volkman LLD

Last Updated:

Views: 5792

Rating: 4.6 / 5 (46 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Wyatt Volkman LLD

Birthday: 1992-02-16

Address: Suite 851 78549 Lubowitz Well, Wardside, TX 98080-8615

Phone: +67618977178100

Job: Manufacturing Director

Hobby: Running, Mountaineering, Inline skating, Writing, Baton twirling, Computer programming, Stone skipping

Introduction: My name is Wyatt Volkman LLD, I am a handsome, rich, comfortable, lively, zealous, graceful, gifted person who loves writing and wants to share my knowledge and understanding with you.