Refund Creation Endpoint

Create refunds requests from a completed deposit

Refund Creation

POST https://api-stg.lime-pay.com/v3/refunds

Description

The refunds endpoint allows you to create a full refund over a Credit Card deposit in completed state or full/partial refunds over other payment methods' deposits in completed state.

In the case of credit cards, since the refund will be processed to the same card, all you need to send are the fields to identify the deposit.

In the case of other payment methods where we don't have the account of the payer, you need to send the beneficiary's ID, bank account details and bank code retrieved with the Endpoint for Bank Codes.

You can create as many refunds as needed over a completed deposit, as long as the total amount of those refunds doesn't exceed the original amount deposited.

Headers

Request Body

{
    "refund_id": 168284
}

Refunds Request

In order to start creating refunds, you need to:

  1. Send the request with POST method.

  2. Use the headers described here.

  3. Specify a valid deposit_id and invoice_id related to the deposit to be refunded.

  4. Send the Authorization header calculated in the same way than for deposits, as explained here.

  5. Send the body of the request as JSON.

Example Request

// CASH Method:

curl --location --request POST 'https://api-stg.lime-pay.com/v3/refunds' \
--header 'X-Login: {{X-Login}}' \
--header 'X-Date: {{X-Date}}' \
--header 'Authorization: {{Authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "deposit_id": 32423423423432,
    "invoice_id": "23jn4j3k2n",
    "amount": "100",
    "bank_account": {
        "beneficiary": "Carlos Ramirez",
        "bank_code": 1,
        "branch": "9283",
        "account_number": "18293435",
        "account_type": "SAVING"
    },
    "comments": "Test refund over v3",
    "notification_url": "https://webhook.site/url"
}'


// CREDIT CARD method:

curl --location --request POST 'https://api-stg.lime-pay.com/v3/refunds' \
--header 'X-Login: {{X-Login}}' \
--header 'X-Date: {{X-Date}}' \
--header 'Authorization: {{Authorization}}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "deposit_id": 32423423423432,
    "invoice_id": "jk324b32jk3",
    "comments": "Test CREDIT CARD refund over v3",
    "notification_url": "https://webhook.site/url"
}'

Request fields description

bank_account Object

Account types

Example Response

CASH Success Response Example

{
    "refund_id": 168284
}

CASH Success Response Fields

Error Responses Example

// Invalid amount to refund. The amount is bigger than the deposit or
// it has been already refunded
{
    "code": 802,
    "description": "Amount to refund not valid",
    "type": "INVALID_AMOUNT_TO_REFUND"
}

// The object_bank account needs to be sent
{
    "code": 804,
    "description": "Missing bank account information",
    "type": "MISSING_BANK_ACCOUNT"
}

// The deposit_id and/or the merchant_invoice_id didn't belong to a deposit
{
    "code": 208,
    "description": "Resource not found",
    "type": "RESOURCE_NOT_FOUND"
}

Error Responses Fields

Last updated