Skip to content

API Credentials ​

Updated: 12/1/26, 5:47:03 PM

API credentials are what a merchant must obtain before calling the open API: the platform public key, merchant public key and communication key trio, plus the domain verification file required by WeChat JS payments. Menu path: Merchant Center → Business Config → API Credentials / Domain Verification File.

API credentials are merchant-level configuration (one set per merchant, not per app); for app-level configuration see App Payment Config.

The Three Credentials ​

CredentialPurposePage behavior
Platform public keyGiven to you for verifying the signatures of platform responses and callbacks (confirming the message really comes from the platform)Read-only display, copyable
Merchant public keyYou hold the paired private key and configure the public key on the platform, so the platform can verify your request signaturesEditable, supports online "Generate key pair"
Communication keyAES symmetric key used for encrypted transport of API messagesMasked display, editable, supports online "Generate key"

API credentials page

Figure: The API credentials page — platform public key, merchant public key and communication key each carry a "Configured" status tag; the communication key is masked

For how the three credentials participate in signing and encryption, see Signature Mechanism; SDKs have the whole flow built in — see Getting Started.

Status Hints ​

The page provides field-level status hints for each credential, so what is configured and what is missing is clear at a glance:

  • Field status tags: next to the platform public key, merchant public key and communication key field names sits a status tag — green "Configured" / orange "Not set". The platform public key is injected by the platform side; when it is missing, the tag reads "Not set by platform" — contact the platform to resolve it, it is not a merchant-side action;
  • Status line: when the merchant public key or communication key is configured, a line under the input reads "Configured · leave blank to keep the current value" (the communication key includes a masked preview such as abcdef******uvwxyz); once you type a new value, it changes to "Saving will replace the current key (with preview)", making clear the save overwrites rather than appends;
  • Last configured time: shown to the right of the page title as "Last configured", only when at least one of the merchant public key / communication key is configured; it is the time of the last saved change.

The same "credentials fully configured" verdict also feeds two reminders: the "API credentials" to-do alert on the merchant-panel workspace, and the "Not set" tag on the "API Credentials" tile of the admin-side merchant workbench (hovering lists the missing items) — once configured here, both disappear.

Online Generation and Rotation ​

If you don't have keys at hand, you can generate them directly on the page — no local tooling required:

  • Generate key pair (RSA): after generation, the private key is shown only once in a dialog and cannot be recovered once closed — copy and store it immediately. Regenerating when a public key already exists overwrites the original key and requires confirmation;
  • Generate key (AES): regenerates the communication key; same confirmation when a value already exists.

Knock-on effects of rotation

After replacing the merchant public key or the communication key, every caller still on the old key (business systems, SDK instances) will fail signature verification / decryption. Before rotating, confirm that all integrators have switched to the new key, then save.

The page is read-only by default; click "Edit" in the top-right corner to modify it. "Cancel" asks for confirmation and restores the current server values; "Save" also shows a confirmation dialog.

Only modified fields are submitted on save: the communication key is masked on the page; leaving it untouched does not overwrite the real value on the server — don't panic at the mask, it does not mean the key is lost.

Domain Verification File ​

WeChat JSAPI / mini-program payments require a verification file under the collecting domain (an MP_verify_xxxx.txt downloaded from the WeChat Official Account Platform). Menu path: Merchant Center → Business Config → Domain Verification File.

  • Click "Upload verification file" and pick the txt file downloaded from WeChat; only names starting with MP_verify_ are accepted — other file names are rejected outright;
  • After upload, the system hosts the file and serves it; the list is searchable by file name and verification code;
  • Editing can only change the remark; the file name and content are immutable — if you uploaded the wrong one, delete and re-upload.

Domain verification file page

Figure: The domain verification file page — only files starting with MP_verify_ are accepted; the list supports search by file name and verification content (no data in the demo environment)

The admin panel can manage the same data on your behalf (Merchant Management → Merchant Workbench → Integration Config → WeChat Domain Verify); changes on either side take effect immediately.