Payment pagesAdd a payment page
Payment pages
Events
- HOOKWebhooks
- S3 exportSoon
Add a payment page
POST /v1/payment-pages adds one payment page selector to a team, the same selectors you manage in Setup step 4, and says whether it was new.
POST /v1/payment-pages adds one payment page selector to a team: the same list you edit in Setup step 4 (see Payment pages). Needs the payment_pages:create scope. Organization keys must pass team_id; a team key acts on its own team.
With an organization key:
curl -X POST https://data.scriptmonitoring.com/v1/payment-pages/ \
-H "Authorization: Bearer sm_org_14829305716342_…" \
-H "Content-Type: application/json" \
-d '{"team_id": "YOUR_TEAM_ID", "payment_page": "shop.example.com/checkout"}'
With a team key, no team_id:
curl -X POST https://data.scriptmonitoring.com/v1/payment-pages/ \
-H "Authorization: Bearer sm_team_10937462815530_…" \
-H "Content-Type: application/json" \
-d '{"payment_page": "shop.example.com/checkout"}'
Which keys work?#
| Key | Accepted |
|---|---|
Organization key (sm_org_…) | Yes, with payment_pages:create and a team_id in the body. |
Team key (sm_team_…) | Yes, with payment_pages:create, on its own team. team_id is optional; if you pass it, it must be the key's own team. |
A missing, mistyped or revoked key, a key whose prefix doesn't match its type, or a key created before the sm_org_ / sm_team_ format gets 401 with this body, and so does a team key whose team_id names another team:
{ "error": "unauthorized", "message": "Missing or invalid bearer token." }
Request body#
| Field | Type | Description |
|---|---|---|
payment_page | string | A selector as host and path, without https:// and without spaces. |
team_id | string | The team's ID. Required with an organization key; with a team key, optional and only its own team. |
Response#
{ "data": { "status": "created", "teamId": "14827391650423", "paymentPage": "shop.example.com/checkout" } }
status is created or existing. Errors: 400 (invalid_request, invalid_payment_page), 401, 403, 404 team_not_found, 429, 503 payment_page_unavailable.