Refund, void, or capture an order
curl -X PUT "https://test-fep.kashier.io/v3/orders/string" \ -H "Content-Type: application/json" \ -d '{ "apiOperation": "REFUND", "reason": "any reason", "transaction": { "amount": 3 } }'{ "response": { "status": "SUCCESS", "gatewayCode": "APPROVED", "gatewayMessage": "Payment accepted", "transactionResponseCode": "00", "transactionResponseMessage": { "en": "Approved", "ar": "تمت الموافقة" }, "transactionId": "TX-69827599", "transactionDate": "2022-04-13 10:44:46.724000+00:00", "settlementDate": "2022-04-13", "amount": 10, "currency": "EGP", "operation": "refund", "merchantIdentifier": "TESTQNBINHOUSE03", "payload": { "authorizationResponse": { "cardSecurityCodeError": "M", "commercialCard": "888", "commercialCardIndicator": "3", "financialNetworkCode": "777", "posData": "1025100006600", "posEntryMode": "812", "processingCode": "203000", "responseCode": "00", "stan": "199804", "transactionIdentifier": "123456789" }, "gatewayEntryPoint": "WEB_SERVICES_API", "merchant": "", "order": { "amount": 14, "chargeback": { "amount": 0, "currency": "EGP" }, "creationTime": "2022-04-13 10:39:31.655000+00:00", "currency": "EGP", "id": "93c799ea-ae6c-485c-bf36-a385acbb8c13", "lastUpdatedTime": "2022-04-13 10:44:46.764000+00:00", "merchantAmount": 14, "merchantCategoryCode": "8211", "merchantCurrency": "EGP", "reference": "6228c89970bbfb001898c9fc", "status": "PARTIALLY_REFUNDED", "totalAuthorizedAmount": 14, "totalCapturedAmount": 14, "totalDisbursedAmount": 0, "totalRefundedAmount": 10 }, "response": { "acquirerCode": "00", "cardSecurityCode": { "acquirerCode": "M", "gatewayCode": "MATCH" }, "gatewayCode": "APPROVED" }, "result": "SUCCESS", "sourceOfFunds": { "provided": { "card": { "brand": "", "expiry": { "month": "6", "year": "22" }, "fundingMethod": "CREDIT", "number": "512345******2346", "scheme": "MASTERCARD", "storedOnFile": "NOT_STORED" } }, "type": "CARD" }, "timeOfLastUpdate": "2022-04-13 10:44:46.764000+00:00", "timeOfRecord": "2022-04-13 10:44:46.724000+00:00", "transaction": { "acquirer": { "batch": 20220413, "date": "0413", "id": "QNBAAIH_S2I", "merchantId": 79447918, "settlementDate": "2022-04-13", "timeZone": "+0200", "transactionId": "123456789" }, "amount": 10, "currency": "EGP", "id": "TX-69827599", "receipt": "210310200874", "source": "INTERNET", "stan": "200874", "terminal": "80000145", "type": "REFUND" }, "version": "62" }, "cardOrderId": "93c799ea-ae6c-485c-bf36-a385acbb8c13", "creationDate": "2022-04-13 10:44:46.724000+00:00", "orderReference": "TEST-ORD-37089" }, "messages": { "en": "Congratulations! Your refund was successful", "ar": "تهانينا! تمت معاملة استرداد الأموال بنجاح" }, "status": "SUCCESS"}Performs an operation against an existing order, selected by the apiOperation field in the body:
- REFUND — repay your customer in part or fully. For partial refunds pass an amount in transaction. The refund amount must not exceed the amount of the original transaction. Refunds use your available Kashier balance (pending balance excluded). Refund statuses: SUCCESS (processed by the processor), FAILURE (cannot be processed; your account is credited with the refund amount), PENDING (initiated, waiting for the processor).
- VOID — cancel the order's transaction amount fully or partially. You can cancel a pay, refund, authorize, or capture transaction; pass the targetTransactionId returned in a previous response.
- CAPTURE — capture a previously authorized amount fully or partially. You should capture the amount before 7 or 30 days depending on your configuration. The Authorization Capture feature must be enabled by contacting your account manager or customer success. Releasing an authorized amount back to the customer is done with the VOID operation.
Authentication. Send your secret key in the Authorization header, as you
do for the Dashboard API. This route is not the same as the pay call: creating an
order (POST /v3/orders) is gated by a Kashier-Hash header and takes no secret
key, while refund, void and capture are authenticated further down the chain by
your secret key, and refund and void additionally require the refund permission on
the key's role. Kashier has not published a Kashier-Hash string-to-sign for this
route — the documented signed strings cover only the create/pay, tokenization,
3DS-resume and session-create calls — so send Authorization and no hash. If your
account rejects an update with INVALID_HASH_CHECK, that is an unconfirmed case to
raise with Kashier support.
Authorization
secretKey Merchant secret key used to identify the merchant, obtained from Kashier's dashboard. Pass the raw secret key value in the Authorization header (NOT a "Bearer" token).
In: header
Path Parameters
Kashier Order Id
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Refund an order (partially or fully). Refunds use your available Kashier balance.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
Export transaction batches GET
Exports transaction data based on specific filters such as status and date range. It's typically used for reporting, reconciliation, and data analysis by aggregators or merchants. The export is del…
Refund an order PUT
Repays your customer, in part or in full, from your available Kashier balance. This is the same operation as PUT /v3/orders/{orderId} with apiOperation: REFUND, one hop closer. The checkout host (t…