POST /{merchantId}/transaction/{transactionId}/refund

Zapytanie umożliwia wykonanie zwrotu do opłaconej transakcji.

Podczas wykonywania wielu transakcji zwrotu jednocześnie, należy wprowadzić co najmniej 5-cio sekundowe opóźnienie pomiędzy kolejnymi transakcjami.

Ze względów bezpieczeństwa zwroty można wykonywać:

  • w przypadku BLIK maksymalnie do 12 miesięcy
  • dla imoje płacę później maksymalnie do 12 miesięcy
  • dla kart płatniczych do 3 lat

Path parameters

  • merchantId string Required

    Identyfikator klienta

  • transactionId string(uuid) Required

    Identyfikator transakcji jako UUID v4

    Maximum length is 36. Format should match the following pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

application/json

Body Required

  • type string Required

    Typ transakcji

    Value is refund.

  • serviceId string(uuid) Required

    Identyfikator sklepu jako UUID v4

    Maximum length is 36. Format should match the following pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

  • amount integer Required

    Kwota transakcji w najmniejszej jednostce waluty np. grosze.

  • title string

    Tytuł transakcji

    Maximum length is 255. Format should match the following pattern: ^[A-Za-z0-9#&_\-\,\.\\\\/ \u00C0-\u02C0"']+$.

  • sendRefundConfirmationEmail boolean

    Wyślij e-mail z potwierdzeniem zwrotu do płatnika. Mail jest wysyłany po poprawnym zrealizowaniu zwrotu (status settled) na adres e-mail podany przy składaniu zamówienia.

Responses

  • 200 application/json

    Zapytanie wykonane poprawnie

    Hide response attribute Show response attribute object
    • transaction object
      Hide transaction attributes Show transaction attributes object
      • id string(uuid)

        Identyfikator transakcji jako UUID v4

        Maximum length is 36. Format should match the following pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

      • type string

        Typ transakcji

        Value is refund.

      • status string

        Status

        Values are new, pending, settled, authorized, rejected, cancelled, or error.

      • source string

        Żródło transakcji

        Values are web or api.

      • created integer | null

        Data utworzenia jako timestamp

      • modified integer | null

        Data modyfikacji jako timestamp

      • serviceId string(uuid)

        Identyfikator sklepu jako UUID v4

        Maximum length is 36. Format should match the following pattern: ^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$.

      • amount integer

        Kwota transakcji w najmniejszej jednostce waluty np. grosze.

      • currency string

        Waluta transakcji w standardzie ISO 4217

        Maximum length is 3. Values are PLN, EUR, USD, GBP, CHF, SEK, HUF, CZK, BGN, or RON.

      • orderId string

        Numer zamówienia

        Maximum length is 100. Format should match the following pattern: ^[A-Za-z0-9#_\-\.\\\\/ \u00C0-\u02C0]+$.

      • paymentMethod string

        Oznaczenie metody płatności

        Values are blik, pbl, ing, card, wallet, imoje_paylater, wt, or imoje_installments.

      • paymentMethodCode string

        Oznaczenie kanału płatności

        Values are blik, imoje_twisto, paypo, blik_paylater, pragma_go, gpay, applepay, visa_mobile, paypal, ecom3ds, oneclick, recurring, ing, mtransfer, bzwbk, pekao24, inteligo, ipko, getin, noble, creditagricole, alior, millennium, citi, bos, bnpparibas, pocztowy, plusbank, bs, bspb, nest, pbs, cs, mp, kb, rf, pg, pf, cb, uc, posta, sporo, tatra, viamo, vub, wt, wt_split, inbank, or inbank_0.

  • 422 application/json

    Payload nie zawiera wymaganaych parametrów, zawiera niedopuszczalne parametry, lub przesłane w nich wartości nie spełniają wymogów.

    Hide response attribute Show response attribute object
    • apiErrorResponse object

      Szczegóły błędu

      Hide apiErrorResponse attributes Show apiErrorResponse attributes object
      • code string

        Kod błędu

      • message string

        Komunikat błędu

      • instance object

        Body przesłanego zapytania HTTP do imoje.

      • errors array[object]

        Lista błędów

        Hide errors attributes Show errors attributes object
        • property string

          Miejsce wystąpienia błędu

        • message string

          Powód wystąpienia błędu

POST /{merchantId}/transaction/{transactionId}/refund
curl \
 --request POST 'https://sandbox.api.imoje.pl/v1/merchant/{merchantId}/transaction/{transactionId}/refund' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"type":"refund","title":"yourRefundTitle","amount":100,"serviceId":"24737aab-a507-4feb-8248-3f42bfdbb006","sendRefundConfirmationEmail":true}'
Request example
{
  "type": "refund",
  "title": "yourRefundTitle",
  "amount": 100,
  "serviceId": "24737aab-a507-4feb-8248-3f42bfdbb006",
  "sendRefundConfirmationEmail": true
}
Response examples (200)
{
  "transaction": {
    "id": "2eea6c95-51fc-446a-bedc-03e4b197ffd0",
    "type": "refund",
    "amount": 1000,
    "source": "api",
    "status": "settled",
    "created": 1735686000,
    "orderId": "yourOrderId",
    "currency": "PLN",
    "modified": 1735686000,
    "serviceId": "51cd18a7-68dc-49a7-bb23-3854bbc34627",
    "paymentMethod": "blik",
    "paymentMethodCode": "blik"
  }
}
Response examples (422)
{
  "apiErrorResponse": {
    "code": "TRX-ERROR-120100",
    "errors": [],
    "message": "Refund amount too large.",
    "instance": {
      "type": "refund",
      "amount": 2000,
      "serviceId": "51cd18a7-68dc-49a7-bb23-3854bbc34627"
    }
  }
}