Obtaining information about the possibility of making a return Run in API Explorer

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

The request allows you to obtain information on the permissible value of full and partial returns for a given transaction.

Path parameters

  • merchantId string Required

    Merchant identifier

  • transactionId string(uuid) Required

    Transaction identifier as 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

  • amount integer Required

    The transaction amount in the smallest currency unit, e.g. pennies.

Responses

  • 200 application/json

    Request executed correctly

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

      Transaction identifier as 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}$.

    • refundable boolean

      Information on whether a transaction can be refunded.

    • balance boolean

      Information on whether the shop's balance is sufficient to make a refund.

    • fullRefund integer

      The value of the full refund amount.

    • partialRefund object

      Maximum and minimum permitted partial refund value.

      Hide partialRefund attributes Show partialRefund attributes object
      • maxRefundAmount integer

        Maximum permitted partial refund value.

      • minRefundAmount integer

        Minimum permitted partial refund value.

POST /{merchantId}/transaction/{transactionId}/can-refund
curl \
 --request POST 'https://api.imoje.pl/v1/merchant/{merchantId}/transaction/{transactionId}/can-refund' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"amount":10000}'
Request example
{
  "amount": 10000
}
Response examples (200)
{
  "id": "a8b67878-8236-4051-bc91-56d30073d97a",
  "balance": true,
  "fullRefund": 10000,
  "refundable": true,
  "partialRefund": {
    "maxRefundAmount": 10000,
    "minRefundAmount": 1
  }
}