Skip to main content

Websites

The Public API exposes endpoints for managing the websites registered under an Organization. A website is identified by a name and a url.

Base configuration

Path note: The websites endpoints live under /v1/organizations/... (without the /public-api/ segment used by most other Public API resources). Confirm the host and base path with your integration target before sending requests.

EnvironmentBase URL
Stagehttps://staging-api.payments.ai/v1
Productionhttps://api.payments.ai/v1

Authentication. All requests require a valid API key in the Authorization header. See Authentication.

Role required. The API key must belong to a user with the Editor role or higher. See Organizations for the role hierarchy.

Endpoints

Create a website

Registers a new website for the specified Organization.

  • Method: POST
  • Route: /organizations/{organizationId}/websites

Body:

FieldTypeRequiredConstraintsNotes
namestringYesMax 22 charsName of the website.
urlstringYesMax 50 chars, valid URLThe website URL (for example, https://myshop.com).

Request:

curl -X POST \
"https://staging-api.payments.ai/v1/organizations/${ORGANIZATION_ID}/websites" \
-H 'Content-Type: application/json' \
-H "Authorization: ApiKey ${API_KEY}" \
-d '{
"name": "Summer Sale Store",
"url": "https://sale.myshop.com"
}'

Response (201):

{
"type": "object",
"data": {
"id": "6f326525-1586-479b-8176-55ba802caea4",
"organizationId": "46da78a6-034d-48d3-a28f-870d20b0ba00",
"name": "Summer Sale Store",
"url": "https://sale.myshop.com"
}
}

Retrieve a website

  • Method: GET
  • Route: /organizations/{organizationId}/websites/{websiteId}
curl -X GET \
"https://staging-api.payments.ai/v1/organizations/${ORGANIZATION_ID}/websites/${WEBSITE_ID}" \
-H "Authorization: ApiKey ${API_KEY}"

No collection GET. The API spec does not expose a GET /organizations/{organizationId}/websites collection endpoint. Retrieve websites one at a time by ID.

Update a website

  • Method: PUT
  • Route: /organizations/{organizationId}/websites/{websiteId}

Body: same shape as Create.

curl -X PUT \
"https://staging-api.payments.ai/v1/organizations/${ORGANIZATION_ID}/websites/${WEBSITE_ID}" \
-H 'Content-Type: application/json' \
-H "Authorization: ApiKey ${API_KEY}" \
-d '{
"name": "Winter Sale Store",
"url": "https://winter.myshop.com"
}'

Delete a website

  • Method: DELETE
  • Route: /organizations/{organizationId}/websites/{websiteId}
curl -X DELETE \
"https://staging-api.payments.ai/v1/organizations/${ORGANIZATION_ID}/websites/${WEBSITE_ID}" \
-H "Authorization: ApiKey ${API_KEY}"

Deletes the website from the Organization.

Response example (200):

{
"success": true
}

The success boolean indicates whether the website was removed.

Response codes

StatusMeaning
200Request processed successfully.
201Resource created.
400Validation failed (for example, name exceeds 22 chars or url is invalid). The details field describes which field failed.
401Missing or invalid API key.
403The API key lacks the Editor role for this Organization.
404Organization or website ID not found.
500Internal server error.

See Errors for the response shape.