Create a refund
POST/v3/payments/:paymentId/refunds
To create a payment refund, you use a refund resource.
Request
Path Parameters
Possible values: >= 16 characters
and <= 16 characters
, Value must match regular expression ^([a-zA-Z0-9]{4}(-[a-zA-Z0-9]{3}){3})$
Unique ID of a payment generated by Paynow
Header Parameters
The Signature header is used to ensure the request’s body integrity and to confirm that its content has not changed.
Possible values: <= 45 characters
A unique identifier used to ensure idempotent behavior. If the business application request fails or you receive a timeout you can retry the request with the same Idempotency-Key to guarantee that only one business object is created.
The User-Agent request header contains a characteristic string that allows the network protocol peers to identify the application type, operating system, software vendor or software version of the requesting software user agent.
The Accept request HTTP header advertises which content types, expressed as MIME types, the client is able to understand. Can be set to */*
.
The Content-Type entity header is used to indicate the media type of the resource.
- application/json
Body
required
Request body for refund request
RMA
- complaintREFUND_BEFORE_14
- refund before 14 days from purchaseREFUND_AFTER_14
- refund after 14 days from purchaseOTHER
- other reason
Possible values: <= 10 characters
A positive integer in the smallest currency unit. Currency of the refund amount is the same as payment currency.
Possible values: [RMA
, REFUND_BEFORE_14
, REFUND_AFTER_14
, OTHER
]
Refund reason
Responses
- 201
- 400
- 401
- 404
- 500
- 503
Created
- application/json
- Schema
- Example (from schema)
Schema
Unique ID of a refund generated by Paynow
Current status of the refund. More information you can find here.
{
"refundId": "REFX-123-435-213",
"status": "PENDING"
}
Bad request
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
Error status code
errors
object[]
required
Possible values: [CONFLICT
, FORBIDDEN
, NOT_FOUND
, RATE_LIMIT_REACHED
, SYSTEM_TEMPORARILY_UNAVAILABLE
, UNAUTHORIZED
, VALIDATION_ERROR
, VERIFICATION_FAILED
, PAYMENT_METHOD_NOT_AVAILABLE
, PAYMENT_AMOUNT_TOO_SMALL
, PAYMENT_AMOUNT_TOO_LARGE
, IDEMPOTENCY_KEY_MISSING
, SIGNATURE_MISSING
]
Error type
Error description
{
"statusCode": 0,
"errors": [
{
"errorType": "CONFLICT",
"message": "string"
}
]
}
{
"statusCode": 400,
"errors": [
{
"errorType": "VALIDATION_ERROR",
"message": "Missing field XXX"
},
{
"errorType": "VALIDATION_ERROR",
"message": "Invalid format of field YYY"
}
]
}
Unauthorized, invalid or missing credentials
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
- UnauthorizedErrorDetails
]
Error status code
errors
object[]
required
oneOf
Possible values: [UNAUTHORIZED
]
Error type
Error description
{
"statusCode": 0,
"errors": [
{}
]
}
{
"statusCode": 401,
"errors": [
{
"errorType": "UNAUTHORIZED",
"message": "Unauthorized, invalid or missing credentials"
}
]
}
Not found
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
Error status code
errors
object[]
required
Possible values: [NOT_FOUND
]
Error type
Error description
{
"statusCode": 0,
"errors": [
{
"errorType": "NOT_FOUND",
"message": "string"
}
]
}
{
"statusCode": 404,
"errors": [
{
"errorType": "NOT_FOUND",
"message": "Resource not found"
}
]
}
Internal server error
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
Error status code
errors
object[]
required
Possible values: [INTERNAL_SERVER_ERROR
]
Error type
Error description
{
"statusCode": 0,
"errors": [
{
"errorType": "INTERNAL_SERVER_ERROR",
"message": "string"
}
]
}
{
"statusCode": 500,
"errors": [
{
"errorType": "INTERNAL_SERVER_ERROR",
"message": "Internal server error"
}
]
}
Service is temporarily unavailable
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
Error status code
errors
object[]
required
Possible values: [SYSTEM_TEMPORARILY_UNAVAILABLE
]
Error type
Error description
{
"statusCode": 0,
"errors": [
{
"errorType": "SYSTEM_TEMPORARILY_UNAVAILABLE",
"message": "string"
}
]
}
{
"statusCode": 503,
"errors": [
{
"errorType": "SYSTEM_TEMPORARILY_UNAVAILABLE",
"message": "Service is temporarily unavailable"
}
]
}