Skip to main content
POST
/
payments
/
{paymentId}
/
cancel
Cancel payment
curl --request POST \
  --url https://api.natural.co/payments/{paymentId}/cancel \
  --header 'Authorization: Bearer <token>' \
  --header 'Idempotency-Key: <idempotency-key>'
{
  "data": {
    "type": "payment",
    "id": "pay_550e8400e29b41d4a716446655440000",
    "attributes": {
      "amount": 500000,
      "currency": "USD",
      "status": "CANCELED",
      "description": "Payment for Q4 2025 development work",
      "createdAt": "2026-01-04T15:30:00Z",
      "updatedAt": "2026-01-04T15:35:00Z"
    },
    "relationships": {
      "sender": {
        "data": {
          "type": "party",
          "id": "pty_019cd1798d617f65a79cb965dda9eac3"
        }
      },
      "recipient": {
        "data": {
          "type": "party",
          "id": "pty_019cd1798d627ad9bc302511c4f2c115"
        }
      },
      "recipientAgent": {
        "data": null
      },
      "transaction": {
        "data": {
          "type": "transaction",
          "id": "txn_550e8400e29b41d4a716446655440000"
        }
      },
      "paymentRequest": {
        "data": null
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string
required

Unique key for idempotent request handling. If a request with the same key was already processed, the original response is returned.

X-Agent-ID
string | null

Agent ID (agt_xxx) identifying which agent is making the request.

X-Instance-ID
string | null

Required when X-Agent-ID is present. Session or conversation ID for agent observability.

Maximum string length: 1024

Path Parameters

paymentId
string
required
Pattern: ^pay_[0-9a-f]{32}$

Response

Successful Response

data
PaymentResource · object
required