20. Sale/Expense Cancellation

This service should be used to cancel a purchase transaction.

Sale/Expense Cancellation

POST{{WalletUrl}}/api/v1/wallet/purchase/cancel

Note: To use this service, it is mandatory to include the apikeypublic and apiclientpublic parameters in the Header field.

WalletAPI Address

The parameters that need to be sent to the service are as follows:

Parameter
Type
Compulsory
Description

apikeypublic

string

Yes

The general key used for API access.

apiclientpublic

string

Yes

The general key that defines the client application.

{
  "ExternalReference": "bea70a60-c631-4c3e-963a-6188ef449601",
  "RollbackFee": true,
  "RollbackCashback": true
}

Service Request

Parameter
Type
Description

ExternalReference

string

The tracking number for the sale/expense transaction. It is the value provided by you at the time the transaction occurs.

RollbackFee

bool

Should the commissions applied (if any) be reversed as a result of the transaction?

RollbackCashback

bool

Should the cashback applied (if any) be reversed as a result of the transaction?

{
    "IsSuccess": true,
    "IsFailure": false,
    "Value": {
        "Id": "e1638d79-b78b-4052-934d-9ff49318a981",
        "WalletId": "7883fb19-2359-4a9b-b917-f08a259898ed",
        "Alias": "2816220769",
        "TransactionType": "Cancel",
        "Amount": 10.00,
        "GiftAmount": null,
        "Description": "Cancel of Purchase 6ddf4d59-34f9-447a-9168-c1846bdb5d79",
        "ExternalReference": "6ddf4d59-34f9-447a-9168-c1846bdb5d79",
        "CreatedAt": "2025-08-20T11:57:27.0020678Z",
        "UpdatedAt": null,
        "BalanceAfterTransaction": 99903.80,
        "SourceWalletId": null,
        "DestinationWalletId": null,
        "GiftBalanceId": null,
        "MainTransactionId": "24d912c2-11b1-4fdf-b0e7-6483e526e523",
        "UniqueCode": "744ee08b-33c2-4e5c-be07-336798b08fce",
        "UsedGiftBalances": null,
        "CashbackAmount": 0
    }
}

Service Response

Parameter
Type
Description

IsFailure

bool

It returns true if the service call failed, otherwise false.

IsSuccess

bool

It returns true if the service call was successful, otherwise false.

Errors

Array

It contains the error messages encountered during the transaction.

Value

Array<Items>

It is the list of data returned in the case of a successful response.

Service Response (Value)

Parameter
Type
Description

Id

Guid

Unique identifier generated by the system for the transaction

WalletId

String

Identifier of the wallet to which the transaction belongs

TransactionType

String

Specifies the type of the transaction (e.g., payment, refund, etc.)

Amount

Decimal

Total amount of the transaction

GiftAmount

Decimal

Amount used from the bonus balance

Description

String

İşleme ait açıklama ya da not.

ExternalReference

String

Sistem dışı kaynaklardan gelen referans kodu.

CreatedAt

DateTime

İşlemin oluşturulduğu tarih/zaman.

UpdatedAt

DateTime

İşlemin son güncellendiği tarih/zaman.

BalanceAfterTransaction

Decimal

İşlem sonrası kalan cüzdan bakiyesi.

SourceWalletId

String

İşlemi başlatan cüzdanın kimliği (varsa).

DestinationWalletId

String

İşlemin gönderildiği cüzdan kimliği (varsa).

GiftBalanceId

Guid

Kullanılan hediye bakiyesi kaydının ID’si.

MainTransactionId

Guid

Bu işlem başka bir ana işleme bağlıysa o işlemin ID’si.

UniqueCode

String

İşlemi tanımlayan benzersiz kod.

UsedGiftBalances

List

Kullanılan hediye bakiyelerine dair liste.

CashbackAmount

Decimal

Bu işleme bağlı kazanılan cashback (iade) tutarı.

Last updated