انتقل إلى المحتوى الرئيسي

Switch Result Endpoint

GET /api/e-payment/switch/start

Parameters

ResourcePath: the uri to check the status of the payment
Id: the checkout id

Responses

1- Success

Status Code: 200 - OK

info: retruns transaction details

body:

{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"paymentGatewayId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"orderId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "Pending",
"amount": 0,
"paymentId": "string",
"integrity": "string",
"resourcePath": "string",
"resultCode": "string",
"resultDescription": "string",
"doneAt": "2025-09-17T15:03:49.195Z",
"paymentType": "ZainCash",
"createdAt": "2025-09-17T15:03:49.195Z",
"frontendRedirectUrl": "string",
"customer": {
"id": "string",
"name": "string",
"image": "string",
"email": "string",
"address": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"businessId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"customerId": "string",
"name": "string",
"country": "string",
"state": "string",
"city": "string",
"line1": "string",
"line2": "string",
"zipCode": "string",
"phoneNumber": "string",
"createdAt": "2025-09-17T15:03:49.195Z",
"latitude": 0,
"longitude": 0
}
}
}

2- redirect

Status Code: 302 - Found

info: redirect the user to the frontendRedirectUrl and adds two get parameters status & transactionId.

3- resourcePath is required

Status Code: 400 - Bad Request

info: the get parameter resourcePath is required.

body:

resourcePath is required

4- transaction not found

Status Code: 404 - Not Found

info: transaction with the id is not found

body:

transaction not found

5- transaction already done

Status Code: 400 - Bad Request

info: that means the transaction already has resourcePath which means its done

body:

transaction already done

6- payment type is not online

Status Code: 404 - Not Found
info: the order is not of payment type online
body:

payment type is not online

7- payment gateway not found

Status Code: 404 - Not Found
info: payment gateway not found
body:

payment gateway not found

8- invalid payment gateway type

Status Code: 400 - Bad Request

info: the payment gateway type is not valid

body:

invalid payment gateway type