Skip to main content
POST
Refund a payment

Authorizations

Authorization
string
header
required

Bearer credential for the public API: a live COPE API key (ck_live_*; keys issued earlier as cope_sk_live_* keep working). Dashboard sign-in tokens are not accepted.

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. A returned original response carries the header Idempotent-Replayed: true.

Maximum string length: 255

Path Parameters

id
string
required

id public identifier.

Pattern: ^py_[A-Za-z0-9]{8,32}$
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