API reference
Merchants
Common headers
Every endpoint on this page takes these headers.
| Name | Description |
|---|---|
MonetizePay-Accountheader, string or null | Optional. The merchant (mch_...) this request acts on, when the body has no merchant_id: the analogue of Stripe's Stripe-Account header. |
Stripe-Accountheader, string or null | Optional. A synonym of MonetizePay-Account; holds a merchant id (mch_...). |
Common responses
Every endpoint on this page can answer with these.
| Status | Description | Body |
|---|---|---|
| 400 | Invalid request. A parameter, header or body field failed validation (code parameter_invalid, with param naming it), or another invalid_request code this operation's description lists. Fix the request; do not retry it unchanged. | ErrorResponse |
| 401 | The API key is missing, malformed, unknown or revoked (api_key_missing, api_key_malformed, api_key_invalid). Fix the Authorization header. | ErrorResponse |
| 403 | The key is valid but may not do this: platform_suspended, insufficient_scope, live_mode_unavailable, or a permission code this operation's description lists (for example processor_currency_unsupported). | ErrorResponse |
| 429 | Too many requests (rate_limited). Wait for the Retry-After header, then retry. | ErrorResponse |
List merchants
GET/
Lists your merchants, newest first.
Arguments: limit, cursor.
Returns a list of merchant objects.
Errors: authentication errors only.
Next step: GET /v1/merchants/{id}/terminals.
Parameters
| Name | Description |
|---|---|
limitquery, integer | Items per page, default 20. |
cursorquery, string or null | next_cursor from the previous page. |
starting_afterquery, string or null | Stripe's name for cursor: the id of the last object of the previous page. Same value, same meaning. Send cursor or starting_after, not both. |
ending_beforequery, string or null | Not supported: answers 400 parameter_unavailable. Lists page newest first; page forward with starting_after. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | ListOut_MerchantOut_ |
Example
curl -X GET "https://api.monetize.pay/v1/merchants" \
-H "Authorization: Bearer zp_test_..."import requests
response = requests.get(
"https://api.monetize.pay/v1/merchants",
headers={
"Authorization": "Bearer zp_test_...",
},
)
print(response.json())const response = await fetch("https://api.monetize.pay/v1/merchants", {
method: "GET",
headers: {
"Authorization": "Bearer zp_test_...",
},
});
console.log(await response.json());Create a merchant
POST/
Creates a merchant that can take payments through your software. In test mode it is active instantly on Monetize.Pay's shared test business; no test request reaches the Processor. In live mode it starts as invited: send its owner through the link from POST /v1/merchants/{id}/connect to bind their own processor account. Use it once per business you onboard.
Arguments: display_name, metadata.
Returns the merchant object.
Errors: idempotency_key_required, parameter_invalid.
Next step: in test mode, POST /v1/merchants/{id}/terminals with {"kind":"simulated"} to get a terminal you can drive without hardware; in live mode, POST /v1/merchants/{id}/connect.
Parameters
| Name | Description |
|---|---|
Idempotency-Keyheader, string or null | Required on this endpoint. Any unique string up to 255 characters (a UUID is fine). Reuse it only to retry the same request. |
Request body
| Field | Description |
|---|---|
display_namestringRequired | Business name shown on receipts. |
metadataobject of string | Up to 50 string pairs. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | MerchantOut |
| 409 | Conflict with the current state: idempotency_in_progress (another request with this Idempotency-Key is still running; wait for Retry-After), or a conflict code this operation's description lists. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, or its Content-Length is not a number (code payload_too_large). Every write method is checked, before routing. A body sent without a Content-Length (chunked) is accepted on /v1 and counted as it arrives; elsewhere it is refused. The connection is closed after this answer. Send a smaller body. | ErrorResponse |
| 422 | This Idempotency-Key was already used with a different request body (code idempotency_key_reused). Send the original body to retry, or a new key for a new request. | ErrorResponse |
Example
curl -X POST "https://api.monetize.pay/v1/merchants" \
-H "Authorization: Bearer zp_test_..." \
-H "Idempotency-Key: <Idempotency-Key>" \
-H "Content-Type: application/json" \
-d '{
"display_name": <display_name>
}'import requests
response = requests.post(
"https://api.monetize.pay/v1/merchants",
headers={
"Authorization": "Bearer zp_test_...",
"Idempotency-Key": "<Idempotency-Key>",
},
json={
"display_name": "<display_name>",
},
)
print(response.json())const response = await fetch("https://api.monetize.pay/v1/merchants", {
method: "POST",
headers: {
"Authorization": "Bearer zp_test_...",
"Idempotency-Key": "<Idempotency-Key>",
"Content-Type": "application/json",
},
body: JSON.stringify({
"display_name": "<display_name>",
}),
});
console.log(await response.json());Retrieve a merchant
GET/
Returns one merchant.
Arguments: merchant_id (mch_...).
Returns the merchant object.
Errors: resource_missing when the id is unknown or belongs to another platform.
Next step: create a terminal or a payment for it.
Parameters
| Name | Description |
|---|---|
merchant_idpath, stringRequired |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | MerchantOut |
| 404 | No such resource for this platform (resource_missing), or another not_found code this operation's description lists. | ErrorResponse |
Example
curl -X GET "https://api.monetize.pay/v1/merchants/{merchant_id}" \
-H "Authorization: Bearer zp_test_..."import requests
response = requests.get(
"https://api.monetize.pay/v1/merchants/{merchant_id}",
headers={
"Authorization": "Bearer zp_test_...",
},
)
print(response.json())const response = await fetch("https://api.monetize.pay/v1/merchants/{merchant_id}", {
method: "GET",
headers: {
"Authorization": "Bearer zp_test_...",
},
});
console.log(await response.json());Get a link for the merchant to connect their processor account
POST/
Returns a one-time link. Send the merchant to it in a browser: it opens a Monetize.Pay consent page that names your platform and what the merchant is granting (taking payments and issuing refunds on their account). When they press Continue they sign in to their own processor account (the one they opened through Monetize.Pay's signup link) and approve the connection, and Monetize.Pay binds this merchant to that account. The merchant must finish in the browser that showed the consent page. From then on the merchant's payments run on its own account. Poll GET /v1/merchants/{id} for processor_connected, or listen for merchant.state_changed. Works for live merchants (required before any payment; a real payments account only) and for test merchants that want a test business of their own instead of the shared one: their link opens Monetize.Pay's Connect a test business page, and the Processor is not involved. Physical terminals are not available in test mode.
Arguments: merchant_id, return_url (optional).
Returns a processor_connection object with connect_url and expires_at.
Errors: resource_missing, return_url_invalid, connect_unavailable (this deployment has no processor application credentials). A refused connection reaches return_url as status=failed with reason processor_mode_mismatch, processor_already_connected, processor_business_other_partner or connect_consent_required. A connection whose account is not a US, USD account succeeds but its card payments are held: return_url gets status=connected with hold=processor_currency_unsupported and the merchant object says card_payments_held.
Next step: open connect_url as the merchant; then GET /v1/merchants/{id}. For live merchants and real GoDaddy Payments accounts: Monetize.Pay works only with a GoDaddy Payments account opened through Monetize.Pay's signup link. A business that already has a GoDaddy Payments account cannot use that account with Monetize.Pay; it opens a new one through the link. Earnings apply only to merchants whose GoDaddy Payments account was opened through Monetize.Pay's signup link. An account opened any other way earns nothing, for you or for Monetize.Pay. A sandbox test account is not affected by this rule.
Parameters
| Name | Description |
|---|---|
merchant_idpath, stringRequired |
Request body
| Field | Description |
|---|---|
return_urlstring or null | Where to send the merchant afterwards (https, or http://localhost while developing). It receives merchant_id and status=connected|failed as query parameters, plus reason=<code> when Monetize.Pay refused the connection. Without one, Monetize.Pay shows the merchant a result page. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | Successful Response | ProcessorConnectionOut |
| 404 | No such resource for this platform (resource_missing), or another not_found code this operation's description lists. | ErrorResponse |
| 413 | The request body is over 1048576 bytes, or its Content-Length is not a number (code payload_too_large). Every write method is checked, before routing. A body sent without a Content-Length (chunked) is accepted on /v1 and counted as it arrives; elsewhere it is refused. The connection is closed after this answer. Send a smaller body. | ErrorResponse |
| 503 | No processor is available for this merchant or deployment (processor_not_connected, sandbox_processor_unconfigured, connect_unavailable). | ErrorResponse |
Example
curl -X POST "https://api.monetize.pay/v1/merchants/{merchant_id}/connect" \
-H "Authorization: Bearer zp_test_..." \
-H "Content-Type: application/json" \
-d '{}'import requests
response = requests.post(
"https://api.monetize.pay/v1/merchants/{merchant_id}/connect",
headers={
"Authorization": "Bearer zp_test_...",
},
json={},
)
print(response.json())const response = await fetch("https://api.monetize.pay/v1/merchants/{merchant_id}/connect", {
method: "POST",
headers: {
"Authorization": "Bearer zp_test_...",
"Content-Type": "application/json",
},
body: JSON.stringify({}),
});
console.log(await response.json());Get the keyed-entry (Collect) configuration
GET/
Returns what your web page needs for keyed entry on this merchant: form_url, the Monetize.Pay hosted card form to embed in an iframe (it posts a one-time nonce to your page with window.postMessage), a stand-alone sandbox form URL, and test cards. Card numbers never touch your server or your page.
Arguments: merchant_id.
Returns a collect_config object.
Errors: resource_missing; processor_currency_unsupported (403) when the merchant's connected account is not a US, USD account (card payments are held and no card form is served); processor_mode_mismatch (403); sandbox_processor_unconfigured (503) when this sandbox has no processor account.
Next step: get a nonce in the browser, then POST /v1/payments with method keyed (see the accept-a-keyed-payment guide).
Parameters
| Name | Description |
|---|---|
merchant_idpath, stringRequired |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Successful Response | CollectConfigOut |
| 404 | No such resource for this platform (resource_missing), or another not_found code this operation's description lists. | ErrorResponse |
| 502 | The payments network failed or gave no decision (processor_unavailable). Nothing was changed by this request; retry it later. | ErrorResponse |
| 503 | No processor is available for this merchant or deployment (processor_not_connected, sandbox_processor_unconfigured, connect_unavailable). | ErrorResponse |
Example
curl -X GET "https://api.monetize.pay/v1/merchants/{merchant_id}/collect-config" \
-H "Authorization: Bearer zp_test_..."import requests
response = requests.get(
"https://api.monetize.pay/v1/merchants/{merchant_id}/collect-config",
headers={
"Authorization": "Bearer zp_test_...",
},
)
print(response.json())const response = await fetch("https://api.monetize.pay/v1/merchants/{merchant_id}/collect-config", {
method: "GET",
headers: {
"Authorization": "Bearer zp_test_...",
},
});
console.log(await response.json());