Create a Webhook Endpoint
POST
/v1/webhook_endpoints
const url = 'https://api.parasta.io/v1/webhook_endpoints';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://your-site.com/webhook","enabled_events":["checkout.session.completed","payment.failed","refund.succeeded"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.parasta.io/v1/webhook_endpoints \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://your-site.com/webhook", "enabled_events": [ "checkout.session.completed", "payment.failed", "refund.succeeded" ] }'Returns the signing secret in the response — store it. The secret is not retrievable later.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
url
required
string format: uri
enabled_events
required
Array<string>
Example
{ "url": "https://your-site.com/webhook", "enabled_events": [ "checkout.session.completed", "payment.failed", "refund.succeeded" ]}Responses
Section titled “ Responses ”Created
Media type application/json
object
id
required
string
url
required
string format: uri
enabled_events
required
Array<string>
secret_preview
required
First 8 chars of the signing secret. Full secret only shown on POST.
string
status
required
string
created
string format: date-time
secret
The full signing secret. Store this — it cannot be retrieved later.
string
Example
{ "id": "we_abc123", "enabled_events": [ "payment.created" ], "status": "enabled"}