Skip to content

Cancel a payment session

POST
/gateway/sessions/{session_id}/cancel/
curl --request POST \
--url https://api.paymee.online/api/v1/gateway/sessions/example/cancel/ \
--header 'Authorization: Bearer <token>'

Cancel a payment session that has not reached a terminal state.

session_id
required
string

Prefixed public id of the payment session (e.g. ps_...).

Media typeapplication/json

Response serializer for payment session detail.

object
id
required
string
merchant_reference
required

Merchant-provided unique reference for idempotency

string
<= 200 characters
order_number
required

System-generated order number (PM-XXXXXX)

string
<= 10 characters
order_id
Merchant order ID

Merchant’s display-friendly order ID (separate from merchant_reference)

string
<= 100 characters
amount
required
string
currency
string
<= 3 characters
original
required
object
amount
required

Requested amount, as a decimal string at the requested currency’s precision.

string
currency
required

Requested ISO 4217 currency code.

string
rate
required

Exchange rate applied (1 original.currency = rate currency), six decimals. “1.000000” when no conversion.

string
description
string
<= 500 characters
items

Line items: [{name, quantity, unit_price, description}]

status
  • CREATED - Created
  • PENDING - Pending
  • PROCESSING - Processing
  • SUCCEEDED - Succeeded
  • FAILED - Failed
  • EXPIRED - Expired
  • CANCELED - Canceled
string
Allowed values: CREATED PENDING PROCESSING SUCCEEDED FAILED EXPIRED CANCELED
livemode
required
boolean
buyer_first_name
string
<= 100 characters
buyer_last_name
string
<= 100 characters
buyer_email
string format: email
<= 255 characters
buyer_phone
string
<= 20 characters
metadata
return_url
string format: uri
<= 2048 characters
cancel_url

Redirect buyer here on payment failure or cancellation

string format: uri
<= 2048 characters
webhook_url

Per-session webhook URL override

string format: uri
<= 2048 characters
max_attempts
integer
<= 2147483647
checkout_url
required
string
expires_at
required
string format: date-time
completed_at
string format: date-time
nullable
created_at
required
string format: date-time
attempts
required
Array<object>

Serializer for payment attempts (read-only).

object
id
required
string
attempt_number
required
integer
<= 2147483647
status
  • INITIATED - Initiated
  • PROCESSING - Processing
  • SUCCEEDED - Succeeded
  • FAILED - Failed
  • ABANDONED - Abandoned
string
Allowed values: INITIATED PROCESSING SUCCEEDED FAILED ABANDONED
card_brand
required
string
card_last_four
required
string
failure_code
required
string
fee_amount
required
string
net_amount
required
string
created_at
required
string format: date-time
Example
{
"status": "CREATED",
"attempts": [
{
"status": "INITIATED"
}
]
}

The referenced payment session does not exist for this merchant account.

Media typeapplication/json

RFC 9457 problem detail body (application/problem+json).

object
type
required

URI identifying the error type.

string format: uri
title
required

Short, human-readable summary of the error type.

string
status
required

HTTP status code.

integer
detail
required

Human-readable explanation specific to this occurrence.

string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example"
}

The request conflicts with the current state of the resource.

Media typeapplication/json

RFC 9457 problem detail body (application/problem+json).

object
type
required

URI identifying the error type.

string format: uri
title
required

Short, human-readable summary of the error type.

string
status
required

HTTP status code.

integer
detail
required

Human-readable explanation specific to this occurrence.

string
Examplegenerated
{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example"
}