Create a external refund
POST/v3/payments/:paymentId/refunds/accounts
Create a payment refund and retrieve the bank transfer data.
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
Unique key used to authenticate API requests.
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 a refund with bank transfer data
RMA- complaintREFUND_BEFORE_14- refund before 14 days from purchaseREFUND_AFTER_14- refund after 14 days from purchaseOTHER- other reason
A positive integer in the smallest currency unit. Currency of the refund amount is the same as payment currency.
Possible values: <= 10 characters
Refund reason
Possible values: [RMA, REFUND_BEFORE_14, REFUND_AFTER_14, OTHER]
URL that Paynow sends refund status notifications to
Possible values: <= 1000 characters
Refund validity time in seconds, from 3 to 10 days
Possible values: >= 259200 and <= 864000
Seller ID
Possible values: <= 15 characters
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.
Possible values: [NEW, PENDING, SUCCESSFUL]
The total amount returned to the payer for this refund. Represents the smallest unit of the order currency (grosz in the case of PLN). This field will only be included if a voucher reservation was used in the payment related to this refund.
Possible values: <= 10 characters
The total amount returned to the voucher card used for given payment related to this refund. Represents the smallest unit of the order currency (grosz in the case of PLN). This field will only be included if a voucher reservation was used in the payment related to this refund.
Possible values: <= 10 characters
bankTransferData
object
required
Bank transfer data for the refund
Recipient bank account number
A positive integer in the smallest currency unit. Currency of the refund amount is the same as payment currency.
Possible values: <= 10 characters
Possible values: [PLN, EUR, USD, GBP]
PLNBank transfer title. Must match the returned value exactly so Paynow can identify the incoming transfer.
Bank transfer recipient name
Bank transfer recipient address
{
"refundId": "REFX-123-435-213",
"status": "NEW",
"payerAmount": 8999,
"voucherAmount": 1100,
"bankTransferData": {
"accountNumber": "PL1140",
"amount": 10099,
"currency": "PLN",
"title": "Zwrot REFX-123-435-213",
"recipientName": "mElements S.A. / mBank",
"recipientAddress": "Prosta 18, 00-850 Warszawa"
}
}
Bad request
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
Error status code
errors
object[]
required
Error type
Possible values: [CONFLICT, FORBIDDEN, NOT_FOUND, RATE_LIMIT_REACHED, SYSTEM_TEMPORARILY_UNAVAILABLE, VALIDATION_ERROR, VERIFICATION_FAILED, IDEMPOTENCY_KEY_MISSING, SIGNATURE_MISSING, INSUFFICIENT_BALANCE_FUNDS, INVALID_SUM_OF_REFUND_GROSS_AMOUNT, REFUND_TRANSFER_GROSS_AMOUNT_TOO_SMALL, REFUND_TRANSFER_GROSS_AMOUNT_TOO_LARGE, REFUND_TRANSFER_FEE_AMOUNT_TOO_SMALL, REFUND_TRANSFER_FEE_AMOUNT_TOO_LARGE, SELLER_NOT_FOUND, SELLER_CLOSED]
Error description
Object ID related to given error. Applies only to error types [SELLER_NOT_FOUND, SELLER_CLOSED, INSUFFICIENT_BALANCE_FUNDS]
{
"statusCode": 0,
"errors": [
{
"errorType": "CONFLICT",
"message": "string",
"value": "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
Error details
Error type
Possible values: [UNAUTHORIZED]
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
Error type
Possible values: [NOT_FOUND]
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
Error type
Possible values: [INTERNAL_SERVER_ERROR]
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
Error type
Possible values: [SYSTEM_TEMPORARILY_UNAVAILABLE]
Error description
{
"statusCode": 0,
"errors": [
{
"errorType": "SYSTEM_TEMPORARILY_UNAVAILABLE",
"message": "string"
}
]
}
{
"statusCode": 503,
"errors": [
{
"errorType": "SYSTEM_TEMPORARILY_UNAVAILABLE",
"message": "Service is temporarily unavailable"
}
]
}