Get Sale

Service Address

Request Parameters

DealerSaleAuthentication

Parameter Explanation
DealerCode(string) Dealer code issued by the Moka system
Username (string) Api username given by Moka system
Password (string) Api password given by Moka system
CheckKey (string) The control key (DealerCode + "MK" + Username + "PD" + Password) is created by passing this information, combined as a String, through the SHA-256 hash algorithm.
Click here to go to the trial screen.

DealerSaleRequest

Parameter Explanation
DealerSaleId (integer) On the Moka side, it is the Unique ID of the sale. Not required if SaleCode is submitted.
SaleCode (string) On the dealer side, it is the code of the sale. Not required if DealerSaleId is submitted.

Sample Request (JSON)


{
	"DealerSaleAuthentication": {
		"DealerCode": "xxx",
		"Username": "xxx",
		"Password": "xxx",
		"CheckKey": "aabbccddeeff"
	},
	"DealerSaleRequest": {
		"DealerSaleId": "",
		"SaleCode": "satis"
	}
}

Successful Request Result

Parameter Explanation
DealerSaleId (integer) On the Moka side, it is the Unique ID of the sale.
SaleCode (string) On the dealer side, it is the code of the sale.
CustomerCode (string) On the dealer side, it's the customer's code. Not required if DealerCustomerId is sent.
DealerCustomerId (integer) On the Moka side, it is the Unique ID of the customer. Not required if CustomerCode is sent.
ProductCode (string) On the dealer side, it is the code of the product. Not required if DealerProductId is sent.
DealerProductId (integer) On the Moka side, it is the Unique ID of the product. Not required if ProductCode is submitted.
SaleCode (string) On the dealer side, it is the code of the sale. Not required, if not sent new guid will be created (Max 100 chars)
Amount (decimal) The amount to be charged on each payment. (Note: it is not the total sales amount!) (For example: It is written in 25.45 format.)
Currency (string) Not mandatory, if not sent, TL is accepted (TL, USD, EUR)
InstallmentNumber (integer) Not mandatory, if not sent, one shot is accepted (1..12)
DealerSaleScheduleId (integer) The ID of the time program (If PlanType : 2 is to be given, the system will reset it to zero even if the value is entered in this field, so it will work even if it is not sent at all)
SaleDate (date) Date of sale (in YYYYMMDD format, ex: "20170918"))
BeginDate (date) From what date will the payments for this sale begin? (in YYYYMMDD format, ex: "20170918")
EndDate (date) What date will the payments for this sale end? If an end date is not given (an empty string is sent or this field is not sent at all), regular withdrawals will continue until the sale is deleted or the EndDate is updated (in YYYYMMDD format, eg "19901218")
HowManyTrial (integer) Not required, 1 is accepted if not submitted. (How many more days will be attempted if the card is unsuccessful)
Description (string) Not required, description detail field (Max 200 chars)
PlanType (integer) It is not mandatory, it is accepted as 1 if it is not sent (1: Payment steps are created automatically according to the given time schedule, 2: Payment steps must be created manually, 3: Payment steps can be created both manually and automatically.) If the payment step is to be created manually, this service will be DealerSaleScheduleId : 0 pulls to .
DealerCustomerTypeId (integer) If payment is to be made by sending a payment request to the customer, not from a hidden card, the customer type ID is entered in this field. The Dealer-specific Customer type is created by Moka and this Id is forwarded to the dealer who will send the payment request in advance.
DefaultCard1Token (guid) From which card will the payment be made?.
DefaultCard2Token (guid) If payment cannot be made from the first card, which card will be tried.
DefaultCard3Token (guid) If the first 2 cards do not work, which card will be tried last.

Successful Result Examplei


{
	"Data": {
		"DealerSaleId": 1003,
		"SaleCode": "satis",
		"DealerCustomerId": 1034,
		"CustomerCode": "Customer",
		"DealerProductId": 1009,
		"ProductCode": "Product01",
		"Amount": 1,
		"Currency": "TL",
		"InstallmentNumber": 1,
		"DealerSaleScheduleId": 1005,
		"SaleDate": "20170821",
		"BeginDate": "20170821",
		"EndDate": "20171230",
		"HowManyTrial": 1,
		"Description": "",
		"PlanType": 1,
		"DealerCustomerTypeId": 0,
		"DefaultCard1Token": "9de41bb0-e82f-4670-b36b-d71ff27a3111",
		"DefaultCard2Token": "",
		"DefaultCard3Token": ""
	},
	"ResultCode": "Success",
	"ResultMessage": "",
	"Exception": null
}

Failed Request Result

ResultCodeExplanation
DealerSale.GetSale.InvalidRequestThe CheckKey may be bad, or the object may be bad, or the JSON may be corrupt.
DealerSale.GetSale.SaleCodeOrDealerSaleIdMustBeGivenSales code or dealer sales id must be entered.
DealerSale.GetSale.DealerSaleNotFundNo dealers found.
DealerSale.GetSale.SaleCodeDoesntMatchDealerSaleId Sales code and dealer sales id do not match.
EX An unexpected error has occurred

Example of Failed Result


{
	"Data": null,
	"ResultCode": "DealerSale.GetSale.DealerSaleNotFound",
	"ResultMessage": "",
	"Exception": null
}