API docs

Authentication

Your Merchant API key and Secret key, and how to compute the payment secret.

Your API key provides access to the Peecho API. You can find your keys on your dashboard under Settings > API.

The Merchant API key is used by most endpoints for authorization. Some endpoints also require a Secret key, which is used for SHA-256 encoding information to provide extra security — for example, the Order payment endpoint.

Computing the payment secret

The secret field on the payment request is the SHA-256 hex digest of your secret key concatenated with the order id. For secretKey="SECRETABCD" and orderId=1234:

SHA-256("SECRETABCD1234") = "4bf65a3ffc022f0070babee6540048dfc1a3faad270f62f8084fe66f94ebf8fd"
import { createHash } from "node:crypto";

const secret = createHash("sha256")
  .update(`${secretKey}${orderId}`)
  .digest("hex");