Skip to main content
POST
Refund a payment

Authorizations

Authorization
string
header
required

Bearer credential for the public API. Vendor integrations should send a live COPE API key (cope_sk_live_*). Clerk bearer tokens are also accepted when paired with X-Cope-Business-Id.

Headers

Idempotency-Key
string
required

Required. At most 255 characters of valid UTF-8 with no NUL byte. A retry that carries the same key and the same body returns the original response instead of performing the write a second time. The same key with a different body is refused with 409 idempotency_conflict. Keys are remembered for 24 hours.

Maximum string length: 255

Path Parameters

id
string
required

id public identifier.

Pattern: ^py_(?:[A-Za-z0-9]{12}|[0-9a-f]{24})$
Example:

"py_A1b2C3d4E5f6"

Body

application/json
amount_cents
integer

Amount to refund in minor units. Omit the field entirely to refund everything still refundable; an explicit null is refused.

Required range: x >= 1

Response

Successful response

data
object
required