Softlemon API Documentation
  • Merchant API
  • Partner API
  • Guides
Information
Transactions
    Initiate TransactionpostCapture TransactionpostRefund TransactionpostTransaction StatusgetVoid Transactionpost
Payment Instruments
    List payment instrumentsgetRevoke a payment instrumentdelete
Payment Sessions
    Create a payment sessionpostGet a payment sessiongetList available payment methodsget
Card Verification
    Initiate Card Verificationpost
Webhook Management
    Get webhook configurationgetCreate or update the webhook endpointputDelete the webhook endpointdeleteRotate the webhook signing secretpostSend a test pingpostList webhook eventsgetGet a webhook eventgetReplay a webhook eventpost
API Operations
    Get API Key Informationget
Schemas
Softlemon Merchant API
Softlemon Merchant API

Webhook Management


Get webhook configuration

GET
https://api.sandbox.softlemons.com
/api/v1/webhook

Retrieve the webhook endpoint configuration: URL, active flag, event subscription and delivery health. The signing secret is never returned, has_secret only reports that one exists. Returns 404 until an endpoint is created with PUT /api/v1/webhook.

Merchant API keys read their own configuration. Partner API keys must include merchant_id for a linked merchant.

Get webhook configuration › query Parameters

merchant_id
​integer

Required for partner API keys. Must be a merchant linked to the authenticated partner.

Get webhook configuration › Responses

success
​boolean
message
​string
code
​string
​object
GET/api/v1/webhook
curl https://api.sandbox.softlemons.com/api/v1/webhook \ --header 'Authorization: Bearer <token>'
Example Responses
{ "success": true, "message": "Webhook endpoint retrieved successfully", "code": "", "data": { "id": 12, "merchant_id": 123, "url": "https://example.com/webhooks/softlemon", "is_active": true, "events": null, "has_secret": true, "last_success_at": "2026-08-09T14:12:03.000000Z", "last_failure_at": null, "consecutive_failures": 0, "delivery_status": "healthy", "status_message": "Webhook deliveries are healthy.", "created_at": "2026-08-01T10:00:00.000000Z", "updated_at": "2026-08-09T14:12:03.000000Z" } }
json
application/json

Create or update the webhook endpoint

PUT
https://api.sandbox.softlemons.com
/api/v1/webhook

Register the HTTPS endpoint that receives signed webhook events, or update it in place. On first creation the response includes the plaintext signing secret exactly once. The secret is stored encrypted and can never be read back, so capture it from that response and store it securely. Updates never return or regenerate the secret.

The URL must use HTTPS on a publicly resolvable host. URLs with embedded credentials, localhost style hosts or private IP addresses are rejected. See the set up webhooks guide for the full walkthrough.

Merchant API keys manage their own endpoint (one per merchant). Partner API keys must include merchant_id for a linked merchant.

Create or update the webhook endpoint › Request Body

url
​string · required

The HTTPS endpoint that receives webhook events. Maximum 2048 characters.

is_active
​boolean

Pause or resume deliveries without losing the configuration. Defaults to true.

events
​string[]

Event types to deliver. Omit to keep the stored subscription. Send null to reset to the default set (every type except transaction.pending). An empty list is rejected.

merchant_id
​integer | null

Required for partner API keys. Must be a merchant linked to the authenticated partner.

Create or update the webhook endpoint › Responses

Endpoint updated. The secret is never returned again.

success
​boolean
message
​string
code
​string
​object
PUT/api/v1/webhook
curl https://api.sandbox.softlemons.com/api/v1/webhook \ --request PUT \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "url": "https://example.com/webhooks/softlemon", "is_active": true, "events": [ "transaction.captured", "transaction.refunded" ], "merchant_id": 123 }'
Example Request Body
{ "url": "https://example.com/webhooks/softlemon", "is_active": true, "events": [ "transaction.captured", "transaction.refunded" ], "merchant_id": 123 }
json
Example Responses
{ "success": true, "message": "Webhook endpoint updated successfully", "code": "", "data": { "id": 12, "merchant_id": 123, "url": "https://example.com/webhooks/softlemon", "is_active": true, "events": [ "transaction.captured", "transaction.refunded", "transaction.failed" ], "has_secret": true, "last_success_at": "2026-08-09T14:12:03.000000Z", "last_failure_at": null, "consecutive_failures": 0, "delivery_status": "healthy", "status_message": "Webhook deliveries are healthy.", "created_at": "2026-08-01T10:00:00.000000Z", "updated_at": "2026-08-10T09:30:12.000000Z" } }
json
application/json

Delete the webhook endpoint

DELETE
https://api.sandbox.softlemons.com
/api/v1/webhook

Remove the webhook endpoint. Deliveries stop immediately, any event still queued for it is marked failed, and the stored URL and signing secret are erased. Delivery history stays readable through the events endpoints. A new endpoint can be registered afterwards with PUT /api/v1/webhook, which issues a new signing secret. To pause deliveries without losing the configuration, set is_active to false instead.

Merchant API keys delete their own endpoint. Partner API keys must include merchant_id for a linked merchant.

Delete the webhook endpoint › query Parameters

merchant_id
​integer

Required for partner API keys. Must be a merchant linked to the authenticated partner.

Delete the webhook endpoint › Responses

success
​boolean
message
​string
code
​string
data
​string
DELETE/api/v1/webhook
curl https://api.sandbox.softlemons.com/api/v1/webhook \ --request DELETE \ --header 'Authorization: Bearer <token>'
Example Responses
{ "success": true, "message": "Webhook endpoint deleted successfully", "code": "", "data": null }
json
application/json

Rotate the webhook signing secret

POST
https://api.sandbox.softlemons.com
/api/v1/webhook/rotate-secret

Generate a new signing secret for the endpoint. Rotation is a hard cutover: the old secret stops signing immediately and the new one is returned exactly once in this response, so update your verifier right away. Deliveries retried after rotation are signed with the new secret.

Merchant API keys rotate their own secret. Partner API keys must include merchant_id for a linked merchant.

Rotate the webhook signing secret › Request Body optional

merchant_id
​integer

Required for partner API keys. Must be a merchant linked to the authenticated partner.

Rotate the webhook signing secret › Responses

Secret rotated. The new signing secret appears only in this response.

success
​boolean
message
​string
code
​string
​object
POST/api/v1/webhook/rotate-secret
curl https://api.sandbox.softlemons.com/api/v1/webhook/rotate-secret \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "merchant_id": 123 }'
Example Request Body
{ "merchant_id": 123 }
json
Example Responses
{ "success": true, "message": "Webhook secret rotated successfully", "code": "", "data": { "endpoint": { "id": 12, "merchant_id": 123, "url": "https://example.com/webhooks/softlemon", "is_active": true, "events": null, "has_secret": true, "last_success_at": "2026-08-09T14:12:03.000000Z", "last_failure_at": null, "consecutive_failures": 0, "delivery_status": "healthy", "status_message": "Webhook deliveries are healthy.", "created_at": "2026-08-01T10:00:00.000000Z", "updated_at": "2026-08-10T09:30:12.000000Z" }, "secret": "whsec_0a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f9" } }
json
application/json

Send a test ping

POST
https://api.sandbox.softlemons.com
/api/v1/webhook/test

Send a signed ping event to the endpoint synchronously and report whether the receiver answered with a 2xx status. Use it to verify reachability and signature handling before real events flow. A successful ping verifies the endpoint (it stamps last_success_at and resets the failure streak), which is what unlocks payment-session creation when the webhook readiness gate is enabled. The ping never appears in delivery history and a failed ping persists nothing. A failing receiver still returns HTTP 200 here, check data.success for the outcome. Limited to 10 pings per minute per API key.

Merchant API keys ping their own endpoint. Partner API keys must include merchant_id for a linked merchant.

Send a test ping › Request Body optional

merchant_id
​integer

Required for partner API keys. Must be a merchant linked to the authenticated partner.

Send a test ping › Responses

success
​boolean
message
​string
code
​string
​object
POST/api/v1/webhook/test
curl https://api.sandbox.softlemons.com/api/v1/webhook/test \ --request POST \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <token>' \ --data '{ "merchant_id": 123 }'
Example Request Body
{ "merchant_id": 123 }
json
Example Responses
{ "success": true, "message": "Ping sent", "code": "", "data": { "success": true, "status_code": 200, "duration_ms": 184, "error": null, "delivery_status": "healthy" } }
json
application/json

List webhook events

GET
https://api.sandbox.softlemons.com
/api/v1/webhook/events

List recorded webhook events newest first (delivery history). List rows never include the payload snapshot, fetch a single event for that. History depth equals the 30 day retention window, older events are pruned and cannot be listed or replayed.

Merchant API keys list their own events. Partner API keys must include merchant_id for a linked merchant.

List webhook events › query Parameters

status
​string

Filter by delivery status (pending, delivered, failed).

event_type
​string

Filter by event type.

from
​string

Filter events created on or after this date.

to
​string

Filter events created on or before this date.

transaction_id
​integer

Filter to events for one transaction id.

merchant_id
​integer

Required for partner API keys. Must be a merchant linked to the authenticated partner.

per_page
​integer

Number of events per page (1-100, default 25).

page
​integer

Page number (1+).

List webhook events › Responses

success
​boolean
message
​string
code
​string
​object
GET/api/v1/webhook/events
curl https://api.sandbox.softlemons.com/api/v1/webhook/events \ --header 'Authorization: Bearer <token>'
Example Responses
{ "success": true, "message": "Webhook events retrieved successfully", "code": "", "data": { "events": [ { "id": "evt_01k20c4x9y5r08qwj6dfhm3bzt", "event_type": "transaction.captured", "transaction_id": 123456, "merchant_trans_id": "ORDER-2041", "status": "delivered", "attempts": 1, "created_at": "2026-08-09T14:11:58.000000Z", "delivered_at": "2026-08-09T14:12:03.000000Z", "failed_at": null, "last_attempt": { "delivery_id": "whd_01k20c4xa2b3c4d5e6f7g8h9j0", "attempt": 1, "status_code": 200, "error_reason": null, "response_excerpt": null, "duration_ms": 184, "is_replay": false, "created_at": "2026-08-09T14:12:03.000000Z" } }, { "id": "evt_01k20c1w8x4q07pvj5cehm2azs", "event_type": "transaction.refunded", "transaction_id": 123401, "merchant_trans_id": "ORDER-2038", "status": "pending", "attempts": 2, "created_at": "2026-08-09T13:55:10.000000Z", "delivered_at": null, "failed_at": null, "last_attempt": { "delivery_id": "whd_01k20c1wa9t8s7r6q5p4n3m2k1", "attempt": 2, "status_code": 503, "error_reason": "HTTP 503", "response_excerpt": "Service Unavailable", "duration_ms": 912, "is_replay": false, "created_at": "2026-08-09T14:10:11.000000Z" } } ], "pagination": { "current_page": 1, "last_page": 1, "per_page": 25, "total": 2 } } }
json
application/json

Get a webhook event

GET
https://api.sandbox.softlemons.com
/api/v1/webhook/events/{webhookEvent_public_id}

Retrieve one event with the stored payload snapshot (exactly what was signed and sent, card data free by construction) and the full delivery attempt trail in chronological order. An event that is not visible to this API key returns 404.

Get a webhook event › path Parameters

webhookEvent_public_id
​string · required

The event public id.

Get a webhook event › Responses

success
​boolean
message
​string
code
​string
​object
GET/api/v1/webhook/events/{webhookEvent_public_id}
curl https://api.sandbox.softlemons.com/api/v1/webhook/events/:webhookEvent_public_id \ --header 'Authorization: Bearer <token>'
Example Responses
{ "success": true, "message": "Webhook event retrieved successfully", "code": "", "data": { "id": "evt_01k20c4x9y5r08qwj6dfhm3bzt", "event_type": "transaction.captured", "transaction_id": 123456, "merchant_trans_id": "ORDER-2041", "status": "delivered", "attempts": 2, "payload": { "id": "evt_01k20c4x9y5r08qwj6dfhm3bzt", "type": "transaction.captured", "created_at": "2026-08-09T14:11:58Z", "api_version": "2026-08-01", "data": { "transaction": { "id": 123456, "merchant_trans_id": "ORDER-2041", "related_trans_id": null, "transaction_type": "sale", "status": "captured", "amount": 5000, "currency": "EUR", "acquirer_provider": "qashpay", "acquirer_trans_id": "8ac7a4a2985300a1", "acquirer_auth_code": "AUTH01", "description": null, "created_at": "2026-08-09T14:11:52Z", "updated_at": "2026-08-09T14:11:58Z", "refunded_amount": 0 } } }, "created_at": "2026-08-09T14:11:58.000000Z", "delivered_at": "2026-08-09T14:12:03.000000Z", "failed_at": null, "delivery_attempts": [ { "delivery_id": "whd_01k20c1wa9t8s7r6q5p4n3m2k1", "attempt": 1, "status_code": 503, "error_reason": "HTTP 503", "response_excerpt": "Service Unavailable", "duration_ms": 912, "is_replay": false, "created_at": "2026-08-09T14:11:59.000000Z" }, { "delivery_id": "whd_01k20c4xa2b3c4d5e6f7g8h9j0", "attempt": 2, "status_code": 200, "error_reason": null, "response_excerpt": null, "duration_ms": 184, "is_replay": false, "created_at": "2026-08-09T14:12:03.000000Z" } ] } }
json
application/json

Replay a webhook event

POST
https://api.sandbox.softlemons.com
/api/v1/webhook/events/{webhookEvent_public_id}/replay

Queue a fresh delivery of the stored event: same event id and payload, a fresh delivery id and an X-Softlemon-Replay: true header so receivers can tell replays from originals. Replaying an already delivered event is allowed, for example when the original was lost. A failing replay never demotes a delivered event. Events older than the 30 day retention window are pruned and cannot be replayed. Limited to 30 replays per minute per API key.

Replay a webhook event › path Parameters

webhookEvent_public_id
​string · required

The event public id.

Replay a webhook event › Responses

success
​boolean
message
​string
code
​string
​object
POST/api/v1/webhook/events/{webhookEvent_public_id}/replay
curl https://api.sandbox.softlemons.com/api/v1/webhook/events/:webhookEvent_public_id/replay \ --request POST \ --header 'Authorization: Bearer <token>'
Example Responses
{ "success": true, "message": "Webhook event replay queued", "code": "", "data": { "event": { "id": "evt_01k20c4x9y5r08qwj6dfhm3bzt", "event_type": "transaction.captured", "transaction_id": 123456, "merchant_trans_id": "ORDER-2041", "status": "delivered", "attempts": 2, "created_at": "2026-08-09T14:11:58.000000Z", "delivered_at": "2026-08-09T14:12:03.000000Z", "failed_at": null, "last_attempt": null } } }
json
application/json

Card VerificationAPI Operations