Integrate
By Rizky
By Rizky
Create API keys, receive webhooks, and connect Mayarin to your WooCommerce store.
API Keys
Open API keys in the sidebar. It needs the api-keys:manage permission, so an account without it will not see the menu. Create a key 1. Choose to create a key and name it after what will use it, for example undrly-ss-apikey. One key per integration means revoking one never breaks another. 2. Pick the kind: - Secret (sk_โฆ) for your server. Tick only the permissions it needs. - Publishable (pk_โฆ) for browser code. It has a fixed, limited reach. 3. Copy the secret from the dialog straight away. The secret is shown once. Mayarin stores only a hash and cannot show it again. Lost it? Make a new key and deactivate the old one. Keep it safe - Never put an sk_ key in a web page, theme file, chat message or public repository. - Testnet and mainnet keys are separate. A testnet key is refused on mainnet. If a key leaks Deactivate it under API keys. It stops working on the next request. Deactivation cannot be undone, so create the replacement and deploy it first if the integration is live. Developers: see authentication and key safety.
Webhooks
A webhook is a message Mayarin sends to a URL you own when something happens, such as a payment succeeding. Your order system should react to webhooks, never to the buyer returning to your site: a buyer who closes the tab is still paid. Open Webhooks in the sidebar (needs settings:manage). Add an endpoint 1. In Endpoints, add the URL, for example https://example.com/webhooks/mayarin. 2. Copy its signing secret. Your server uses it to confirm a message really came from Mayarin. 3. Save the secret in your server configuration, not in page code. Check deliveries Deliveries lists every attempt with its event and result. Search by delivery, event or endpoint id. If your server does not answer with a 2xx, Mayarin retries after about 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours, then marks it dead. Events you will see - payment.created, payment.state_changed, payment.failed - payment.flagged โ see flagged payments - escrow.disputed, escrow.dispute.message, escrow.dispute.resolved โ see refunds and disputes Nothing arriving? See webhooks not arriving. Writing the receiver? See verify webhooks.