# Request refund Endpoint: POST /refunds Version: v1 Security: bearerAuth ## Header parameters: - `Content-Digest` (string) SHA-256 or SHA-512 hash of the request body. - `Signature` (string) Signature of the request according to RFC-9421. - `Signature-Input` (string) Signature-Input according to RFC-9421. - `Accept-Signature` (string) Expected signature algorithm of the response according to RFC-9421. - `Accept-Digest` (string) Expected digest algorithm of the response according to RFC-9421. ## Request fields (application/json): - `refundId` (string, required) A UUIDv4 based ID specified by you, that uniquely identifies the refund. Example: "" - `depositId` (string, required) The depositId of the deposit to be refunded. Example: "" - `amount` (string) The amount to be collected (deposit) or disbursed (payout or refund). Amount must follow below requirements or the request will be rejected: * Between zero and two decimal places can be supplied, depending on what the specific MMO supports. Learn about all [MMO supported decimal places](https://docs.transaction-monitor.io/using_the_api#correspondents). * The minimum and maximum amount depends on the limits of the specific MMO. You can find them from the [Active Configuration](#/paths/~1active-conf/get) endpoint. * Leading zeroes are not permitted except where the value is less than 1. For any value less than one, one and only one leading zero must be supplied. * Trailing zeroes are permitted. Valid examples: 5, 5.0, 5.00, 5.5, 5.55, 5555555, 0.5 Not valid examples: 5., 5.555, 5555555555555555555, .5, -5.5, 00.5, 00.00, 00001.32 Example: "15" - `metadata` (array) A list of metadata that you can attach to the payment for providing additional context about the payment. For example, adding orderId to indicate for which order this payment was for or customerId to know which customer this payment pertains to. Metadata will not be visible to the customer that is party to this payment. It will be visible in the Blu Penguin Dashboard on the payment details page and in your financial statements as a JSON object to support automated reconciliation. It is also possible to search for recent payments in the Blu Penguin Dashboard using global search based on the values of metadata. Up to 10 metadata fields can be attached to a payment. Example: [{"fieldName":"orderId","fieldValue":"ORD-123456789"},{"fieldName":"customerId","fieldValue":"customer@email.com","isPII":true}] - `metadata.fieldName` (string, required) The name of the metadata that you are attaching to the payment. For example orderId. Example: "orderId" - `metadata.fieldValue` (string, required) The value for this metadata field. For example ORD-123456789. Example: "ORD-123456789" - `metadata.isPII` (boolean) Indicates whether the field contains personally identifiable information. Used for enabling compliance with GDPR or other relevant data privacy laws. Example: true ## Response 200 fields (application/json): - `refundId` (string, required) The refundId of the refund transaction. Example: "f4401bd2-1568-4140-bf2d-eb77d2b2b639" - `status` (string, required) Possible refund initiation statuses: * ACCEPTED - The refund request has been accepted by Blu Penguin for processing. * REJECTED - The refund request has been rejected by Blu Penguin. See rejectionReason for details. * DUPLICATE_IGNORED - The refund request has been ignored as a duplicate of an already accepted refund request. Duplication logic relies upon refundId. Enum: "ACCEPTED", "REJECTED", "DUPLICATE_IGNORED" - `created` (string) The timestamp of when the refund was created in the Blu Penguin platform. Format defined by 'date-time' in RFC3339 section 5.6 from [IETF](https://tools.ietf.org/html/rfc3339#section-5.6) Example: "2020-02-21T17:32:29Z" - `rejectionReason` (object) - `rejectionReason.rejectionCode` (string) Possible refund rejection codes: * DEPOSIT_NOT_FOUND- Requested deposit for refund has not been found. * DEPOSIT_NOT_COMPLETED- Requested deposit was not completed. * ALREADY_REFUNDED- Requested deposit has been already refunded. * IN_PROGRESS- Another refund transaction is already in progress. * INVALID_AMOUNT- The specified amount is not supported. * AMOUNT_TOO_SMALL - The specified amount is smaller than the minimum allowed by the MMO specified as the correspondent. * AMOUNT_TOO_LARGE - The specified amount is larger than the maximum allowed by the MMO specified as the correspondent. * INVALID_CURRENCY - The specified currency is not supported by the MMO specified as the correspondent. * INVALID_COUNTRY - The specified country is not supported for the MMO specified as the correspondent. * PARAMETER_INVALID - One or more parameters are invalid. * INVALID_INPUT - We were unable to parse the payload of the request. * REFUNDS_NOT_ALLOWED - Refunds are not allowed for this merchant or the MMO specified as the correspondent. * CORRESPONDENT_TEMPORARILY_UNAVAILABLE - The MMO specified as the correspondent is currently experiencing an outage and processing of payments has been temporarily halted. Please refer to our [Status Page](https://status.transaction-monitor.io) for live information about MMO availability. Enum: "DEPOSIT_NOT_FOUND", "DEPOSIT_NOT_COMPLETED", "ALREADY_REFUNDED", "IN_PROGRESS", "INVALID_AMOUNT", "AMOUNT_TOO_SMALL", "AMOUNT_TOO_LARGE", "PARAMETER_INVALID", "INVALID_INPUT", "REFUNDS_NOT_ALLOWED", "CORRESPONDENT_TEMPORARILY_UNAVAILABLE" - `rejectionReason.rejectionMessage` (string) Additional optional rejection message Example: "You don't have access to this correspondent (MMO)" ## Response 400 fields (application/json): - `errorId` (string, required) A unique error ID in the Blu Penguin platform. Example: "63743264-7292-11ea-bc55-0242ac130003" - `errorCode` (integer, required) Blu Penguin internal error code. Example: 1 - `errorMessage` (string, required) Error message. Example: "Internal error" ## Response 401 fields (application/json): - `errorId` (string, required) A unique error ID in the Blu Penguin platform. Example: "63743264-7292-11ea-bc55-0242ac130003" - `errorCode` (integer, required) Blu Penguin internal error code. Example: 1 - `errorMessage` (string, required) Error message. Example: "Internal error" ## Response 500 fields (application/json): - `errorId` (string, required) A unique error ID in the Blu Penguin platform. Example: "63743264-7292-11ea-bc55-0242ac130003" - `errorCode` (integer, required) Blu Penguin internal error code. Example: 1 - `errorMessage` (string, required) Error message. Example: "Internal error"