Credit

This API can be used to issue credit to a card.

POST https://<PayEngine-host>/api/payment/credit

Request Body

Name
Type
Description

id*

string

The Transaction/Payment UUID of the original transaction to which the credit should be applied

data.transaction_amount*

string

Amount to be returned. Should be less or equal to available transaction amount

data.card_token

string

Card token generated by PayEngine secure field API

data.description

string

Transaction description. Character limit is 255

data.metadata

string

Add any additional metadata by passing a json object

data.gateway_id

string

Gateway ID (optional, if multigateway mode enabled)

Field Name
Type
Description
Required?

id

string

PayEngine payment ID for the sale request

Required

transaction_id

string

Unique transaction ID

Required

gateway_id

string

ID of the gateway through which the transaction is processed.

Optional

merchant_id

string

Merchant ID

Required

description

string

Transaction description provided in the request

Optional

return_response

object

Refer to Credit Card Sale (SaleResponse)

Required

metadata

object

Return all the metadata sent in the request

Optional

Sample Request / Response

Example Request

{
    "id": "9a0df7ef-b77f-4525-97e1-f41a98ad7f75",
    "data": {
        "transaction_amount": "110.00",
        "card_token": "card_sandbox_xxxx",
        "description": "Payment for the services",
        "metadata": {
            "customer_id": "123",
            "email" : "[email protected]"
        }
    }
}

Webhook event: PAYMENT_REFUNDED

Webhook Payload Example

{
    "event_uid": "86ecde28452184587aed8084b32c29dd",
    "event": "PAYMENT_REFUNDED",
    "data": {
        "metadata": {
            "email": "[email protected]",
            "customer_id": "123"
        },
        "account_id": "fa3ac0a8-0cda-4e38-ba9d-357b0f0bd844",
        "description": "Payment for the services",
        "merchant_id": "1e4e6029-2cc9-4b2c-87c1-7a4b2af6d6c6",
        "gateway_id": "1f3e0f67-d560-494c-bb1a-97558a462cc5",
        "transaction_id": "3bf3f992-f908-4863-8a7c-575e8ad55ca4",
        "return_response": {
            "status": "PASS",
            "task_id": "46505433",
            "auth_code": "196811",
            "card_type": "visa",
            "total_amount": "5.00",
            "response_code": "A0000",
            "transaction_id": "31472619",
            "returned_amount": "5.00",
            "customer_receipt": "        Sandbox US Merchant         \\n        200 Epcot Center Dr         \\n         Orlando, FL 32836          \\n            800-490-8514            \\n                 \\n                 \\n        2025-04-02 07:05 PM         \\n           CREDIT - SALE            \\n         Entry Mode : KEYED         \\n      Transaction ID: 31472619      \\nDescription: Payment for the service\\n                 s                  \\n        SUBTOTAL: USD $5.00         \\n          TOTAL: USD $5.00          \\n                 \\n                 \\n       NO SIGNATURE REQUIRED        \\n              APPROVED              \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n           Customer Copy            \\n",
            "merchant_receipt": "        Sandbox US Merchant         \\n        200 Epcot Center Dr         \\n         Orlando, FL 32836          \\n            800-490-8514            \\n                 \\n                 \\n        2025-04-02 07:05 PM         \\n           CREDIT - SALE            \\n         Entry Mode : KEYED         \\n      Transaction ID: 31472619      \\nDescription: Payment for the service\\n                 s                  \\n        SUBTOTAL: USD $5.00         \\n          TOTAL: USD $5.00          \\n                 \\n                 \\n      X_______________________      \\nI AGREE TO PAY ABOVE TOTAL AMOUNT IN\\n ACCORDANCE WITH CARD ISSUER's AGREE\\nMENT (MERCHANT AGREEMENT IF CREDIT V\\n              OUCHER)               \\n     KEEP COPY FOR YOUR RECORDS     \\n               \\n \\n                \\n              APPROVED              \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n                 \\n           Merchant Copy            \\n",
            "processed_amount": "5.00",
            "response_message": "Success",
            "host_response_code": "00",
            "masked_card_number": "1111",
            "transaction_amount": "5.00",
            "host_reference_number": "519296901614",
            "transaction_timestamp": "2025-04-02T19:05:41",
            "address_verification_code": "X",
            "card_holder_verification_code": "N"
        }
    }
}

Last updated