     ///   - onSuccess: success callback
     ///   - onError: fail callback
     public func applyCouponToPayment(transactionId: String, code: String, userToken: String, onSuccess: @escaping () -> Void, onError: @escaping ErrorHandler) {
-        let url = URLBuilder(client: client)
+        
+        let builder = URLBuilder(client: client)
             .setPath("shop/\(transactionId)/coupon")
             .addParameter(key: "usertoken", value: userToken)
-            .build()
+        
+        guard let requestURL = try? builder.build() else {
+            return onError(APIError.getDefaultError())
+        }
 
         let params = ["code": code]
 
-        client.restClient.POST(url: url, parameters: params, onSuccess: { (_) in
+        client.restClient.POST(request: requestURL, parameters: params, onSuccess: { (_) in
             onSuccess()
         }, onError: onError)
     }
 
     public func removeCouponToPayment(transactionId: String, userToken: String, onSuccess: @escaping () -> Void, onError: @escaping ErrorHandler) {
-        let url = URLBuilder(client: client)
+        
+        let builder = URLBuilder(client: client)
             .setPath("shop/\(transactionId)/coupon")
             .addParameter(key: "usertoken", value: userToken)
-            .build()
-
-        client.restClient.DELETE(url: url,  parameters: [:], onSuccess: { (_) in
+        
+        guard let requestURL = try? builder.build() else {
+            return onError(APIError.getDefaultError())
+        }
+
+        client.restClient.DELETE(request: requestURL, parameters: [:], onSuccess: { (_) in
             onSuccess()
         }, onError: onError)
     }

    ///     - userToken: user token
    ///     - onSuccess: success callback
    ///     - onError: fail callback with APIError
    public func updateTransactionWithCoupon(_ transactionId: String, userToken:  String, onSuccess: @escaping (_ transaction: TransactionData) -> Void,
        onError: @escaping ErrorHandler) {
 
        let url = URLBuilder(client: client)
            .setPath("shop/\(transactionId)")
            .addParameter(key: "usertoken", value: userToken)
            .build()
 
        client.restClient.GET(url: url, onSuccess: { (response) in
             guard let transaction = JSONDecoder().decodeDict(of:  TransactionData.self, from: response) else {
                    onError(APIError.getDefaultError())
                    return
             }

        }, onError: onError)
    }

    /// Apply coupom in transaction
    ///
    /// - Parameters:
