Create a Refund
POST
/v1/refunds
const url = 'https://api.parasta.io/v1/refunds';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"payment_id":"pi_abc123","metadata":{"reason":"customer_requested"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.parasta.io/v1/refunds \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "payment_id": "pi_abc123", "metadata": { "reason": "customer_requested" } }'Creates a full refund for a succeeded Payment. v1 does not support partial refunds.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
payment_id
required
string
metadata
object
key
additional properties
string
Example
{ "payment_id": "pi_abc123", "metadata": { "reason": "customer_requested" }}Responses
Section titled “ Responses ”Created
Media type application/json
object
id
required
string
payment_id
required
string
amount
required
Always equal to the original payment amount in v1 (full refund only)
integer format: int64
currency
required
string
status
required
string
tx_hash
string | null
created
string format: date-time
Example
{ "id": "re_abc123", "status": "pending"}Object not found
Media type application/json
object
error
required
object
type
required
string
code
required
string
message
required
string
param
string
request_id
string
Example
{ "error": { "type": "authentication_error" }}