ZenythPay Developer API (0.1.0)

Download OpenAPI specification:

License: LicenseRef-Proprietary

Every response to an API request includes an X-Request-Id header. JSON errors include a safe message, a stable code, the status and the request id.

Integrate with ZenythPay

This reference contains every operation that accepts a merchant API credential or a developer's platform key. Each operation lists its method, required scope, parameters, schemas, examples, and errors. Download the OpenAPI contract or Postman collection.

Quick Start: your own business

  1. Create your ZenythPay account and select your Sandbox business in the dashboard.
  2. Sign in at developers.zenythpay.com as the business owner and open your business under Your businesses. Under API credentials, create a credential with customers:read and the additional permissions your integration needs. Copy the secret once and store it in your server's secret manager.
  3. The merchant is resolved from the credential. The API operates on that business and environment; no merchant ID is needed in request URLs or fields. If the business has several locations, read Locations below.
  4. Make your first request from your server. Load ZENYTH_API_KEY from your secret manager; never embed it in browser code, mobile binaries, source control, URLs, or logs.
curl 'https://api.zenythpay.com/api/v1/merchant/customers' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Accept: application/json'

A new business returns an empty collection:

{"data": [], "pagination": {"next_cursor": null, "has_more": false}}

Collections use cursor pagination. Pass limit and the returned next_cursor as cursor until has_more is false. Follow the maximum limit documented for each resource.

To use Postman, download the collection above and select a resource folder. Set base_url to the origin only (for example, https://api.zenythpay.com, without /api/v1), and partner_environment. Store partner_api_key as a local secret. The folder includes every operation accepting API credentials, with the required environment header and scope descriptions. For money-moving requests, set partner_idempotency_key explicitly and retain it for retries of that operation. Replace example IDs, dates, and payment tokens before sending individual requests. Never share an export containing credentials.

Quick Start: building for other businesses

  1. Create your developer account at developers.zenythpay.com and verify your email. Your account then has a test merchant in Sandbox.
  2. Open API keys and create a Sandbox key with the permissions you need. The two calls below need merchants:read and customers:read. Copy the secret once and keep it on your server.
  3. List the merchants connected to you. Each has an id that starts with cm_.
curl 'https://api.zenythpay.com/api/v1/platform/merchants' \
  -H "Authorization: Bearer ${ZENYTH_PLATFORM_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Accept: application/json'
  1. Make a call for one merchant by naming it in X-ZenythPay-Merchant.
curl 'https://api.zenythpay.com/api/v1/merchant/customers' \
  -H "Authorization: Bearer ${ZENYTH_PLATFORM_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'X-ZenythPay-Merchant: cm_Ab12Cd34' \
  -H 'Accept: application/json'
  1. Take a test payment with our card fields, then board a test merchant. Both are in Get started in the portal. A test merchant takes cards once your email is verified.

Authentication, resources, and environments

The base origin is https://api.zenythpay.com for both environments. Every documented request path includes /api/v1. Sandbox keys start with zp_sandbox_; Production keys start with zp_production_. Always send the matching X-ZenythPay-Environment: sandbox or production header. A mismatched environment header returns 403 without executing the action. Merchant selection fields in the request return 422.

Only operations marked x-partner-scopes accept API keys. The allowed-resource list in Settings is authoritative and corresponds to this reference. For each resource choose None, Read, Write or Read & Write. Write does not grant Read. A resource that is only read, such as Transactions and receipts, offers Read only; one that is only written, such as Refunds and Voids, offers Write only. Credentials have an explicit list of scopes and never grant wildcards. Refunds and voids require their own write grants.

Explicit resource permissions cover payments (payments: charges, payment operations, billing field requirements, and the publishable and tokenization keys), transactions and receipts, voids, refunds, customers, invoices, payment links, and payouts (read only). Only the financial and customer operations below are available. Business settings and administration are managed in the dashboard.

Create, rotate, and revoke credentials only as the business owner, on the business's page at developers.zenythpay.com. Webhook configuration, testing, secret rotation, and delivery history are also managed only there. Credential secrets are shown once and stored hashed. There are at most 20 active credentials per business or location. Rotation immediately revokes the predecessor and returns a new secret once. Revocation blocks new authenticated requests; already accepted requests may finish. Last-used timestamps are updated at most once per minute.

Production credential creation requires an active Production business. Existing credentials cannot operate while that business is suspended or unavailable. Complete business approval and required service activation in the dashboard before charging. Card-present capability remains subject to processor approval. ACH requires a live merchant to accept its service fees and have activation confirmed; a sandbox merchant is chargeable by ACH with no acceptance, because the gateway attaches electronic-check processing to every test account. API permissions do not enable either rail.

Locations

A business can have several locations, each taking payments on its own. When the business owner creates a credential for such a business, they choose one location or All locations.

  • A key for one location acts only there. Its lists show that location's records. Sending location_id with it returns 422.
  • A key for all locations must send location_id when it creates a charge, a customer charge, an invoice or a Payment Link: the record is made at that location. Without it the request returns 422 "Choose the location this is for.". Reads, updates, refunds and voids of an existing record act at that record's own location. Its lists of transactions, invoices, Payment Links, payment operations and payouts, and the transaction and invoice summaries, cover every location that is not suspended, or one location when you pass location_id. Naming a suspended location returns 403.
  • A location whose payments are switched off still answers reads, but a charge or customer charge there returns 409 with error_code location_off.
  • Customers belong to the whole business: every key sees and changes all of the business's customers. With a key for one location, the customer summary counts only that location's sales.
  • A transaction's merchant_id is the location it happened at. A customer's merchant_id is the business.
  • A business without locations ignores location_id. Once it is set up for locations, a key for one location that sends location_id starts getting 422, so don't send it unless you use a key for all locations.

Sandbox businesses have a single location and can't have a key for all locations, so test the location rules on your Production business before taking normal traffic.

Platform keys

If you build for the merchants connected to your ZenythPay developer account, call the API with a platform key instead of each merchant's own key. Create, roll and revoke platform keys in your developer account, each with the permissions you choose. A key is shown once. You can have up to 20 active keys in each environment. Sandbox keys start with zp_platform_sandbox_; Production keys start with zp_platform_production_.

  • Your own calls, under Developer Platform: board merchants, list the merchants connected to you, and list your webhook events. Send the key and X-ZenythPay-Environment only.
  • A merchant's calls: every operation in this reference that accepts PlatformApiKey works for any merchant connected to you. Name the merchant in X-ZenythPay-Merchant with its id: cm_ and 8 letters or digits, the same id in both environments. A Sandbox key acts for the merchant's Sandbox business, and a Production key for its live business. The call then works as that business's key for all locations would, so a charge, customer charge, invoice or Payment Link for a business with several locations sends location_id (GET /api/v1/platform/merchants lists the ids).
  • Two calls are closed to platform keys: GET /api/v1/merchant/publishable-key (use your own publishable key, see Developers: your own publishable key) and GET /api/v1/merchant/events (use your own list, GET /api/v1/platform/events).
  • Answers to a platform key leave out three things the business's own key gets. merchant_id is left out unless the business is set up for locations, when it is one of the ids GET /api/v1/platform/merchants lists. The people of the business who created, changed, sent, cancelled or took something (created_by, updated_by, sent_by, canceled_by, performed_by) are never included, and neither is developer, which shows the business your company name on a payment your key made. Know a merchant by its cm_ id.
curl 'https://api.zenythpay.com/api/v1/merchant/customers' \
  -H "Authorization: Bearer ${ZENYTH_PLATFORM_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'X-ZenythPay-Merchant: cm_4kT9xWq2' \
  -H 'Accept: application/json'

Each call is checked in this order, and the first refusal is the answer:

Answer When
401 "Unauthenticated." The key is unknown, revoked or expired.
403 "This developer account is turned off. Contact ZenythPay support." Our team turned your developer account off.
403 "This API credential does not allow this resource or action." The key doesn't have the permission, or the call is closed to platform keys.
403 "This is a Sandbox key. Send X-ZenythPay-Environment: sandbox with it." A Sandbox key was sent with another environment, or none.
403 "This is a Live key. Send X-ZenythPay-Environment: production with it." A Live key was sent with another environment, or none.
422 "Name the merchant in the X-ZenythPay-Merchant header." A merchant's call names no merchant.
404 "We can't find that merchant." The id is unknown, or the merchant isn't connected to you.
403 "Your access to this merchant is turned off." Our team turned off your access to this merchant.
403 "This merchant isn't live yet." A Production key, for a merchant that isn't approved and live yet.
403 "API access is unavailable for this business. Check its account status." The business is suspended or unavailable.

Limits, each answering 429 with Retry-After. Refused calls count too.

  • 120 requests a minute for each merchant, for all your keys of one environment together. A merchant's own keys have their own limit.
  • 600 a minute in Production and 300 in Sandbox, for your developer account across every merchant and every call.
  • 300 requests a minute from one IP address, whatever the key.
  • 20 application starts an hour in each environment, through the API and your developer account together.
  • 5 link emails a day for each application, and 5 a day to each owner's inbox across all your applications in one environment. Addresses that differ only by a +tag, or by dots in a Gmail address, count as one inbox. Sends, resends, the owner's sign-in codes and the link we email when someone signs up or resets a password with the owner's address all count. A new link the owner asks for themselves has a limit of its own, so it is still sent when yours is reached. When an owner's inbox has had its 5, a send or resend answers 429 "This owner has had as many emails from you as we allow in 24 hours. Try again later."

In Postman, store your platform key as the secret platform_api_key for the Developer Platform requests. For a merchant's requests, store it as partner_api_key too, turn on each request's X-ZenythPay-Merchant header and set platform_merchant to the merchant's id.

Payments, checkout, and customers

For a hosted checkout, create a Payment Link with payment_links:write and send the returned data.payment_url to the customer. Replace the example due date with an appropriate future date.

curl 'https://api.zenythpay.com/api/v1/merchant/payment-links' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Content-Type: application/json' \
  -d '{"amount":"25.50","description":"Order 1001","due_date":"2027-12-31","available_payment_methods":["card"]}'

The Payment Link response appears under Payment Links. Its payment_url is returned only when the link is created or shared; save it then. Sharing a link again makes a new URL, and the earlier one stops working. The due date is the last day the link can be paid (until the end of that day, UTC); move it later with a PATCH if needed.

Each Payment Link created or shared through the API e-mails the business owner a copy of the link. In a live business these e-mails count against two limits: 60 an hour for the business owner, shared with all of the owner's businesses and their invoice e-mails from the dashboard, and 300 a day for each business location. Over either limit, creating or sharing a link returns 429. Sandbox businesses aren't counted, so plan for these limits before going live if you create a link for every order.

An invoice is paid from the e-mail ZenythPay sends to its recipient; the API never returns an invoice's payment URL, and sending an invoice again replaces its link. Use a Payment Link when your integration needs the URL itself. In Sandbox, invoices can be e-mailed only to the business's own team.

Customers belong to the business, across its locations; use customers:write to create them and customers:read to query them. To save a customer's card and charge it later, see Saved cards below. Payment methods saved before Saved cards (GET /api/v1/merchant/customers/{customer}/payment-methods) require customers:read; their card and account numbers are masked, and they include the saved billing name, address and phone. Deleting a customer deletes the customer, their saved payment methods, and every card saved for them through the API (removed ones included); each card that may still be stored at the payment gateway is queued for deletion there. Their payments and refunds are kept and no longer link to a customer; their receipts are kept as they were issued.

For a custom checkout, read the merchant's billing field requirements, tokenize payment details through the supported payment frontend, and send the one-time token to POST /api/v1/merchant/charges with payments:write. Use the card, wallet, or ACH example under that operation and provide the required billing fields. Payment fields (below) make card tokens; there is no way yet to make ACH or wallet tokens on your own page, so take ACH and wallet payments through Payment Links or invoices. ZenythPay's API does not accept raw card numbers, CVVs, or bank-account payment credentials. The public tokenization key must not be substituted for a server API credential.

New card integrations should use payment fields (see Payment fields below), which show ZenythPay card inputs inside your own checkout page.

Use payments:read to inspect payment operations and transactions:read for transaction details and receipts. A checkout redirect alone is not proof of payment. Confirm the recorded final status through the API or a verified webhook followed by a resource fetch. Before fulfilling an order or starting another charge, settle any pending or uncertain payment: check its status with GET /api/v1/merchant/payment-operations, using term with your order_id or status=pending to find it. Send an order_id with every charge so you can find it later. Refunds and voids follow the rules described under those operations.

A successful charge, refund or void comes with a receipt, and so does the transaction when you read it. Its view_url opens the receipt as a PDF. The link doesn't expire and works for anyone who has it, so share it only with the payer.

Payment fields

Payment fields put ZenythPay card inputs (card number, expiration date and security code) inside your own checkout page, or bank account inputs for ACH payments (see Bank account fields below). The card or bank details are typed into a ZenythPay frame, so they never reach your page or your server. Your page gets back a one-time payment token, and your server charges it with POST /api/v1/merchant/charges.

Two keys

The fields use two keys from the same business: one for your page, one for your server.

Key Starts with Where it goes What it does
Publishable key zp_pk_sandbox_ or zp_pk_production_ Your web page, in Zenyth(...) Shows the payment fields and makes one-time payment tokens. Nothing else, so it is safe in a web page.
API credential zp_sandbox_ or zp_production_ Your server only Reads the publishable key (payments:read), charges the token (payments:write), and anything else its permissions allow. Create it on your business's page at developers.zenythpay.com, as the business owner.

Use both from the same business: a token can only be charged by that business.

Before you start

  • Get the publishable key for your business. It starts with zp_pk_sandbox_ (Sandbox) or zp_pk_production_ (Production). It can only show the payment fields, so it is safe in a web page. Read it from your server with GET /api/v1/merchant/publishable-key, which needs payments:read. The first read creates it, and later reads return the same key until the merchant replaces it in the dashboard. A replaced key stops working at once for fields that load after that: they show "Card payments aren't available right now". Fields already open on a page keep working until it reloads. So read the key on your server and cache it for a few minutes, instead of copying it into your page code. Never put your API credential in a web page.
  • If your site sets a Content Security Policy, add https://pay.zenythpay.com to your existing script-src and frame-src directives (or to default-src, if that is the only directive you set). Nothing else is needed for the fields. Keep your own page code in a script file, as in the example below, so it needs no unsafe-inline.
  • In Sandbox, use a zp_pk_sandbox_ key from your Sandbox business. The fields also load on http://localhost and http://127.0.0.1, for Sandbox keys only. Production keys need an https page: on any other page the fields don't load and createToken answers network.

Add the fields to your page

<div id="card"></div>
<button id="pay" type="button">Pay</button>
<p id="card-error" role="alert"></p>

<script src="https://pay.zenythpay.com/js/v1/zenyth.js"></script>
<script src="/checkout.js"></script>

/checkout.js, served from your own site:

const zp = Zenyth('zp_pk_sandbox_00000000000000000000000000000000');
const card = zp.fields('card', {
  appearance: { theme: 'light', variables: { colorText: '#01182B', borderRadius: '6px' } },
});
card.mount('#card');

card.on('change', ({ complete, error }) => {
  document.getElementById('card-error').textContent = error ? error.message : '';
});

const pay = document.getElementById('pay');
pay.addEventListener('click', async () => {
  pay.disabled = true;
  const result = await zp.createToken(card);
  if (result.error) {
    document.getElementById('card-error').textContent = result.error.message;
    pay.disabled = false;
    return;
  }
  // Send the whole result (payment_type, payment_token and card) to your server.
  // Card details never pass through your page.
  const response = await fetch('/checkout', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify(result),
  });
  if (!response.ok) {
    document.getElementById('card-error').textContent = 'The payment did not go through. Please try again.';
    pay.disabled = false;
  }
});

Disable your Pay button while a payment is in progress, so a second click doesn't start a second payment.

Mount the fields as soon as your checkout page opens, not when the payer reaches the payment step. They take a moment to load, often one to three seconds, and that time then passes while the payer fills in the rest of your form. Until they are ready, the fields keep their place on the page and show their placeholders. Listen for ready if you need to know when they can take input. ready never fires when the fields can't load; createToken then answers unavailable or network.

Zenyth(publishableKey) returns a client. It throws a TypeError for anything that is not a publishable key, including an API credential. Load zenyth.js with its own script tag, as above: bundled into your code, it throws an Error.

client.fields('card', { appearance }) returns a group with these methods; client.fields('ach', { appearance }) returns bank account fields with the same methods. Any other name throws a TypeError.

Method What it does
mount(selectorOrElement) Shows the fields inside that element. Calling it again while mounted does nothing. Throws an Error if the element doesn't exist. If your page removes the element, call unmount() and then mount() again.
unmount() Removes the fields. A token request still waiting answers incomplete.
clear() Empties the three inputs, and fires change. It does nothing before ready.
on(event, handler) Listens for an event. Names other than ready and change are ignored.
off(event, handler) Stops listening.

Events

Event When Handler receives
ready The fields are showing and can take input. Nothing.
change The details are checked. { complete, error }. complete is true when all three inputs are filled in correctly. error is null or { field, message } for the first field that needs fixing, where field is number, expiry or cvv (bank account fields: name, account or routing).

Appearance

Pass appearance to fields(). All of it is optional, and any value that does not match the rules below is ignored.

Key Allowed values
theme light (default) or dark.
variables.colorText, colorBackground, colorBorder, colorPlaceholder, colorDanger A hex color: #rgb or #rrggbb.
variables.fontFamily The name of a Google Fonts family: letters, digits and spaces, up to 40 characters. Its regular weight is loaded inside the fields. By default the fields use the device's own font and load none.
variables.fontSize, variables.borderRadius A size in whole pixels from 0px to 32px, such as 16px.

Get a token and charge it

client.createToken(group) never rejects. It resolves with one of two shapes.

{
  "payment_token": "…",
  "payment_type": "card",
  "card": { "type": "visa", "first6": "411111", "last4": "1111", "exp_month": 12, "exp_year": 2030 }
}
{ "error": { "code": "invalid_number", "message": "Check the card number." } }
error.code error.message When it happens
incomplete Enter the card details. An input is empty, or the fields are not ready yet, or they were unmounted.
invalid_number Check the card number. The card number is wrong.
invalid_expiry Check the expiration date. The expiration date is wrong.
invalid_cvv Check the security code. The security code is wrong.
timeout The card details couldn't be checked. Try again. Checking the card took too long, or createToken was called again with changed card details while a request was still running.
unavailable Card payments aren't available right now. The publishable key is unknown, replaced or for the other environment, or the business can't take card payments yet.
network The payment form couldn't load. Check your connection and try again. The fields didn't load within 15 seconds: often your Content Security Policy, a Production key on a page that isn't https, or the payer's connection.

After a timeout, the fields may keep answering timeout for up to a minute. Ask the payer to wait a moment and try again. card.type is the card brand in lower case, such as visa, or card when the brand is not known.

On your server, send the result to POST /api/v1/merchant/charges with payments:write. Pass payment_type, payment_token and card exactly as you received them, and add the amount and the payer's billing details. Some businesses need more billing details than the name, country and postal code below: read them once from GET /api/v1/merchant/billing-field-requirements.

curl 'https://api.zenythpay.com/api/v1/merchant/charges' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-1001-payment-1' \
  -d '{
    "amount": "10.00",
    "payment_type": "card",
    "payment_token": "00000000-000000-000000-000000000000",
    "billing_details": { "name": "Grace Hopper", "country": "US", "postal_code": "94107" },
    "card": { "type": "visa", "first6": "411111", "last4": "1111", "exp_month": 12, "exp_year": 2030 }
  }'

Charge from your server, never from the browser. A token works once and expires 24 hours after it is made, so create it when the payer submits and charge straight away.

  • You don't know whether the charge went through (the request timed out, the answer was a 5xx, or the connection dropped): send the same request again with the same Idempotency-Key and the same body, including the same payment_token. Then check the payment's status through the API or a verified webhook before you do anything else. A different body with the same key returns 409. The same body can also return 409 while the first attempt is still being settled ("Payment operation is already processing.") or when it could not be settled automatically ("…requires reconciliation."): don't start a new payment, wait and check the payment's status.
  • The charge was declined (402): ask the payer to submit again. That is a new attempt, so it needs a fresh token from createToken and a new Idempotency-Key. Sending the declined request again with its key answers 402 again, with Idempotency-Replayed: true and data.status declined: always read data.status.

Bank account fields

Bank account fields take ACH payments the same way: the payer types the name on the account, the account number and the routing number into a ZenythPay frame, and your server charges the token. Ask for the account type and the account holder type in your own page, as they are not part of the fields.

const bank = zp.fields('ach', { appearance });
bank.mount('#bank');

const result = await zp.createToken(bank);
{
  "payment_token": "…",
  "payment_type": "ach",
  "account_name": "Grace Hopper",
  "ach": { "last4": null, "routing_number_last4": "0018" }
}

ach.last4 and ach.routing_number_last4 are the last 4 digits of the account number and the routing number when the bank details come back with them, and null when they don't; the account number's often don't. account_name is left out when no name came back. The methods, events and appearance are those of the card fields. Their answers use their own words:

error.code error.message When it happens
incomplete Enter the bank account details. An input is empty, or the fields are not ready yet, or they were unmounted.
invalid_name Check the name on the account. The name on the account is shorter than 3 characters or longer than 150.
invalid_account_number Check the account number. The account number is wrong, or isn't 4 to 17 digits.
invalid_routing_number Check the routing number. The routing number is wrong, or isn't 9 digits.
timeout The bank account details couldn't be checked. Try again. As for card fields.
unavailable Bank payments aren't available right now. As for card fields, or the business can't take bank payments: it hasn't turned them on in the dashboard.
network The payment form couldn't load. Check your connection and try again. As for card fields.

On your server, send payment_type, payment_token and account_name as you received them, and ach with the account type (checking or savings) and the account holder type (personal or business) added:

curl 'https://api.zenythpay.com/api/v1/merchant/charges' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-1002-payment-1' \
  -d '{
    "amount": "10.00",
    "payment_type": "ach",
    "payment_token": "00000000-000000-000000-000000000000",
    "account_name": "Grace Hopper",
    "ach": { "account_type": "checking", "account_holder_type": "personal", "last4": null, "routing_number_last4": "0018" }
  }'

The rules for timeouts, declines and the Idempotency-Key above apply to bank payments too.

Test in Sandbox

With a zp_pk_sandbox_ key, use the card 4111 1111 1111 1111 with any future expiration date and any 3-digit security code. For bank account fields, use the name Grace Hopper (any name of at least 3 characters), the routing number 490000018 and the account number 24413815. The same card and amount charged twice within 20 minutes can be refused as a duplicate (422 duplicate_payment), so vary the amount between tests.

Developers: your own publishable key

If you build checkouts for the merchants connected to your ZenythPay developer account, use your own publishable key and name the merchant on each page:

const zp = Zenyth('zp_pk_platform_sandbox_00000000000000000000000000000000', { merchant: 'cm_4kT9xWq2' });

Your publishable keys are in your developer account: one starting zp_pk_platform_sandbox_ and, once your email is verified, your company profile is complete and your login has a security method, one starting zp_pk_platform_production_. Your Sandbox key also shows the fields on http://localhost and http://127.0.0.1, so you can test on your own machine; your Live key needs an https page. merchant is the connected merchant's id (cm_ and 8 letters or digits), the same id your server sends in X-ZenythPay-Merchant. Without it, Zenyth() throws a TypeError: "Name the merchant: Zenyth(key, { merchant: 'cm_…' })."

The fields show "Card payments aren't available right now." (bank account fields: "Bank payments aren't available right now.") when your key was replaced, the merchant isn't connected to you, your access to it or your developer account is turned off, or the merchant can't take card payments yet in that environment (a Live merchant until it is live). Before createToken sends complete card details, the fields check your access again, so a page that is already open stops too: once access is refused, createToken answers unavailable until the page reloads. Charge the token from your server with your platform API key and the same merchant in X-ZenythPay-Merchant.

Saved cards

Save a customer's card, with their agreement, while they pay. Then charge it again later: when they pay again, or, if they agreed to it, without them. A saved card belongs to one customer of the business, and you name it by its id, which starts with sc_. The card number never reaches your server: you save the card from the one-time token that payment fields give you.

Step Call Permission
1. Check that Saved cards is on GET /api/v1/merchant/saved-cards customers:read
2. Save a card while the customer pays POST /api/v1/merchant/customers/{customer}/charges with save_card payments:write
Or save a card without a charge POST /api/v1/merchant/customers/{customer}/saved-cards customers:write and payments:write
3. List or read the customer's cards GET /api/v1/merchant/customers/{customer}/saved-cards and …/saved-cards/{card} customers:read
4. Charge a saved card POST /api/v1/merchant/customers/{customer}/charges with source saved_card payments:write
5. Remove a card DELETE /api/v1/merchant/customers/{customer}/saved-cards/{card} customers:write

Only a card typed into the card fields can be saved, on a charge of a customer or without a charge. Apple Pay, Google Pay and bank accounts can't be saved, and POST /api/v1/merchant/charges, which names no customer, answers 422 to save_card.

The examples below use a business's own API credential. With a platform key, also send X-ZenythPay-Merchant with the merchant's cm_ id, as on every call for a merchant (see Platform keys).

Turn it on

Each business turns Saved cards on itself and pays for it. You can't turn it on for a business; you can read whether it is on, and give its owner the link to turn it on.

curl 'https://api.zenythpay.com/api/v1/merchant/saved-cards' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: production' \
  -H 'Accept: application/json'
{
  "data": {
    "state": "off",
    "available": false,
    "paused_reason": null,
    "activation_url": "https://app.zenythpay.com/settings/service-agreement?service=vault&business=123"
  }
}

available is the one thing to check: when it is true, cards can be saved and charged now. state says why it is not:

state What it means What to do
unavailable Saved cards isn't offered to this business. Don't offer to save cards.
off The business hasn't turned it on. Give the business owner activation_url.
pending The owner accepted, and it is being switched on. Read the status again later.
on It is on. Save and charge cards while available is true.
turning_off The owner turned it off. Stop saving and charging cards.

activation_url is there only while state is off. Use it exactly as you get it: how it names the business depends on the key, and a platform key's link can name it by the merchant's cm_ id instead of the business shown here. The owner, or an admin of the business, opens it, signs in to ZenythPay, reads the fees and accepts them. The link holds no secret, so you can show it in your app or email it to the owner.

The business pays the fees, not you: $8.00 a month, and $0.08 each time a card is added, updated or removed. There is no set-up fee. Sending billing_details with a charge of a saved card may count as an update, so send them only when they changed (see Charge a saved card).

paused_reason is three_ds_required, and available is false, when the business turned Saved cards on but requires 3-D Secure, which saved cards don't support yet. A business that requires 3-D Secure and never turned Saved cards on reads unavailable. paused_reason is null in every other case. While Saved cards is paused for every business, a business that turned it on keeps its state, such as on, with available false and paused_reason null: rely on available, not on state.

While available is false, the cards already saved stay saved: they are still listed, each with available false, and you can still remove them. Saving or charging a card answers 409 saved_cards_unavailable. When the business turns Saved cards on again, its saved cards can be charged again.

A location answers its business's status: Saved cards is on or off for the whole business.

Ask for the customer's agreement

A card is saved only with the customer's agreement, given in your checkout before they pay. Show them the words they agree to, and let them choose to save the card. Send those exact words with the save, as consent.text. We keep them for disputes and never return them. ZenythPay doesn't write these words for you. They should say that the card will be saved, when and why the business may charge it, how the amount is set, and how the customer can cancel. For a plan, they should also say how often it is charged, or how many payments there are.

What the customer agrees to is consent.type. It is fixed when the card is saved:

consent.type Who may charge the card
customer_present Only the customer, when they pay with it themselves. A charge by the business answers 422 consent_not_given.
business_unscheduled The customer when they pay, and the business without the customer, when needed. For example, an invoice paid when it falls due.
business_recurring The customer when they pay, and the business without the customer, on a fixed schedule. For example, a monthly subscription.
business_installment The customer when they pay, and the business without the customer, in a set number of payments for one purchase. Each of these payments carries installment_number (see below).

For business_recurring and business_installment, the payment that saves the card and the business's later charges are all sent as payments of the plan. So save a card under one of them only on a payment that belongs to the subscription or the plan, never on a one-off order, and use them only for what the customer agreed to. ZenythPay runs no schedule: your server decides when each payment is due and charges the card each time.

A card's consent never changes. To change it, remove the card, and let the customer save it again under the new words on their next payment.

An example of words for business_unscheduled. It is only an example; write your own for the business:

Save this card for future payments. Example Co may charge it for orders you place and for invoices when they fall due, for the amount of each order or invoice. You can remove the card at any time in your account settings.

Save a card while the customer pays

Charge the customer as usual, with the token from the card fields (see Get a token and charge it), and add save_card:

curl 'https://api.zenythpay.com/api/v1/merchant/customers/123/charges' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: order-1003-payment-1' \
  -d '{
    "amount": "10.00",
    "source": "new_card",
    "payment_token": "00000000-000000-000000-000000000000",
    "billing_details": { "name": "Grace Hopper", "country": "US", "postal_code": "94107" },
    "card": { "type": "visa", "first6": "411111", "last4": "1111", "exp_month": 12, "exp_year": 2030 },
    "order_id": "1003",
    "save_card": {
      "consent": {
        "type": "business_unscheduled",
        "text": "Save this card for future payments. Example Co may charge it for orders you place and for invoices when they fall due, for the amount of each order or invoice. You can remove the card at any time in your account settings.",
        "accepted_at": "2026-11-25T10:00:00Z",
        "ip_address": "203.0.113.20"
      }
    }
  }'
  • consent.type and consent.text (up to 2,000 characters) are required.
  • With business_installment, the payment that saves the card is a payment of the plan: send its number in the plan as installment_number at the top level of the body, next to amount. It is a JSON number from 1 to 99, usually 1, not a string: "1", 0 or 100 answer 422 with errors.installment_number, and so does an installment save without it. Send installment_number with no other kind of save: it answers 422 with errors.installment_number "installment_number is sent only with an installment sale."
  • consent.accepted_at is when the customer agreed. Without it, it is the time of your request. A time more than 5 minutes ahead answers 422.
  • consent.ip_address is the customer's IP address when they agreed, if you have it. We keep it encrypted and never return it.

The answer is the charge, as for any charge, with saved_card added:

{
  "data": {
    "status": "succeeded",
    "saved_card": {
      "id": "sc_7Hq2LmX9",
      "customer_id": 123,
      "status": "saved",
      "available": true,
      "brand": "visa",
      "first6": "411111",
      "last4": "1111",
      "exp_month": 12,
      "exp_year": 2030,
      "billing_details": { "name": "Grace Hopper", "country": "US", "postal_code": "94107" },
      "consent": { "type": "business_unscheduled", "accepted_at": "2026-11-25T10:00:00+00:00" },
      "saved_at": "2026-11-25T10:00:02+00:00",
      "last_used_at": null
    }
  }
}

Read the charge's own data.status as for any charge. Then read saved_card:

  • status saved: the card is saved. Keep its id with the customer.
  • null: nothing was saved, usually because the charge was declined (402). The customer can try again with another payment.
  • status saving: we couldn't confirm the card was saved yet, so it can't be charged. This can come with an approved or a declined charge. Our checks settle it by themselves, usually within an hour or two, as saved or failed, and send saved_card.created or saved_card.failed (see Configure and verify webhooks); or read the card again. Meanwhile, saving the same card again for this customer answers 409 card_already_saved and names this card. If a card is still saving after a day, our team is checking it: remove it, or contact ZenythPay support with its id.

If you get no answer, or a 5xx, send the same request again with the same Idempotency-Key and body, as for any charge (see Errors, idempotency, and rate limits). A replay answers saved_card as it stands now.

These refusals come before anything is charged or saved. Each of them, except a 422 with errors, records the key with that body; so does a 404 "Customer not found." when the customer is deleted during the request. For these, the same request, with the same Idempotency-Key and exactly the same body, runs again, for example once the business has turned Saved cards on. If you change anything in the body (another consent type, no save_card, a saved card instead), use a new Idempotency-Key: the old key with a changed body answers 409 "Idempotency-Key was already used with a different request payload." A 422 with errors comes before the key is recorded, so correct the body and send it with the same key.

Answer message What to do
409 saved_cards_unavailable Saved cards is not available for this business. Read the status (see Turn it on). Charge without save_card meanwhile.
409 card_already_saved This customer already has this card saved. The answer's saved_card_id and consent_type name the card already saved. Charge that card, or remove it first to save it under other words. A card is the same when its brand, first 6 and last 4 digits and expiry are the same.
409 saved_cards_limit_reached This customer already has 10 saved cards. Remove one to save another. Remove a card the customer no longer uses. Cards still saving count toward the 10.
422 with errors.save_card Only a new typed card can be saved. Save only a card typed into the card fields, with source new_card.

Other answers are those of every customer charge, listed under that operation in the reference: for example 404 "Customer not found.", 429 with Retry-After, and 502.

{
  "message": "This customer already has this card saved.",
  "error_code": "card_already_saved",
  "saved_card_id": "sc_7Hq2LmX9",
  "consent_type": "business_unscheduled",
  "error": {
    "code": "conflict",
    "message": "This customer already has this card saved.",
    "status": 409,
    "request_id": "00000000-0000-0000-0000-000000000000"
  }
}

Save a card without a charge

When the customer adds a card to their account before they buy anything, save it without charging it. The card is checked with the card network for $0 and saved in the same request, under the customer's agreement (see Ask for the customer's agreement). It needs both customers:write and payments:write, and an Idempotency-Key.

curl 'https://api.zenythpay.com/api/v1/merchant/customers/123/saved-cards' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Idempotency-Key: 6f3e2a10-card-add-123' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "payment_token": "00000000-000000-000000-000000000000",
    "card": { "type": "visa", "first6": "411111", "last4": "1111", "exp_month": 12, "exp_year": 2030 },
    "billing_details": { "name": "Grace Hopper", "country": "US", "postal_code": "94107" },
    "consent": {
      "type": "business_unscheduled",
      "text": "Save this card for future payments. Example Co may charge it for orders you place and for invoices when they fall due, for the amount of each order or invoice. You can remove the card at any time in your account settings."
    }
  }'

Send payment_token and card exactly as the card fields gave them. There is no amount, and installment_number is refused: a check is not a payment of a plan.

Answer What it means What to do
201 with the card, status saved The card is saved. Keep its id with the customer.
202 with the card, status saving The card network's answer wasn't clear. As for a save on a charge (above): it settles by itself as saved or failed.
402 card_declined The customer's bank declined the card. Nothing was saved. Ask them to contact their bank or use another card.
422 card_not_verified The card couldn't be verified. Nothing was saved. Ask the customer to check it or use another.
409 Refused before anything was sent: saved_cards_unavailable, card_already_saved, saved_cards_limit_reached as for a save on a charge, or location_off / app_payments_off when the location can't take payments. As in the table above; for a location, try again once it can take payments.
429 with Retry-After Too many attempts (below). Nothing was written or sent. Wait, then send the same request again with the same Idempotency-Key.
502 The card couldn't be saved, and nothing was kept. Try again in a minute.

The same Idempotency-Key and body answer the card as it is now, with Idempotency-Replayed: true; another body with that key answers 409. After a 402, 422 or 502 nothing was kept, so the same key sends a new check.

Every check counts toward the same per-minute attempt budget as customer charges, and each declined check counts toward the same failed-attempt limit, counted for the business per location and IP address. A saved card doesn't reset that count; declines expire on their own. So many checks, or several declines, in a minute can briefly refuse charges too.

List and read a customer's cards

curl 'https://api.zenythpay.com/api/v1/merchant/customers/123/saved-cards' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Accept: application/json'

The list is newest first, up to 20 cards a page (limit 1 to 20), with cursor as in every list. It leaves out removed and failed cards; read those by their id, with GET /api/v1/merchant/customers/{customer}/saved-cards/{card}. Another customer's card, or an id that doesn't exist, answers 404 "Saved card not found."; an id that isn't sc_ and 8 letters or digits also answers 404.

A card has the fields in the example above:

  • status: saving (not confirmed yet), saved, failed (it couldn't be saved) or removed.
  • available: whether you can charge it now. Only a saved card, while the business has Saved cards on.
  • brand, first6, last4, exp_month and exp_year describe the card. You never get the card number or a token.
  • billing_details: the name, country and postal code saved with the card. null once the card is removed.
  • consent: its type and accepted_at. The words are never returned.
  • saved_at, and last_used_at: the last time it was used for a charge, or null.

Charge a saved card

Name the card, and say who starts the payment:

curl 'https://api.zenythpay.com/api/v1/merchant/customers/123/charges' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: invoice-2041-payment-1' \
  -d '{
    "amount": "25.00",
    "source": "saved_card",
    "saved_card_id": "sc_7Hq2LmX9",
    "initiated_by": "business",
    "order_id": "invoice-2041"
  }'
  • initiated_by is required: customer when the customer is there and starts the payment, business when the business charges without them. Use business only on a card saved under business_unscheduled, business_recurring or business_installment.
  • A business charge of a business_installment card needs installment_number: the number of this payment in the plan, a JSON number from 1 to 99, for example 3 for the third of six. A string such as "3", 0 or 100 answers 422 with errors.installment_number. Send it with no other saved-card charge, including the customer's own charge of that card.
  • billing_details is optional. Without it, only the card is sent with the charge. A field you send is used for this charge, with the card's other saved details, and the card's details as we answer them don't change. Sending them may count as an update of the card, which the business pays $0.08 for, so send them only when they changed.
  • The answer is the same as for any charge: 201 when it succeeds, 402 when it is declined, and the same Idempotency-Key rules and rate limits. A decline doesn't change the card: it stays saved. The transaction's source is payment_method.
  • A card can be charged at any location of the business. With a key for all locations, send location_id, as on every customer charge.
  • No 3-D Secure runs on a saved card's charge.
  • ZenythPay never charges a saved card by itself. Your server decides when, and calls this operation each time.
Answer message What to do
404 Saved card not found. The card isn't this customer's, or doesn't exist.
409 saved_card_unavailable This saved card can't be charged. The card is saving, failed or removed. Read it; ask the customer for another card.
409 saved_cards_unavailable Saved cards is not available for this business. Read the status (see Turn it on).
422 consent_not_given This card was saved for charges with the customer present only. Charge it only with initiated_by customer, when the customer pays.
422 installment_number_required Send installment_number with a business charge of an installment card. Add the payment's number in the plan.
422 installment_number_not_allowed installment_number is sent only with a business charge of an installment card. Leave installment_number out.
422 with errors.saved_card_id or errors.initiated_by The field's message says what is wrong. The field is missing, or saved_card_id isn't sc_ and 8 letters or digits.

Nothing is charged after these answers. As after a refused save, every refusal in this table except a 422 with errors records the key, the 404 "Saved card not found." included: to change the body (another card id, initiated_by or installment_number), use a new Idempotency-Key. A 422 with errors can be corrected and sent with the same key. Other answers are those of every customer charge.

Remove a card

curl -X DELETE 'https://api.zenythpay.com/api/v1/merchant/customers/123/saved-cards/sc_7Hq2LmX9' \
  -H "Authorization: Bearer ${ZENYTH_API_KEY}" \
  -H 'X-ZenythPay-Environment: sandbox' \
  -H 'Accept: application/json'

The answer is the card, with status removed and billing_details null. No new charge can start with it from that moment; a charge of it that had already started may still go through. Its stored copy is queued for deletion. Removing it again answers the same. You can remove cards while the business has Saved cards off. A removed card is never usable again: to use the same card, the customer saves it again on a payment, and it gets a new id.

Remove a card when the customer asks you to. Deleting a customer deletes all of their saved cards (see Payments, checkout, and customers).

Test saved cards in Sandbox

  • A Sandbox business needs no agreement and pays no fees: it reads on, or unavailable while Saved cards isn't offered in Sandbox. It never reads off, so you only get activation_url from a Production business that hasn't turned Saved cards on.
  • Save the test card (see Test in Sandbox under Payment fields) with business_unscheduled, then charge it with initiated_by business and with customer.
  • Try the refusals: save the same card twice for one customer (409 card_already_saved), charge a customer_present card with initiated_by business (422 consent_not_given), and charge a business_installment card with initiated_by business and no installment_number (422 installment_number_required).
  • The same card and amount charged twice within 20 minutes can be refused as a duplicate (422 duplicate_payment), and the card isn't saved then. Sending it again with the same Idempotency-Key answers the same refusal, so vary the amount and use a new key for each test.

Payouts

A payout is one transfer the processor sent to the merchant's bank account. Read them with payouts:read: GET /api/v1/merchant/payouts lists them, newest sent first, and GET /api/v1/merchant/payouts/{id} returns one with the card payments it includes. Nothing creates a payout through the API: the processor sends them.

  • sent_on is the day the transfer was sent and arrives_by the day it usually reaches the bank account by. Neither confirms that the bank received it.
  • A withdrawal is money taken back from the bank account. Its amount is negative and its arrives_by is null.
  • payment_count is how many card payments the processor says the payout includes, or null when it does not say. payments_status says whether they can be listed: complete (all of them are in payments), pending (they are still being matched, and payments is empty for now) or unavailable (they can't be shown for this payout). A list never includes payments; get one payout to read them.
  • breakdown is the lines that add up to the amount, such as sales, refunds and fees. It is null when it can't be shown, so treat a missing breakdown as normal.
  • The payout.sent and payout.withdrawn events carry a reference to the payout and no amounts. Fetch the payout for the figures.
  • With a key for one location you read that location's payouts; with a key for all locations, the whole business's, or one location's when you pass location_id.
  • Sandbox has no payouts, and both operations return 409 to a Sandbox key. To try your webhook handler there, send your endpoint a test event of type payout.sent.

Errors, idempotency, and rate limits

Every response to an API request includes X-Request-Id. To trace a request end to end, send your own X-Request-Id (8 to 128 letters, digits, ., _, : or -); we use it and return it. Errors include a safe public message and a standardized error with code, message, status, and request_id. Validation responses additionally contain errors by field. Preserve the public message when presenting an error to the merchant. Never treat an HTTP success as a payment approval without checking the documented payment status.

error.code names the kind of answer, from its HTTP status: bad_request, authentication_required, payment_declined, forbidden, not_found, method_not_allowed, conflict, gone, validation_failed, idempotency_key_required, rate_limit_exceeded, service_unavailable, or internal_error for anything else. Some refusals also carry a top-level error_code with the exact reason, such as duplicate_payment or location_off: branch on error_code when it is present.

HTTP status Integration action
401 Check the API secret; revoked or malformed keys are rejected.
402 The payment was declined. The response's data holds the declined transaction. A new attempt needs a new token and a new Idempotency-Key.
403 Check resource permissions, environment header, and business availability.
404 Check the merchant-owned resource ID.
409 Resolve the documented state or idempotency conflict before retrying.
422 Correct the fields in errors; do not retry unchanged input. A refusal without errors, such as duplicate_payment, payment_not_charged (our checks found no sale for a payment whose answer was lost: nothing was charged) or payment_refunded (our team found the payment refunded in full at the gateway), says why in message and error_code.
428 Send the required Idempotency-Key header.
429 Honor Retry-After, then retry with backoff and jitter.
5xx or transport failure The outcome may be uncertain. Reuse the original idempotency key where supported and query status before creating another operation.

Money-moving endpoints marked with the required Idempotency-Key header require a stable, unique key for each logical operation: up to 128 printable characters. Retrying the same operation uses the same key and body, and answers with the recorded result. A different body with the same key returns 409. The same body returns 409 while the first attempt is still being settled ("Payment operation is already processing.") or after it could not be settled automatically ("…requires reconciliation."): wait, then check the payment's status; don't start a new one. A key is never reused for another payment and does not expire. Do not reuse a key for a new order.

A replayed charge answers with the charge's recorded outcome as it stands now and Idempotency-Replayed: true: 200 when it is approved, and 402 with the decline message when it is declined. A later correction from the gateway can change that outcome, so a replay is not always the first answer again. A replayed refund or void answers with its original status (201 or 402) and Idempotency-Replayed: true. Customer, invoice, and Payment Link creation do not implement a generic idempotency contract; do not blindly repeat a timed-out creation.

Limits, each answering 429 with Retry-After:

  • 120 requests a minute for all the API keys of one business location together (a key for all locations counts against the business).
  • 300 requests a minute from one IP address, whatever the key. Stores on shared hosting share this one.
  • Charges and customer charges: 30 attempts a minute and 5 declined or failed ones a minute, for each location and IP address, and $25,000 of charges a day for each location, counted by UTC day.
  • Refunds and voids: 5 a minute each, for each business owner and IP address.
  • Payment Links: the e-mail limits described under Payments, checkout, and customers.

All API-key responses use Cache-Control: no-store, private.

Dates in the API are calendar days in UTC: date filters, daily summaries and due dates.

Configure and verify webhooks

A business can have up to 5 webhook endpoints, and a developer account up to 5 in each environment; an endpoint that is off still counts. Each has its own URL, events and signing secret, and can be turned off and on again. Set a business's endpoints on its page at developers.zenythpay.com, and yours as a developer in your developer account: enter a public HTTPS URL on port 443, choose events, and save. Copy the signing secret once. Secrets are encrypted at rest and masked afterward. URLs cannot contain user credentials or fragments, must be at most 2048 characters, and must use a domain name, not an IP address; names such as .local, .test or .internal are refused. Every delivery checks all DNS answers, pins an approved public IP, verifies TLS, and refuses redirects and private or reserved network targets. Use a publicly reachable HTTPS tunnel for local development.

A business's endpoints serve all of its locations: set them on the business. Each event's data.location_id names the location it happened at. With a key for one location, fetching another location's transaction, invoice, Payment Link, payment operation or payout returns 404.

A business's events contain the event ID, type, occurrence time, the business's ID (merchant_id), environment, and resource reference. They do not include customer, payment-card, or bank details. For resources exposed by this reference, fetch the current resource using the appropriate API scope. A deleted resource may return 404; use the verified deletion event to remove its local reference.

{
  "id": "bf674cef-5ea5-49a4-8061-84668e5499cc",
  "type": "customer.created",
  "api_version": "v1",
  "created_at": "2026-09-06T12:00:00+00:00",
  "merchant_id": "42",
  "environment": "sandbox",
  "data": {"resource": "customers", "id": "123", "location_id": "42"}
}
Event data.resource Fetch with Permission
payment.succeeded, payment.failed payment_operations (or transactions when the payment has no operation) GET /api/v1/merchant/payment-operations/{id} (or /transactions/{id}) payments:read (or transactions:read)
transaction.refunded, transaction.voided transactions GET /api/v1/merchant/transactions/{id} transactions:read
invoice.created, invoice.updated, invoice.deleted, invoice.sent, invoice.canceled, invoice.paid invoices GET /api/v1/merchant/invoices/{id} invoices:read
payment_link.created, payment_link.shared, payment_link.updated, payment_link.canceled, payment_link.paid payment_links GET /api/v1/merchant/payment-links/{id} payment_links:read
customer.created, customer.updated, customer.deleted customers GET /api/v1/merchant/customers/{id} customers:read
saved_card.created, saved_card.removed, saved_card.failed saved_cards (the card's sc_ id), with data.customer_id GET /api/v1/merchant/customers/{customer_id}/saved-cards/{id} customers:read
saved_cards.state_changed merchants (to a developer, the merchant's cm_ id) GET /api/v1/merchant/saved-cards customers:read
payout.sent, payout.withdrawn payouts GET /api/v1/merchant/payouts/{id} payouts:read
application.created, application.sent, application.joined, application.submitted, application.more_info_needed, application.approved, application.declined (developers only) applications GET /api/v1/platform/applications/{id} applications:read
merchant.live, connection.revoked (developers only) merchants GET /api/v1/platform/merchants/{id} merchants:read

For hosted checkout, listen for payment_link.paid or invoice.paid, then fetch the link or invoice.

saved_card.created is sent when a card becomes saved: with the charge that saved it, or later when a lost answer from the card network is settled. saved_card.failed is sent when a card that was saving ends failed that way. saved_card.removed is sent when a saved or saving card is removed: by you, or with its customer, and when a save or a check is declined or refused and its saving card is dropped (you may have listed it while the sale or the check was out). When a business is deleted, its cards go with it and no event is sent. saved_cards.state_changed is sent when the business's Saved cards state or available changes, as that endpoint shows them; we check every five minutes, so it can arrive up to about five minutes after the change.

payout.requested is retired: payouts are sent automatically, so nothing requests one. An endpoint saved with it keeps it and can still be saved, but the event is never sent and can't be chosen for a new endpoint.

A developer's endpoints receive the events above for the merchants connected to it, in the environment of the business the event happened at, and the platform's own events: application.created when an application is started; application.sent when its owner is first sent a link; application.joined when the owner joins and the merchant is connected to you; application.submitted, application.more_info_needed, application.approved and application.declined as the application moves through our review; merchant.live when the merchant can take payments in that environment; and connection.revoked when our team turns off your access to the merchant. A developer's event names the connected merchant as merchant (its cm_ id) and the application as application (its app_ id, or null), never the business's merchant_id; data.location_id is present only when the business is set up for locations.

{
  "id": "0b8c5f3e-2a71-4c1d-9e6a-7d4f2b1c8a90",
  "type": "application.approved",
  "api_version": "v1",
  "created_at": "2026-11-12T12:00:00+00:00",
  "environment": "sandbox",
  "merchant": "cm_4kT9xWq2",
  "application": "app_7Hq2Lm9P",
  "data": {"resource": "applications", "id": "app_7Hq2Lm9P"}
}

ZenythPay-Event-Id equals the payload's id. ZenythPay-Signature has the form t=<unix timestamp>,v1=<hex signature>, with one signature by your current signing secret. Verify HMAC-SHA256 of timestamp + "." + raw_body using your signing secret. Verify the exact received bytes before parsing JSON. This Node.js example rejects stale or malformed signatures:

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyWebhook(rawBody, header, signingSecret) {
  if (!Buffer.isBuffer(rawBody) || typeof header !== 'string' ||
      typeof signingSecret !== 'string' || !signingSecret) return false;
  const match = /^t=(\d+),v1=([a-f0-9]{64})$/.exec(header);
  if (!match) return false;
  const timestamp = Number(match[1]);
  if (!Number.isSafeInteger(timestamp) ||
      Math.abs(Math.floor(Date.now() / 1000) - timestamp) > 300) return false;
  const expected = createHmac('sha256', signingSecret)
    .update(match[1] + '.').update(rawBody).digest();
  return timingSafeEqual(expected, Buffer.from(match[2], 'hex'));
}

After verification, validate the expected merchant and environment and atomically deduplicate the payload id in your database. Persist the event before returning 2xx, then process it asynchronously. Delivery is at least once, may arrive out of order, and retries retain the event ID while receiving a fresh signature timestamp. Use the API's current resource state when ordering matters. Any 2xx answer counts as delivered. A failed delivery retries with exponential backoff, up to 12 attempts within 24 hours. We wait up to 3 seconds to connect and 10 seconds for your answer, and an answer body over 64 KB counts as a failure. Requests come with the User-Agent ZenythPay-Webhooks/1.0. Each endpoint's delivery log shows its deliveries of the last 30 days, in the dashboard or your developer account.

To catch up on events you missed, list them: a business's with GET /api/v1/merchant/events and its own key, and yours as a developer with GET /api/v1/platform/events and your platform key, each with events:read. Each lists the events of the last 30 days, newest first, exactly as they were sent; test events are never listed. Read every page: follow next_cursor across every page, including empty ones, until has_more is false, and keep the first page's pagination.checkpoint. Your list as a developer leaves out events about a merchant or application you may no longer see, so a page may hold fewer events than limit, even none, while has_more is true. Next time, list with since set to that checkpoint: you get every event published after it, including events whose delivery failed, arrived out of order or were recorded late, and a new checkpoint to keep. If since answers 422, list again without it, every page, and keep the new checkpoint.

You can send any delivery from the last 30 days to its endpoint again: the replay carries the same event id and is signed by the endpoint's current secret. You can also send an endpoint a test event of any type it can receive: it looks like a real event, names no real record, and ends with "test": true. In the dashboard, Send test webhook sends webhook.test with data: null to a business's main webhook.

Changing an endpoint's URL or events, or turning it off, cancels deliveries still waiting under the previous settings. Rotating an endpoint's signing secret gives you a new secret, shown once. A rotation takes effect at once: every delivery after it is signed by the new secret, and it cancels deliveries still waiting, which you get back from the events list or by replaying them. In-flight deliveries may finish. Coordinate receiver changes before rotating and reconcile resource state afterward. Webhook settings are independent for Sandbox and Production.

For a developer's endpoints, we check that you may still receive an event immediately before every attempt, after the address is resolved and with nothing else between that check and the request, and again before every replay and in your delivery log. Once our team turns a connection off, or turns your developer account off, no new attempt starts: at most the one attempt already past its check completes, within the 3-second connect and 10-second answer limits. A turned-off connection still sends its own connection.revoked. A replay of an event you may no longer receive answers 409, and your delivery log leaves it out, so a page may hold fewer deliveries than asked, even none, while has_more is true: follow next_cursor until has_more is false.

Sandbox tests and going live

Use only approved processor test payment data in your Sandbox business. Enter test payment values only in the tokenizing payment frontend; send its resulting token to ZenythPay. Never switch a live integration into testing by changing a request body flag: use the dedicated Sandbox merchant, Sandbox credential, and Sandbox environment header.

Before going live, verify successful and declined payments, double-submit retries, timeouts, partial and full refunds where eligible, voids, saving, charging and removing a saved card if you use them, expired checkout links, validation errors, webhook signatures, duplicate events, retry delivery, credential rotation, and revocation. Confirm that your database records the correct merchant and environment for every resource.

Complete Production business approval and service activation in the dashboard, generate a separate least-privilege Production credential, configure a separate Production webhook and signing secret, and change the environment header to production. Confirm your own background jobs, webhook delivery, and a controlled live transaction before normal traffic. Keep Sandbox and Production secrets in separate secret-manager entries.

ZenythPay for WooCommerce

ZenythPay for WooCommerce takes card and US bank account (ACH) payments on a WooCommerce checkout through this API. Card and bank details are entered in secure fields hosted by the payment gateway and never touch the store's server; the store sends ZenythPay only the resulting payment token.

Download ZenythPay for WooCommerce 1.0.0 (zip, SHA-256 dbd6d4c14c23059438a38d06ed5cdbd755510468f70b7cda98ef1c62351c2260).

  • Card and ACH payments in the classic checkout and the Checkout block
  • Full and partial refunds from the WooCommerce order screen
  • Automatic void when an unsettled order is cancelled
  • Payments whose result was interrupted (a timeout, a lost connection) are verified automatically and never charged twice
  • Optional signed webhooks keep orders in sync with ZenythPay, including refunds and voids made in the ZenythPay dashboard
  • Compatible with WooCommerce High-Performance Order Storage (HPOS)

This version of the plugin doesn't save cards or take subscriptions. To save cards in your own integration, see Saved cards above.

Requirements

  • WordPress 6.0 or later
  • WooCommerce 8.2 or later
  • PHP 7.4 or later
  • A ZenythPay business: Sandbox to test, an active Production business to take live payments
  • HTTPS on the store. ZenythPay delivers webhooks only to public HTTPS URLs

Install the plugin

  1. Download the plugin zip above.
  2. In WordPress, open Plugins → Add New Plugin → Upload Plugin, choose zenythpay-for-woocommerce-1.0.0.zip, and click Install Now.
  3. Click Activate Plugin. WooCommerce must already be installed and active.

To update, upload the newer zip the same way and confirm replacing the installed version. Settings are kept.

Create an API key

Sign in at developers.zenythpay.com as the business owner, open the business the store will charge under Your businesses, and create an API credential with exactly these permissions. If the business has several locations, make the key for the store's location, not All locations: the plugin doesn't name a location, so with a key for all locations every checkout payment is refused.

Resource Permission Used for
Payments and checkout Read & Write Loading the checkout's tokenization key, charging orders, verifying interrupted payments
Refunds Write Refunds from the order screen
Voids Write Voiding a cancelled, unsettled order
Transactions and receipts Read Reading refunds and voids reported by webhooks

Copy the secret when it is shown; it is not shown again. Sandbox keys start with zp_sandbox_ and Production keys with zp_production_. The plugin chooses the environment from the key, so no other environment setting exists.

Configure card payments

  1. In WordPress, open WooCommerce → Settings → Payments → ZenythPay – Card.
  2. Tick Enable ZenythPay – Card. Optionally change the Title and Description customers see at checkout.
  3. Paste the API key and click Save changes.

Saving checks the connection and reports the result at the top of the screen:

Message What to do
Connected to ZenythPay. The key works and the business can take card payments. Check that the key has all four permissions above, and place a test order.
ZenythPay rejected the API key. Paste the complete key again, or generate a new one if it was revoked.
The API key is missing a permission, or the business is not active. Regenerate the key with the permissions above, or finish business approval in the dashboard.
Connected, but this ZenythPay business has no tokenization key yet. Finish gateway setup for the business in the dashboard. Checkout hides ZenythPay until it is done.
ZenythPay could not be reached. Check the store's outbound network access and the API base URL, then save again.

Leave API base URL (advanced) empty: the plugin then uses https://api.zenythpay.com. Debug log writes each API request and its outcome under WooCommerce → Status → Logs with source zenythpay. The API key and payment token are redacted, but customer billing details are included, so turn it off when you are done troubleshooting.

Configure ACH payments

Open WooCommerce → Settings → Payments → ZenythPay – ACH, tick Enable, optionally change the title and description, and save. ACH uses the API key and webhook secret saved on the card method.

A Production business must first accept the ACH service fees in the dashboard and have ACH activation confirmed. A Sandbox business can take ACH payments without that step.

Keep orders in sync with webhooks

Webhooks are optional but recommended: they update orders when a payment, refund or void changes outside the store, for example a refund made in the ZenythPay dashboard.

  1. On the business's page at developers.zenythpay.com, add a webhook with the URL shown in the plugin's Webhook signing secret field description. It has the form https://your-store.example/?wc-api=zenythpay_webhook.
  2. Select the events payment.succeeded, payment.failed, transaction.refunded and transaction.voided, and save.
  3. Copy the signing secret, paste it into Webhook signing secret in ZenythPay – Card, and save.
  4. Use Send test webhook in the dashboard to confirm delivery.

The plugin verifies every signature, rejects events for the other environment, ignores duplicates, and reads the current payment or transaction from the API instead of trusting the event body. A refund made in the dashboard is recorded on the order as a WooCommerce refund for the amount WooCommerce is missing, without moving money again, and a fully refunded order becomes Refunded; stock is not restocked automatically. A void made in the dashboard cancels the order. If ZenythPay later corrects a payment's outcome, the order follows it: a payment first reported as declined and then approved is marked paid, and one approved and then reported as declined is put On hold with a note for you to check, never cancelled automatically. Webhooks are configured separately for Sandbox and Production.

Test and go live

  1. Configure the store with a Sandbox key and the Sandbox webhook.
  2. Place test orders with approved processor test card and bank data: a successful payment, a decline, a full and a partial refund, and a cancelled order (void).
  3. When the Production business is approved, generate a Production key with the same permissions and a Production webhook, replace both values in the plugin, and save. Confirm the Connected to ZenythPay. message and a controlled live order before normal traffic.

If an order is On hold with a note that the payment is being verified, ZenythPay did not answer in time. The plugin checks the payment again automatically over the next 24 hours and marks the order paid or failed. Do not ship the order until it is marked paid.

Transactions

Read transaction records, summaries, and payment receipts for the current merchant.

List merchant transactions

Lists transactions for an accessible merchant using newest-first cursor pagination for infinite loading. The optional term searches full or partial customer first_name, customer last_name, customer email, including one- and two-character customer terms, card first6, card last4, and YYYY-MM-DD transaction dates. Optional from and to filters apply an inclusive transaction creation-date range, in calendar days in UTC; date is refused (422), so use them instead. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires transactions:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of transactions to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

term
string <= 255 characters

Optional search term matched against full or partial customer first_name, customer last_name, customer email, including one- and two-character customer terms, card first6, card last4, or transaction date when the term is YYYY-MM-DD.

from
string <date>

Optional first day of the creation-date range, inclusive; a calendar day in UTC (YYYY-MM-DD).

to
string <date>

Optional last day of the creation-date range, inclusive; a calendar day in UTC (YYYY-MM-DD). Must be on or after from when from is supplied.

type
string
Enum: "sale" "refund" "void"

Optional exact transaction type filter. Combined with the other filters before pagination; empty values are ignored.

status
string
Enum: "succeeded" "declined"

Optional exact transaction status filter. Combined with the other filters before pagination; empty values are ignored.

source
string
Enum: "new_card" "new_ach" "payment_method" "tap_to_pay"

Optional exact transaction source filter. Combined with the other filters before pagination; empty values are ignored.

payment_type
string
Enum: "card" "ach"

Optional exact transaction payment type filter. Combined with the other filters before pagination; empty values are ignored.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get merchant transaction

Returns one transaction for an accessible merchant, including related customer, saved payment method display details, and decrypted billing details when present. Billing details are disclosed only on this authorized detail route and the response is not cacheable. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires transactions:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
transaction
required
integer

Transaction id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get merchant transaction summary

Returns all-time or exact-date transaction summary totals for an accessible merchant. Volume and count are net successful sale totals after successful refund and void transactions are deducted. Sale, refund, and void totals are returned separately, and success_rate is the successful sale authorization percentage before refunds and voids. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires transactions:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

date
string <date>

Optional day to total; a calendar day in UTC (YYYY-MM-DD). Omit for all time.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get daily merchant transaction summary

Returns daily graph buckets, each a calendar day in UTC, for successful payments, successful refunds, successful voids, and sale authorization success rate. When both from and to are provided, the response includes zero-filled days for the inclusive range. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires transactions:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

from
string <date>

Optional first day, inclusive; a calendar day in UTC (YYYY-MM-DD). Must be on or after 2000-01-01.

to
string <date>

Optional last day, inclusive; a calendar day in UTC (YYYY-MM-DD). Must be on or after 2000-01-01 and on or after from when from is supplied. When both from and to are supplied, the range can be at most 366 days, counting both ends; a longer range returns 422.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Charges

Create tokenized payments, read the payment keys and billing field requirements, and inspect payment operations.

Get the billing fields the merchant's processor requires

Returns which billing fields must be collected for a card charge on this merchant to be accepted, so a payment form can mark inputs required or optional instead of hardcoding them. Keys mirror the POST /api/v1/merchant/charges request body: read fields.billing_details.city for the input sent as billing_details.city. A field is true when it must be sent. The answer is the union of what the merchant's attached card processor requires and what this API's own charge validation requires, so billing_details.name, billing_details.country and billing_details.postal_code are always true — omitting them is a 422 from this API regardless of the processor. billing_details.address_line_2 is not described because no processor requirement exists for a second address line; treat it as always optional. Fields absent from fields are not gated. Authorization matches the charge endpoint. source is processor when the merchant's own card processor answered, and fallback when that could not be established — no gateway yet, no card processor attached, an attached processor that does not identify itself as a card processor, or a processor that could not be read — in which case every described field is reported as required so the form over-collects rather than being declined. Answers are cached briefly per gateway, so a processor change can take up to a few minutes to appear. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:read.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get the merchant's tokenization key

Returns the public tokenization key for this merchant's gateway, so a payment form can tokenize card or ACH details in the payer's browser and send the resulting one-time token to POST /api/v1/merchant/charges. Use this key only for tokenization; never place the API credential in browser code. The key only produces tokens; it cannot charge, refund, or read anything. It is null until the merchant's gateway provisioning has created it, in which case no payment form can tokenize yet. Authorization matches the charge endpoint. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:read.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get the merchant's publishable key

Returns the public key that shows this merchant's card fields in a checkout page. The key can only show the card fields; it cannot charge, refund, or read anything, so it is safe to place in a web page. Never place the API credential in browser code. The first read creates the key, and later reads return the same key until the merchant replaces it in the dashboard. While the merchant can't take card payments (suspended, or not yet active), this call answers 403, like every Developer API call. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:read.

Authorizations:
PartnerApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create a card, digital wallet, or ACH charge

Charges a merchant with a tokenized typed card, Apple Pay, Google Pay, or ACH payment method. Card and wallet payments require billing_details.name, billing_details.country, and billing_details.postal_code; ACH accepts optional account_name and billing details. When email is omitted, the transaction is recorded as an anonymous guest charge and no customer or payment method is saved. When email is provided, the charge is associated to the existing merchant customer with that email or a new email-only customer is created. The payment method is charged and not stored. This operation saves no card, and save_card answers 422 "A card can be saved only on a customer's charge." (save a card with save_card on POST /api/v1/merchant/customers/{customer}/charges). Submitted billing names fill only null customer name fields; otherwise, the API queries the exact approved transaction and fills only null values. Existing non-null customer names are not overwritten, and unavailable or mismatched query enrichment does not change the completed payment outcome. Billing details are encrypted at rest and omitted from this charge response; authorized users may retrieve them from the no-store transaction-detail response. If you get no answer, or a 502, send the same request again with the same Idempotency-Key and body; the Idempotency-Key header lists every answer a retry can get. A replayed charge answers with its recorded outcome as it stands now (a later correction from the gateway can change it), 200 with the transaction when it is approved and 402 with the decline message and the transaction when it is declined. ACH is available to a sandbox merchant with no acceptance, and to a live merchant only after they accept its service fees and activation is confirmed; the merchant turns ACH on in the dashboard, and until then submitting ach returns 422 and reaches no gateway. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:write.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
Idempotency-Key
required
string [ 1 .. 128 ] characters ^[ -~]+$

A key you choose for one payment, so that the request can be retried safely. To retry, send the same key with the same body. A payment that was approved or declined answers with its recorded result again, marked Idempotency-Replayed: true; an attempt refused before it was sent (for example with 429) runs again. The same key with a different body answers 409 "Idempotency-Key was already used with a different request payload." The same key and body can also answer 409 "Payment operation is already processing." while the first attempt is unresolved: wait, then check the payment's status. It can answer 409 "Payment operation failed before a local transaction was recorded and requires reconciliation." when the result could not be settled automatically: check the payment's status and don't start a new one. And a charge refused as a duplicate (nothing was charged) answers 422 with error_code duplicate_payment again; a saved-card charge or save that our checks settled as not charged (the gateway listed no sale) answers 422 with error_code payment_not_charged, and one our team found refunded in full at the gateway answers 422 with error_code payment_refunded. A key is kept for good, separately for each location and each kind of request (a charge, a refund and a void are each their own), so never reuse one for another payment: use a new key for each new payment. Without the header the request answers 428; a key longer than 128 characters or with characters outside printable ASCII answers 422.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
One of
payment_type
required
string
Enum: "card" "ach"
object (WalletDetailsInput)

Safe display metadata returned by the same wallet tokenization as payment_token. BIN, expiry, raw wallet payloads, shipping details, and wallet-provided email are prohibited.

object (NewAchDisplayData)
account_name
string [ 1 .. 150 ] characters

Optional ACH account-holder name. Accepted only when payment_type is ach; otherwise prohibited.

location_id
integer

Developer API, keys for all locations only. Required with such a key, and must be the business or one of its locations; the payment is created there. Any other key always acts at its own location, and location_id is refused (422) with it at a business set up for locations, and ignored at a business without them. An Idempotency-Key is checked per location, so reusing one at another location creates a separate payment.

amount
required
string^(?!0+(?:\.0{1,2})?$)\d{1,10}(?:\.\d{1,2})?$

Decimal amount in major currency units. Up to two decimal places.

currency
string or null = 3 characters ^[A-Z]{3}$
Default: "USD"

ISO currency code. Omit or send null to use the configured default currency.

payment_token
required
string <= 255 characters

One-time token generated by the payment frontend. Put payer identity in billing_details, not top-level payment name fields. Raw card and bank-account fields are never accepted.

email
string or null <email> <= 255 characters

Optional customer email. Omit for an anonymous guest charge.

required
object (NewCardDisplayData)

Pass the card object from the payment fields' createToken result unchanged. It is shown on receipts and lists, and is not checked against the token.

required
object (BillingDetailsInput)

Required when payment_type is card; optional for ACH payments.

order_id
string or null <= 64 characters
description
string or null <= 255 characters

Responses

Request samples

Content type
application/json
Example
{
  • "amount": "10.00",
  • "payment_type": "card",
  • "payment_token": "00000000-000000-000000-000000000000",
  • "billing_details": {
    },
  • "card": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Charge a customer

Charges a merchant-owned customer using a new tokenized typed card, Apple Pay, Google Pay, or ACH payment method, or a payment method saved before ZenythPay retired its gateway customer vault. New card and wallet payments require billing_details.name, billing_details.country, and billing_details.postal_code; new ACH accepts optional account_name and billing details; saved methods may send partial billing details that merge over the encrypted method snapshot. A new typed card sent with save_card is charged and saved for the customer in the same sale, and the response adds saved_card (see save_card). source saved_card charges a card saved that way, by the customer or the business (see initiated_by). A business charge of a card saved for recurring or installment payments is sent as one; an installment carries installment_number. Otherwise new payment methods are charged directly and are not stored — no card or payment method is saved, and payment_method and payment_method_id are null on the response. Saved-method charges remain available for methods stored before the vault was retired, and use the customer's vault id, selected method billing id, and merchant-initiated flags; no new saved method can be created. Billing details are encrypted at rest and omitted from this charge response (a card saved with save_card returns its name, country and postal code in saved_card.billing_details); authorized users may retrieve them from the no-store transaction-detail response, and from the saved-payment-method response for methods stored before the vault was retired. If you get no answer, or a 502, send the same request again with the same Idempotency-Key and body; the Idempotency-Key header lists every answer a retry can get. A replayed charge answers with its recorded outcome as it stands now (a later correction from the gateway can change it), 200 with the transaction when it is approved and 402 with the decline message and the transaction when it is declined. ACH is available to a sandbox merchant with no acceptance, and to a live merchant only after they accept its service fees and activation is confirmed; the merchant turns ACH on in the dashboard, and until then submitting ach returns 422 and reaches no gateway. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
Idempotency-Key
required
string [ 1 .. 128 ] characters ^[ -~]+$

A key you choose for one payment, so that the request can be retried safely. To retry, send the same key with the same body. A payment that was approved or declined answers with its recorded result again, marked Idempotency-Replayed: true; an attempt refused before it was sent (for example with 429) runs again. The same key with a different body answers 409 "Idempotency-Key was already used with a different request payload." The same key and body can also answer 409 "Payment operation is already processing." while the first attempt is unresolved: wait, then check the payment's status. It can answer 409 "Payment operation failed before a local transaction was recorded and requires reconciliation." when the result could not be settled automatically: check the payment's status and don't start a new one. And a charge refused as a duplicate (nothing was charged) answers 422 with error_code duplicate_payment again; a saved-card charge or save that our checks settled as not charged (the gateway listed no sale) answers 422 with error_code payment_not_charged, and one our team found refunded in full at the gateway answers 422 with error_code payment_refunded. A key is kept for good, separately for each location and each kind of request (a charge, a refund and a void are each their own), so never reuse one for another payment: use a new key for each new payment. Without the header the request answers 428; a key longer than 128 characters or with characters outside printable ASCII answers 422.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
One of
source
required
string
Enum: "new_card" "new_ach" "payment_method" "saved_card"

saved_card (Developer API only; the dashboard answers 422) charges a customer's saved card, named by saved_card_id; the transaction is recorded with source payment_method.

object (WalletDetailsInput)

Safe display metadata returned by the same wallet tokenization as payment_token. BIN, expiry, raw wallet payloads, shipping details, and wallet-provided email are prohibited.

object (NewAchDisplayData)
account_name
string [ 1 .. 150 ] characters

Optional ACH account-holder name. Accepted only when source is new_ach; otherwise prohibited.

payment_method_id
integer >= 1

Saved local payment method id. Required when source is payment_method.

object

Developer API only, with source new_card and a typed card: save this card for the customer in the same sale, under the consent given here. The dashboard, a wallet or another source answers 422 with errors.save_card. Refused with nothing charged: 409 error_code saved_cards_unavailable (Saved cards is not available for the business), card_already_saved (with saved_card_id and consent_type of the card already saved) or saved_cards_limit_reached (the customer has 10 saved cards). A business_installment save needs installment_number, the number of this payment in the plan. An approved charge answers saved_card with status saved; a declined or refused one usually answers saved_card null, and the card is not saved (where the gateway may still have kept it, it is deleted there too); an answer from the gateway that is not clear, a declined one among them, answers saved_card with status saving until our checks of the gateway settle it as saved or failed. A payment the gateway still shows nothing for after a wait (currently 30 minutes) is taken as not charged, and the same Idempotency-Key then answers 422 payment_not_charged once the saved card is settled too; until then it answers 409, while a read of the payment may already show it failed; a charge of a saved card whose answer was lost is settled the same way.

location_id
integer

Developer API, keys for all locations only. Required with such a key, and must be the business or one of its locations; the payment is created there. Any other key always acts at its own location, and location_id is refused (422) with it at a business set up for locations, and ignored at a business without them. An Idempotency-Key is checked per location, so reusing one at another location creates a separate payment.

amount
required
string^(?!0+(?:\.0{1,2})?$)\d{1,10}(?:\.\d{1,2})?$

Decimal amount in major currency units. Up to two decimal places.

currency
string or null = 3 characters ^[A-Z]{3}$
Default: "USD"

ISO currency code. Omit or send null to use the configured default currency.

saved_card_id
string^sc_[0-9A-Za-z]{8}$

The customer's saved card to charge. Required when source is saved_card. Another customer's card or an unknown id answers 404 "Saved card not found."; a card that is removed, still being saved, or failed answers 409 saved_card_unavailable; while Saved cards is not available for the business, 409 saved_cards_unavailable. A card saved once can be charged at any of the business's locations, through that location's card processor. billing_details sent with the charge go to the gateway; without them, nothing more than the card is sent, and the details saved with the card stay with the gateway.

initiated_by
string
Enum: "customer" "business"

Required when source is saved_card: customer when the customer is present and starts the payment, business when the business charges without them. business on a card saved under customer_present consent answers 422 consent_not_given. No 3-D Secure runs on a saved-card charge. A business charge of a card saved under business_recurring or business_installment is sent to the gateway as a recurring or installment payment.

installment_number
integer [ 1 .. 99 ]

The number of this payment in an installment plan, for example 3 for the third of six. Required with a save_card whose consent is business_installment (the saving sale is a payment of the plan) and with a business charge of a card saved under business_installment (422 installment_number_required); refused anywhere else (422).

payment_token
required
string <= 255 characters

One-time payment token. Required when source is new_card or new_ach.

required
object (NewCardDisplayData)

Pass the card object from the payment fields' createToken result unchanged. It is shown on receipts and lists, and is not checked against the token.

required
object (BillingDetailsInput)

Required when source is new_card; optional for new_ach, payment_method and saved_card, where supplied values merge over the saved encrypted billing snapshot.

order_id
string or null <= 64 characters
description
string or null <= 255 characters

Responses

Request samples

Content type
application/json
Example
{
  • "amount": "10.00",
  • "source": "new_card",
  • "payment_token": "00000000-000000-000000-000000000000",
  • "billing_details": {
    },
  • "card": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

List merchant payment operations

Lists this business's payment operations using newest-first cursor pagination for infinite loading. The optional term searches operation metadata (your order_id included), card display fields, gateway identifiers, customer names/email, invoice recipient names/email, exact amount, numeric ids, and YYYY-MM-DD operation dates. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of payment operations to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

term
string <= 255 characters

Optional search term matched against operation metadata, customer or invoice recipient names/email, exact amount, numeric ids, or operation date when the term is YYYY-MM-DD.

date
string <date>

Optional creation day; a calendar day in UTC (YYYY-MM-DD).

operation_type
string
Enum: "merchant_charge" "tap_to_pay_payment" "customer_charge" "invoice_payment" "refund" "void"

Optional operation type filter.

status
string
Enum: "pending" "gateway_confirmed" "succeeded" "declined" "failed" "reconciliation_failed" "held"

Optional local operation status filter.

source
string
Enum: "new_card" "new_ach" "payment_method" "tap_to_pay"

Optional payment source filter.

payment_type
string
Enum: "card" "ach"

Optional payment method type filter.

customer_id
integer >= 1

Optional local customer id filter.

invoice_id
integer >= 1

Optional local invoice id filter.

transaction_id
integer >= 1

Optional resulting local transaction id filter.

subject_transaction_id
integer >= 1

Optional subject local transaction id filter for refund and void operations.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get merchant payment operation

Returns one payment operation of this business. Operations outside the credential-bound merchant are hidden with a 404 response. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payments:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
paymentOperation
required
integer

Payment operation id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Voids

Void eligible transactions using the dedicated void permission and idempotency key.

Void a merchant transaction

Creates a local void transaction linked to the original sale and sends the void to the gateway. Unresolved refunds or voids block another void with 409 until their outcome is definitive. If you get no answer, or a 502, send the same request again with the same Idempotency-Key and body. A finished void answers its original 201 or 402 again, with Idempotency-Replayed set; the Idempotency-Key header lists every other answer a retry can get. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires voids:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
transaction
required
integer

Id of an approved sale of this business.

header Parameters
Idempotency-Key
required
string [ 1 .. 128 ] characters ^[ -~]+$

A key you choose for one payment, so that the request can be retried safely. To retry, send the same key with the same body. A payment that was approved or declined answers with its recorded result again, marked Idempotency-Replayed: true; an attempt refused before it was sent (for example with 429) runs again. The same key with a different body answers 409 "Idempotency-Key was already used with a different request payload." The same key and body can also answer 409 "Payment operation is already processing." while the first attempt is unresolved: wait, then check the payment's status. It can answer 409 "Payment operation failed before a local transaction was recorded and requires reconciliation." when the result could not be settled automatically: check the payment's status and don't start a new one. And a charge refused as a duplicate (nothing was charged) answers 422 with error_code duplicate_payment again; a saved-card charge or save that our checks settled as not charged (the gateway listed no sale) answers 422 with error_code payment_not_charged, and one our team found refunded in full at the gateway answers 422 with error_code payment_refunded. A key is kept for good, separately for each location and each kind of request (a charge, a refund and a void are each their own), so never reuse one for another payment: use a new key for each new payment. Without the header the request answers 428; a key longer than 128 characters or with characters outside printable ASCII answers 422.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
optional
description
string or null <= 255 characters

Local void note stored on the void transaction.

Responses

Request samples

Content type
application/json
{
  • "description": "Customer canceled before settlement"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Refunds

Refund eligible transactions using the dedicated refund permission and idempotency key.

Refund a merchant transaction

Creates a local refund transaction linked to the original sale and sends the refund to the gateway. Omitting amount refunds the remaining local transaction amount. Unresolved refunds reserve their amounts until completion or definitive rejection; an unresolved void blocks refunds with 409. If you get no answer, or a 502, send the same request again with the same Idempotency-Key and body. A finished refund answers its original 201 or 402 again, with Idempotency-Replayed set; the Idempotency-Key header lists every other answer a retry can get. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires refunds:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
transaction
required
integer

Id of an approved sale of this business.

header Parameters
Idempotency-Key
required
string [ 1 .. 128 ] characters ^[ -~]+$

A key you choose for one payment, so that the request can be retried safely. To retry, send the same key with the same body. A payment that was approved or declined answers with its recorded result again, marked Idempotency-Replayed: true; an attempt refused before it was sent (for example with 429) runs again. The same key with a different body answers 409 "Idempotency-Key was already used with a different request payload." The same key and body can also answer 409 "Payment operation is already processing." while the first attempt is unresolved: wait, then check the payment's status. It can answer 409 "Payment operation failed before a local transaction was recorded and requires reconciliation." when the result could not be settled automatically: check the payment's status and don't start a new one. And a charge refused as a duplicate (nothing was charged) answers 422 with error_code duplicate_payment again; a saved-card charge or save that our checks settled as not charged (the gateway listed no sale) answers 422 with error_code payment_not_charged, and one our team found refunded in full at the gateway answers 422 with error_code payment_refunded. A key is kept for good, separately for each location and each kind of request (a charge, a refund and a void are each their own), so never reuse one for another payment: use a new key for each new payment. Without the header the request answers 428; a key longer than 128 characters or with characters outside printable ASCII answers 422.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
optional
amount
string^(?!0+(?:\.0{1,2})?$)\d{1,10}(?:\.\d{1,2})?$

Optional decimal amount in major currency units. Omit to refund the remaining local transaction amount.

order_id
string or null <= 64 characters

Optional refund order id, stored on the refund and sent to the gateway as its order id.

description
string or null <= 255 characters

Local refund note stored on the refund transaction.

Responses

Request samples

Content type
application/json
{
  • "amount": "5.00",
  • "order_id": "REF-1001",
  • "description": "Customer return"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Customers

Manage current-merchant customers and read their masked saved payment methods.

List customers

Lists this business's customers, oldest first, using cursor pagination for infinite loading. Customers belong to the whole business, across its locations. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of customers to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

term
string <= 255 characters

Optional search term matched against first_name, last_name, and email.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Create a customer

Creates a customer of this business, shared by all its locations. Customer email addresses are unique within the business. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:write.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
first_name
required
string [ 1 .. 100 ] characters
last_name
required
string [ 1 .. 100 ] characters
email
required
string <email> <= 255 characters

Unique within the merchant.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get a customer

Returns one customer of this business. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update a customer

Updates a customer's first name, last name, or email. Customer email addresses are unique within the business. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
Any of
first_name
required
string [ 1 .. 100 ] characters
last_name
string [ 1 .. 100 ] characters
email
string <email> <= 255 characters

Unique within the merchant.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete a customer

Deletes a customer and its saved payment methods. Its payments, refunds and voids are kept and no longer name a customer (their customer_id becomes null); their receipts are kept as issued. If a payer saved cards with this business under the customer's current email, the deletion also removes those cards, queues their deletion at the payment gateway, and closes the payer's saved-cards account, erasing the email, name, phone and address kept on it. And every card saved for the customer through the Developer API is deleted too, removed ones and their consent records included, and each one that may still be stored at the payment gateway is queued for deletion there. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "message": "Unauthenticated.",
  • "error": {
    }
}

Get merchant customer summary

Returns the overall customer count and cursor-paginated per-customer successful sale transaction count and net charged amount, oldest customer first. Net customer amount is successful sale volume minus successful refunds and voids. Customers, and count, cover the whole business; with a key made for one location, each customer's sale count and net amount cover only that location's transactions. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of customer summary rows to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    },
  • "pagination": {
    }
}

List saved customer payment methods

Lists locally saved payment method display records and available billing details for a merchant-owned customer. Billing details are decrypted only for this authorized response. Card PAN, CVV, payment tokens, and internal billing provenance are never returned. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get the Saved cards status

Whether the business can save and charge customers' cards. state is unavailable (not offered to this business), off, pending (being switched on), on or turning_off; available says whether cards can be saved and charged now. While state is off, activation_url is the link the business owner opens, signed in to ZenythPay, to accept the Saved cards fees and switch it on; no API call can accept for them. paused_reason is three_ds_required, and available false, while state is on or pending, Saved cards is open to live businesses, and the business requires 3-D Secure, which saved cards don't support yet. It is null otherwise, including while Saved cards is paused for every business. A location answers its business's status. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{}

List a customer's saved cards

Lists a customer's saved cards, newest first, 20 a page. Removed and failed cards are left out; read one by its id. Cards stay listed while the business has Saved cards off, with available false. Never the card number, a token or the consent words. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

query Parameters
limit
integer [ 1 .. 20 ]
Default: 20
cursor
string <= 2048 characters

The previous page's pagination.next_cursor.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Save a customer's card without charging it

Developer API only. Verifies the customer's card with no charge and saves it in the same request, under the consent given here. Refused with nothing sent, as a charge's save_card: 409 saved_cards_unavailable, card_already_saved (with saved_card_id and consent_type) or saved_cards_limit_reached; 409 location_off when the key's location can't take payments right now, or app_payments_off when the business takes card-terminal payments only or is moving to another processor; 404 "Customer not found.". installment_number is refused: a check is not a payment of a plan. Answers 201 with the saved card; 402 card_declined when the card is declined; 422 card_not_verified when the card can't be used; 502 when it couldn't be saved and nothing was kept (try again); 202 with the card saving when the answer from the card network is not clear, until our checks settle it as saved or failed. Every check counts toward the per-minute attempt budget it shares with customer charges (per business owner, acting location and IP); only declines count toward the failed-attempt limit, they expire on their own, and a saved card doesn't clear them. Over either, 429 with Retry-After: nothing is written or sent and the Idempotency-Key stays unspent. The same Idempotency-Key and body answer the card as it is now (Idempotency-Replayed: true), even if the location was switched off since: 200 with the card, saving while the first request is still waiting for its answer; with another body it is 409. After a 402, 422 or 502 nothing was kept, so the same key sends a new check. Requires customers:write and payments:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

header Parameters
Idempotency-Key
required
string <= 128 characters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
payment_token
required
string <= 255 characters

One-time payment token of the typed card.

required
object (NewCardDisplayData)

Pass the card object from the payment fields' createToken result unchanged. It is shown on receipts and lists, and is not checked against the token.

required
object (BillingDetailsInput)

Optional payer billing data. Card payment branches make name, country, and postal_code required. Values are encrypted at rest, omitted from payment mutation and collection responses, and returned only to authorized users through the no-store transaction-detail and saved-payment-method endpoints.

required
object

Responses

Request samples

Content type
application/json
{
  • "payment_token": "00000000-000000-000000-000000000000",
  • "card": {
    },
  • "billing_details": {
    },
  • "consent": {
    }
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get a customer's saved card

Reads one of a customer's saved cards, removed ones included (status: removed). available is true only for a saved card while the business has Saved cards on. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

card
required
string^sc_[0-9A-Za-z]{8}$

The saved card's id.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Remove a customer's saved card

Removes a customer's saved card: no new charge can start with it, a charge of it that had already started may still go through, and its stored record is queued for deletion. The answer is the card, status: removed. Removing a removed card answers the same. Works whether or not the business has Saved cards on. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires customers:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
customer
required
integer

Customer id that belongs to this business.

card
required
string^sc_[0-9A-Za-z]{8}$

The saved card's id.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Invoices

Create, read, update, send, cancel, and delete current-merchant invoices.

List merchant invoices

Lists invoices for an accessible merchant using newest-first cursor pagination for infinite loading. The optional term searches description, recipient email, status, customer first_name, customer last_name, customer email, and due date when the term is YYYY-MM-DD. Optional from and to filters apply an inclusive due-date range; date is refused (422), so use them instead. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of invoices to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

term
string <= 255 characters

Optional search term matched against description, recipient email, status, customer first_name, customer last_name, customer email, or due date when the term is YYYY-MM-DD.

from
string <date>

Optional inclusive invoice due-date range start in YYYY-MM-DD format.

to
string <date>

Optional inclusive invoice due-date range end in YYYY-MM-DD format. Must be on or after from when from is supplied.

status
string
Enum: "draft" "sent" "processing" "paid" "canceled"

Optional exact invoice status filter. Combined with the other filters before pagination; empty values are ignored.

customer_id
integer >= 1

Optional filter to invoices of one customer. The customer must belong to this merchant; any other id returns 422 with a customer_id error.

overdue
integer
Enum: 0 1

Send 1 for only invoices with status sent whose due date is before today in UTC, the same past-due rule the hosted payment page uses. 0 or absent applies no overdue filter. true and false are refused (422).

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Create invoice

Creates an invoice for either an existing customer of this business or a recipient email. Omit send or set it to false to create a draft. Set send to true to create and send it in one step, returning status sent and e-mailing the invoice to its recipient. If recording the send fails, invoice creation also rolls back. available_payment_methods is a nonempty set of methods for this invoice that can't be changed later; Apple Pay or Google Pay requires card. Omission enables every method currently offerable. ach is offered to a sandbox merchant with no acceptance, and to a live merchant only after they accept its service fees and activation is confirmed; the merchant turns ACH on in the dashboard. For any other merchant, omission returns apple_pay, google_pay, card and an explicit ach is rejected with 422. A stored invoice may retain ach, but for a live merchant it neither offers nor accepts ACH until activation is confirmed. A payer's device may still not show a wallet it doesn't support. The invoice is not payable until it is sent. With send true the send's rules apply first, and a refusal creates nothing. The credential's business owner must have a verified email (403 email_not_verified). A Sandbox business emails invoices only to its own team, the owner and accepted members by addresses their accounts verified (422 sandbox_recipient_not_allowed). A Production business's invoice emails, sends and resends alike, are capped at ten a day per recipient, three hundred a day per location of the business (or the business, if it has no locations) and sixty an hour for the business owner, shared with payment links (429 with Retry-After). The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:write.

Authorizations:
PartnerApiKeyPlatformApiKey
header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
One of
location_id
integer

Developer API, keys for all locations only. Required with such a key, and must be the business or one of its locations; the invoice is created there. Any other key always acts at its own location, and location_id is refused (422) with it at a business set up for locations, and ignored at a business without them.

amount
required
string^(?!0+(?:\.0{1,2})?$)\d{1,10}(?:\.\d{1,2})?$

Decimal amount in major currency units. Up to two decimal places.

currency
string or null = 3 characters ^[A-Z]{3}$
Default: "USD"

ISO currency code. Omit or send null to use the configured default currency.

description
required
string [ 1 .. 255 ] characters
due_date
required
string <date>

The last day the invoice can be paid (YYYY-MM-DD). After the end of that day, UTC, payment is refused. Must be today or later.

send
boolean
Default: false

Set true to create and send atomically. Omit or set false to create a draft without sending.

available_payment_methods
Array of strings (AvailablePaymentMethods) [ 1 .. 4 ] items unique
Items Enum: "apple_pay" "google_pay" "card" "ach"

The payment methods this invoice or payment link offers; they can't be changed later. Apple Pay or Google Pay requires card. A payer's device may still not show a wallet it doesn't support.

customer_id
required
integer >= 1

Existing merchant customer id. Provide either customer_id or email.

email
string <email> <= 255 characters

Recipient email. Provide either customer_id or email.

Responses

Request samples

Content type
application/json
Example
{
  • "amount": "25.50",
  • "description": "Implementation services",
  • "due_date": "2027-06-30",
  • "customer_id": 1,
  • "available_payment_methods": [
    ]
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get merchant invoice

Returns one invoice for an accessible merchant, including related customer and transaction details when present. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
invoice
required
integer

Invoice id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Update draft invoice

Updates a draft invoice. Sent, processing, paid, and canceled invoices cannot be edited. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
invoice
required
integer

Draft invoice id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Request Body schema: application/json
required
Any of
amount
required
string^(?!0+(?:\.0{1,2})?$)\d{1,10}(?:\.\d{1,2})?$

Decimal amount in major currency units. Up to two decimal places.

currency
string = 3 characters ^[A-Z]{3}$
description
string [ 1 .. 255 ] characters
due_date
string <date>

The last day the invoice can be paid (YYYY-MM-DD). After the end of that day, UTC, payment is refused. Must be today or later.

customer_id
integer >= 1

Existing merchant customer id. Sending this switches the draft invoice recipient to the customer.

email
string <email> <= 255 characters

Recipient email. Sending this switches the draft invoice to an email-only recipient.

available_payment_methods
any

Prohibited. Enabled payment methods are immutable after invoice creation.

Responses

Request samples

Content type
application/json
{
  • "amount": "42.75",
  • "description": "Updated services",
  • "due_date": "2027-07-15",
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Delete draft invoice

Deletes a draft invoice. Sent, processing, paid, and canceled invoices cannot be deleted. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
invoice
required
integer

Draft invoice id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "message": "Unauthenticated.",
  • "error": {
    }
}

Get merchant invoice summary

Returns invoice count, total invoice amount, paid invoice count, paid invoice amount, and paid rate for an accessible merchant. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Send or resend invoice

Sends a draft invoice, or sends a sent invoice again. Each send e-mails the invoice to its recipient with a new payment link; a resend's link replaces the earlier one, which stops working. Processing, paid, and canceled invoices cannot be sent or resent. The credential's business owner must have a verified email (403 email_not_verified). A Sandbox business emails invoices only to its own team, the owner and accepted members by addresses their accounts verified (422 sandbox_recipient_not_allowed). A Production business's invoice emails, sends and resends alike, are capped at ten a day per recipient, three hundred a day per location of the business (or the business, if it has no locations) and sixty an hour for the business owner, shared with payment links (429 with Retry-After). The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:write. A draft whose recipient is changed while it is being sent is refused with 409 and sent to no one.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
invoice
required
integer

Invoice id owned by the merchant.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Cancel sent invoice

Cancels a sent invoice and invalidates its public payment link. Draft invoices should be deleted instead of canceled. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires invoices:write.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
invoice
required
integer

Sent invoice id owned by the merchant.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Payouts

Read the payouts sent to the merchant's bank account, with the payments each one includes.

List merchant payouts

Lists the payouts sent to the merchant's bank account, and the withdrawals taken back from it, newest sent first, with cursor pagination. A payout is one transfer the processor sent; it has the day it was sent and the day it usually arrives by, and is never a confirmation that the bank received it. A list item carries no payments; get one payout to read them. Payouts exist for live merchants only, so a sandbox key answers 409. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payouts:read.

Authorizations:
PartnerApiKeyPlatformApiKey
query Parameters
location_id
integer

Keys for all locations only. Lists one location of the business; without it the list covers every location. Refused (422) for a location outside this business. With any other key it is refused (422) at a business set up for locations, and ignored at a business without them.

limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of payouts to return.

cursor
string <= 2048 characters

Opaque cursor returned by the previous response.

date_from
string <date>

Optional first day the payout was sent, inclusive (YYYY-MM-DD).

date_to
string <date>

Optional last day the payout was sent, inclusive (YYYY-MM-DD). Must be on or after date_from when date_from is supplied.

amount_min
string^(?:0|[1-9]\d{0,9})(?:\.\d{1,2})?$

Optional smallest amount, in dollars. Compared with the size of the amount, so a withdrawal of 42.10 matches 42.10.

amount_max
string^(?:0|[1-9]\d{0,9})(?:\.\d{1,2})?$

Optional largest amount, in dollars, compared the same way. Must be greater than or equal to amount_min when amount_min is supplied.

kind
string
Enum: "payout" "withdrawal"

Optional. Only payouts, or only withdrawals.

card_brand
string
Enum: "visa" "mastercard" "amex" "discover" "other"

Optional. Only payouts that include a payment made with this card brand.

search
string <= 64 characters

Optional. Matches a card's last 4 digits, an amount (a payment's, or the payout's own; $ and commas are ignored), or the start of the payout's reference.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get merchant payout

Returns one payout with the card payments it includes. The payments are listed only when all of them are known (payments_status is complete); otherwise payments is empty. A key for all locations opens a payout of any location of the business. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires payouts:read.

Authorizations:
PartnerApiKeyPlatformApiKey
path Parameters
payout
required
integer

Payout id that belongs to this business.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

X-ZenythPay-Merchant
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

With a platform key, the connected merchant this call is for: cm_ and 8 letters or digits. Not sent with a merchant's own API key.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Events

List the current merchant's webhook events from the last 30 days, to catch up on any you missed.

List webhook events

This business's events from the last 30 days, newest first, each exactly as its webhooks carried it (id is the ZenythPay-Event-Id header). Test events are never listed. To catch up after webhooks you missed, follow next_cursor until has_more is false and keep the first page's pagination.checkpoint, which every page of that scan carries. Next time, list with since set to it: you get every event published after it, newest first, including events that failed, arrived out of order or were recorded late, and a new checkpoint. Events belong to the whole business, so a key for one location answers 409. The merchant is resolved from the credential. Merchant selection through request fields is rejected with 422. Requires events:read.

Authorizations:
PartnerApiKey
query Parameters
limit
integer [ 1 .. 100 ]
Default: 20

Maximum number of events to return.

cursor
string <= 2048 characters

The previous page's pagination.next_cursor, as given. It carries its scan's since and checkpoint, so a since sent with it is not read.

since
string <= 2048 characters

A pagination.checkpoint this list gave you, as given. Lists only the events published after it.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Developer Platform

For developers, with a platform key: board merchants, read the merchants connected to you, and list your webhook events.

List connected merchants

The merchants connected to your developer account, newest first, test merchants included. Each shows its business name, whether it is a test merchant, and its status: live, approved, submitted, more_info_needed, declined or joined. key_works says whether a key of each environment can act for the merchant now. turned_off_at is set when the merchant's access to you was turned off. locations lists the ids to send as location_id when you create a payment, invoice or payment link for a business with several locations; it is null for any other business, and reads the business of the key's environment. No owner details are shown. Needs a key with merchants:read. This call names no merchant, so it spends your account's budget for the key's environment and no merchant's. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
query Parameters
limit
integer [ 1 .. 100 ]
cursor
string <= 2048 characters

The previous page's pagination.next_cursor, as given. A page link is opaque and works only for the developer account, environment and list that handed it out.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Get a connected merchant

One merchant connected to your developer account, with the same fields as the list. A merchant that does not exist and one connected to another developer answer alike. Needs a key with merchants:read. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
connectedMerchant
required
string^cm_[0-9A-Za-z]{8}$
Example: cm_Ab12Cd34

The merchant's id, cm_ followed by eight letters or digits.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

List applications

Your applications, newest first: each one's id, status, business name, how it was started and, once the owner joined, the merchant's id. Applications that are not yours, or that our team moved away from you, are never listed. Needs a key with applications:read. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
query Parameters
limit
integer [ 1 .. 100 ]
cursor
string <= 2048 characters

The previous page's pagination.next_cursor, as given. A page link is opaque and works only for the developer account, environment and list that handed it out.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}

Start an application

Starts an application for a business: its name and the owner's name and email, held to the same rules as any application start. In production it starts the application for the real business; nobody is emailed until you send it. A production start needs your company profile and a security method first: until then it answers 403 "Add your company profile and a security method before boarding real merchants." before anything is written, and spends none of the hour's starts. A login whose email is not verified gets 403 email_not_verified first. In sandbox it starts a test application, kept apart from real ones: checked by the same rules, but only against your own test applications, and nobody is emailed. Starts are limited to 20 an hour per developer per environment, through the API and the portal together. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Request Body schema: application/json
required
business_name
required
string [ 2 .. 45 ] characters ^[A-Za-z0-9 #&*'-]+$

Becomes both the legal and the DBA name, so it follows the application's rule for both: 2 to 45 letters, digits, spaces and # & * - '. Typographic quotes and dashes are stored as ' and -.

owner_first_name
required
string <= 100 characters
owner_last_name
required
string <= 100 characters
owner_email
required
string <email> <= 255 characters

Trimmed and lowercased. Letters, digits and _ ' + . - before the @ (no leading, trailing or doubled dot) and a dotted domain whose last part is letters only. Anything else reads "The owner email field must be a valid email address.".

Responses

Request samples

Content type
application/json
{
  • "business_name": "string",
  • "owner_first_name": "string",
  • "owner_last_name": "string",
  • "owner_email": "[email protected]"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Get an application

The application as you may read it: what you entered, less what only the merchant or our team holds. An SSN, a date of birth and the business tax ID are never read back: write_only says which are on file. more_info_requests lists what our review team asked the merchant for. Documents are never listed. merchant is the merchant's id once the owner joined. started_via says how it was started. An id that is unknown, another developer's, not an application id, or no longer yours answers the same 404. Needs a key with applications:read. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Fill in an application

Saves sections of the application with the same rules and messages as the merchant's own save, and answers the application. Send currentStep with every save of application fields; a field left out keeps its value. Bank details, pricing, the legal acceptances, the business category, ID document pointers and submitting are the merchant's or our team's, each refused with its own sentence. After the merchant joins, the owner's identity is theirs alone. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Request Body schema: application/json
required
currentStep
string or null
Enum: "business" "control_person" "owners" "processing" "bank_account" "pricing" "biz_type" "tax_details" "biz_details" "products_services" "public_details" "representative" "rep_verification" "secure_account" "review_submit" null

Required when the request saves application fields.

status
string or null
Enum: "draft" null

draft changes nothing; any other value reads "Only the merchant can submit this application."

object or null (ApplicationBusiness)

The application's business details as you read and write them: every business field except mcc (ZenythPay classifies the business) and the four acceptance flags, which only the merchant gives. In a write each of those five is refused with its own sentence. federalTaxId is written but never read back: a sole proprietor may type their SSN there, so the answer holds it only in write_only.

object or null (ApplicationPersonInput)

The control person or an owner as you write them: every field except the ID document pointers ("Upload ID documents as files."). ssn and dob are write-only, and only until the merchant joins.

Array of objects or null or null (ApplicationPersonInput) <= 4 items
object or null (ApplicationProcessing)

Expected processing amounts satisfy averageTicket <= highTicket <= monthlyVolume. Each adjacent comparison is enforced when both values are present, so incomplete draft sections may still be saved.

notes
string or null <= 2000 characters
object or null (ApplicationUnderwriting)

Underwriting answers, asked only when our review team requests them. Sending this group while the application is a draft is refused with 422 (errors.status).

bankAccount
any

"Only the merchant can enter bank details."

bank_account
any

The payout-shaped alias of bankAccount, refused the same way.

pricing
any

"ZenythPay sets the prices for this application."

legal
any

"Only the merchant can accept the legal terms."

Responses

Request samples

Content type
application/json
{
  • "currentStep": "business",
  • "status": "draft",
  • "business": {
    },
  • "controlPerson": {
    },
  • "owners": [
    ],
  • "processing": {
    },
  • "notes": "string",
  • "underwriting": {
    },
  • "bankAccount": null,
  • "bank_account": null,
  • "pricing": null,
  • "legal": null
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Upload a document

Uploads a document to the application, with the merchant's own file rules and its limit of 10 files per document. The answer is given once: a document is never listed or downloaded back. Bank proof is the merchant's alone, and uploads are taken only until the merchant joins and only while the application is a draft. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Request Body schema: multipart/form-data
required
idDocumentType
required
string
Enum: "drivers_license" "state_id" "passport" "business_license" "tax_return" "articles_of_incorporation" "financial_statements" "voided_check" "bank_statement" "processing_statement" "bank_letter" "ein_letter" "ein_application" "sellers_permit" "professional_license" "proof_of_address" "social_security_card" "paid_invoice" "irs_determination_letter" "business_photo"

Photo ID (drivers_license, state_id and passport) requires side. Business documents and social_security_card must be sent without side. The card is a separate scan-only category, never government photo ID.

side
string
Enum: "front" "back"

Required for photo ID. Business documents and Social Security cards have no front or back: omit it, or send null. A non-empty value is rejected with 422; an empty or whitespace-only string is normalised to null and accepted.

client_upload_id
string or null <uuid> ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3...

Not read here. To retry an upload safely, send an Idempotency-Key.

Array of integers or string

Not read here: an upload never replaces an earlier one.

file
required
string <binary>

JPEG, PNG, PDF, HEIC, or HEIF, up to 10 MB. Photo ID and social_security_card take only these scan formats. Business documents also take TXT, MD (.md or .markdown), DOC, DOCX or XLSX, each only under its own extension (a .txt may hold comma-separated text). A DOCX or XLSX must be a package of that type (its main part, named by _rels/.rels, carries the type's main content type) and is refused when its [Content_Types].xml declares a macro, VBA, ActiveX or OLE-object content type, when a relationship part relates a VBA project or ActiveX control or embeds an OLE object, when it relates an attached template, OLE object, frame or subdocument at a target that is not plainly local (only a file:/// URL of a drive or absolute path, a bare drive path or a bare absolute path is allowed; any other scheme, a scheme no URL can have, a UNC path, a file: URL with a host, a relative path or a garbled target is refused), when an entry has a program's extension, or when one of those XML parts cannot be read in full. The 422 lists the formats the chosen type accepts. A file over 10 MB is a 422 reading "The file is too large. The maximum size is 10 MB.", and one that fails to upload for any other reason a 422 reading "The file failed to upload."; a request body over 28 MB is refused before validation runs.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Change the owner email

Changes whose application this is, until the merchant joins, under the same checks as a start; earlier links stop working and nothing is sent, so the status is draft again. The email the owner already has changes nothing. Limited to 5 attempts a day per application. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Request Body schema: application/json
required
owner_email
required
string <email> <= 255 characters

Held to exactly the start's owner email rules and message.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Send an application to the merchant

Emails the owner a link to the application. In sandbox nobody is emailed: the answer's preview_url is a read-only preview of what the owner would see (POST /api/v1/platform/application-previews), handed out by this answer only. A send before that link expires changes nothing and has no preview_url, and neither does a replay under the same Idempotency-Key: resend for a new link. In production the owner gets the link by email, in an email that names your company; the link is never in the answer. A production send needs your company profile and a security method first: until then it answers 403 "Add your company profile and a security method before boarding real merchants." before anything is looked up, counted or sent. A login whose email is not verified gets 403 email_not_verified first. Links are limited to 5 a day per application, and to 5 a day per owner's inbox across all your applications in each environment: addresses that differ only by a +tag, or by dots in a Gmail address, count as one inbox. The owner's sign-in codes, and the link we email when someone signs up or resets a password with the owner's address, count too; a new link the owner asks for themselves has a limit of its own. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Send an application again

Emails the owner a new link to an application already sent; the earlier link stops working. In sandbox nobody is emailed: the answer's preview_url is the new preview link, handed out by this answer only; a replay under the same Idempotency-Key has none: resend again for a new link. In production the owner gets the new link by email, in an email that names your company; the link is never in the answer. A production resend needs your company profile and a security method first: until then it answers 403 "Add your company profile and a security method before boarding real merchants." before anything is looked up, counted or sent. A login whose email is not verified gets 403 email_not_verified first. Links are limited to 5 a day per application, and to 5 a day per owner's inbox across all your applications in each environment: addresses that differ only by a +tag, or by dots in a Gmail address, count as one inbox. The owner's sign-in codes, and the link we email when someone signs up or resets a password with the owner's address, count too; a new link the owner asks for themselves has a limit of its own. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Simulate what happens next to a test application

Sandbox only. Moves a test application as the merchant or our review team would, so you can build against every status without a real merchant. Each outcome follows only certain statuses: joined follows sent; submitted follows joined or more_info_needed; more_info_needed follows submitted or more_info_needed and adds a request to more_info_requests; approved and declined follow submitted. approved connects the application to a test merchant, named in merchant: a new one named for the business while you have fewer than 10, otherwise the oldest of your test merchants that no test application uses and our team has not turned off (resetting a test merchant frees it). The application reads approved until that test merchant is ready, then live. A test merchant takes cards once your email is verified. Approving an approved application again retries setting up its test merchant and changes nothing else. A production key answers 403 "Simulate works only with test applications in sandbox.". Nothing is emailed. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Request Body schema: application/json
required
outcome
required
string
Enum: "joined" "submitted" "more_info_needed" "approved" "declined"

What happens next: the merchant joins or submits, or our review team asks for more information, approves or declines. Each follows only certain statuses (see the operation).

Responses

Request samples

Content type
application/json
{
  • "outcome": "joined"
}

Response samples

Content type
application/json
{
  • "data": {
    }
}

Make an onboarding session for the merchant

A link you hand the application's owner, for your own app to open, good for 48 hours. Send the application first: a session is made only for an application sent to its owner, or one they have joined. The link alone signs nobody in: when the owner opens it we email a 6-digit code to the owner's address, good for 10 minutes (opening the link again sends a new one), and the owner finishes with that code and a password of their own (POST /api/v1/platform/onboarding-sessions/open and /claim). An owner who already has a ZenythPay login is sent to sign in instead. A new session, or a change of the owner's email, ends the application's earlier sessions. url is in this answer only: a replay under the same Idempotency-Key has none, so ask for a new session if you lost it. In sandbox nobody is emailed: url is the sent test application's read-only preview (POST /api/v1/platform/application-previews), good for 48 hours, and it replaces the earlier preview link. A production session needs your company profile and a security method first: until then it answers 403 "Add your company profile and a security method before boarding real merchants." before anything is looked up or made. A login whose email is not verified gets 403 email_not_verified first. Needs a key with applications:write. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
path Parameters
application
required
string^app_[0-9A-Za-z]{8}$
Example: app_Ab12Cd34

The application's id, app_ followed by eight letters or digits.

header Parameters
Idempotency-Key
string [ 1 .. 128 ] characters ^[ -~]+$

Optional: a key you choose for one request, so that it can be retried safely. Keys are kept 24 hours, for your account and this environment. A retry with the same key and the same request (the route, the application, the body and any file) answers the first answer again, with Idempotency-Replayed: true, and changes nothing. If the first request made its change but its answer was lost, the retry answers from that change: the upload's answer, an onboarding session's expiry, or the application as it reads now ("We can't find that application." once it has been deleted). The same key with a different request answers 409, and so does a retry while the first request still runs: try again in a moment. A request that failed without making its change runs again. A replay never has preview_url or an onboarding session's url: the link is handed out once, by the answer that made it.

X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{}

List your webhook events

Your events of the key's environment from the last 30 days, newest first, each exactly as its webhook carried it (id is the ZenythPay-Event-Id header). Test events are never listed. An event about a merchant or an application you may no longer see (its merchant's connection turned off or gone, the application no longer yours) is left out, except a connection's own connection.revoked; so a page may hold fewer events than limit, even none, while pagination.has_more is true. To catch up, follow next_cursor until has_more is false and keep the first page's pagination.checkpoint, which every page of that scan carries. Next time, list with since set to it: you get every event published after it, newest first, including events that failed, arrived out of order or were recorded late, and a new checkpoint. When our team turns a merchant's access back on after that checkpoint, its events that were left out show again below it, so that since answers 422: list again without it, every page, and keep the new checkpoint. Needs a key with events:read. This call names no merchant, so it spends your account's budget for the key's environment and no merchant's. Every answer is Cache-Control: no-store, private.

Authorizations:
PlatformApiKey
query Parameters
limit
integer [ 1 .. 100 ]
cursor
string <= 2048 characters

The previous page's pagination.next_cursor, as given. It carries its scan's since and checkpoint, so a since sent with it is not read. A page link is opaque and works only for the developer account, environment and list that handed it out.

since
string <= 2048 characters

A pagination.checkpoint this list gave you: lists only the events published after it. It is opaque and works only for the developer account and environment that it was given to, and only until our team turns a merchant's access back on: then it answers 422, and you list again without it.

header Parameters
X-ZenythPay-Environment
required
string
Enum: "sandbox" "production"

Must match both the API credential and its merchant environment.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "pagination": {
    }
}