iOS Integration

Step 1: Create order from your server.

Sandbox Endpoint:

Request Data:


AppidMandatory StringYOUR APPID is different for test and production
AppsecretMandatory StringYOUR APPSECRET is different for test and production
Content-TypeMandatory StringApplication/json


SL no.ObjectParameterTypeDescription
1orderidMandatory Stringorder id which will be unique for all future communication as moid. if you have only cart id then you can send cart id in "id" as well as in "cart_id"
2ordercart_idOptional String
3orderstatusMandatory StringPending would be first order status
4ordersubtotalMandatory Float (2 digits after decimal)total cart value before applying discount
5ordertotal_line_itemsMandatoryInteger number of unique sku's in the order
6ordertotal_line_items_quantityMandatoryInteger total number of items
7ordertotal_tax MandatoryFloat (2 digits after decimal)total calculated tax
8ordertotal_shippingMandatoryFloat (2 digits after decimal)total shipping charges
9ordertotal_discount MandatoryFloat (2 digits after decimal)total discount amount on order value
10ordertotal MandatoryFloat (2 digits after decimal) total = subtotal + total_tax + total_shipping - total_discount(discount due to promocode or cashback discount )
11orderpromo_codeMandatory Stringpromo code applied
12ordersourceMandatory StringExample: organic/facebook/instagram/others
13ordercustomer_ipMandatory StringExample: ""
14ordercustomer_user_agentMandatory StringExample : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:86.0) Gecko/20100101 Firefox/86.0"
15payment_detailsmethod_idMandatory Stringeither "upi" or "cod" both in small case
16line_itemsproduct_idVarchar id of the product, which is used to list the product on the store
17line_itemsline_item_idVarchar line_item id which type of product
18line_itemsvariant_idVarchar variation if for the product
19line_itemsnameStringname of the product
20line_itemsskuMandatory Stringsku of the product
21line_itemspriceMandatory Float (2 digits after decimal)maximum retail price of that product
22line_itemsquantityMandatory Integerquantity of the product
23line_itemssubtotalFloat (2 digits after decimal)Sale price of the products in this line item
24line_itemstotalMandatory Float (2 digits after decimal)total of all the products in line_item after discount, tax and shipping
25line_itemstaxFloat (2 digits after decimal)calculated value for tax
26line_itemsproduct_url Stringurl of the product page
27line_itemsproduct_thumbnail_urlStringurl of the thumbnail image of the product
28productany fieldJsonObjecthere you need to add product more details like colour, size, etc..
29shipping_addressfirst_nameMandatory Stringfirst name of user
30shipping_addresslast_nameMandatory Stringlast name of user
31shipping_addresscompanyStringcompany name of user
32shipping_addressaddress_1Mandatory Stringaddress line 1
33shipping_addressaddress_2Stringaddress line 2
34shipping_addresscityOptional Stringdelivery city
35shipping_addressstateMandatory Stringdelivery state
36shipping_addresspostcodeMandatory Stringdelivery postcode
37shipping_addressemailStringemail id of user
38shipping_addressphoneVarchar Limit10phone number of user
39billing_addressfirst_nameMandatory Stringfirst name of user
40billing_addresslast_nameStringlast name of user
41billing_addresscompanyStringcompany name of user
42billing_addressaddress_1Mandatory Stringaddress line 1
43billing_addressaddress_2Stringaddress line 2
44billing_addresscityMandatory Stringaddress city
45billing_addressstateMandatory Stringaddress state
46billing_addresspostcodeMandatory Stringaddress postcode
47billing_addressemailStringemail id of user
48billing_addressphoneVarchar limit10phone number of user
Curl Example:
curl --location --request POST '' --header 'appid: YOUR APPID' --header 'appsecret: YOUR APPSECRET' --header 'content-type: application/json' --data-raw '{
    "order": {
        ^"id": "240", (string)
        ^"cart_id": "240", (string)
        "status": "pending",(string)
        *"subtotal": "800", //total sale price of line items (string)
        *"total_line_items": "1", (string)
        *"total_line_items_quantity": "1", (string)
        *"total_tax": "160", //tax for entire order (string) 
        *"total_shipping": "50.0", //shipping charges (string)
        *"total_discount": "100", //promo_code related discount or cashback discount (string)
        *"total": "910", // total = subtotal + total_tax + total_shipping - total_discount(discount due to promocode or cashback discount )(string)
        *"source":"organic", //"organic/facebook/instagram/others"(string)+
        *"payment_details": {
            *"method_id": "upi/cod"
        *"billing_address": {
            *"first_name": "Test",
            *"last_name": "Shop",
            "company": "Test",
            *"address_1": "Test",
            "address_2": "",
            *"city": "Delhi",
            *"state": "DL",
            *"postcode": "110092",
            *"country": "IN",
            "email": "",
            "phone": "99XXXXXX99" // 10 digit phone number
        *"shipping_address": {
            *"first_name": "",
            *"last_name": "",
            "company": "",
            *"address_1": "",
            "address_2": "",
            *"city": "",
            *"state": "",
            *"postcode": "",
            *"country": "",
            "email": "",
            "phone": "99XXXXXX99" // 10 digit phone number
        *"customer_ip": "",
        *"customer_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:86.0) Gecko/20100101 Firefox/86.0",
        *"line_items": [{
            *"product_id": "15",
            "line_item_id" : "id_of_line_item", //can be set as "", this is the sub-order id of an order can have all items as same line_item_id if they have same awb 
            *"variant_id": "0",  // this should be uniq acorss all products.
            "product": {},
            *"name": "Beanie",
            *"sku": "",
            *"price": 1000, //MRP 
            *"quantity": 1,
            "subtotal": "800", // Sale price
            *"total": "800",
            "tax": "0",//
            "awb_number":"", // for initition you can send it blank
            *"product_url": "",
            *"product_thumbnail_url": ""


"statusCode": 200,
"statusMessage": "Placed",
"data": {
    "request_id": "95421d15-c62d-90c64-9673-ee6d37e35374",
    "gokwik_oid": "KWIKOIO8WXO6013589",
    "order_status": "Pending",
    "total": "36.00",
    "moid": "245",
    "mid": "sample_id_by_gokwik",
    "phone": "9876543210",
    "order_type": "upi"
  "statusCode": 201,
  "statusMessage": "Order already exist!"
  "statusCode": 404,
  "statusMessage": "Merchant not registered!"
  "statusCode": 400,
  "statusMessage": "Order Failed"
  "statusCode": 500,
  "statusMessage": "Oops!! Something went wrong"


Either cart_id or moid must be present when placing the order

Step 2: Adding Gokwik framework in your project

Download SDK and go to your Project Inspector’s General tab and scroll down to where it says, “Add framework, libraries and embedded content here.” Click the + button and then Add Other.

A Finder window will drop down, and here you need to select the GokwikUpi.xcodeproj framework. You’ll notice that our Framework was added to the Project Navigator!

(Refer screenshots)

Now go back to Embedded Binaries and click the + button again. This time you will see the framework that we added! Click on it to add it to the project’s Embedded Binaries.

Step 3: Using Gokwik framework in your project

You need to add the names of all UPI payment apps in info.plist file that you want to support.

Add these lines to info.plist file


Now go to ViewController.swift file and import GokwikUpi just below import UIKit.

Step 4: Open Gokwik app for payment from your ViewContoller.swift file when the customer clicks on the payment button.

Initialize GokwikCheckoutViewController with required data and implements GokwikPaymentStatusDelegate for success or failure

Use navigation controller to open GokwikCheckoutViewController and pass required data received from create order api in [String: Any] format

Request Data :
let dict =  [
    "request_id": request_id,
    "gokwik_oid": gokwik_oid,
    "total": 36.00,
    "moid": 245,
    "mid":mid ,
    "phone": phoneNumber,
    "order_type": "upi/cod"
Request Data :
let gwPayment = GokwikCheckoutViewController(createData: dict, production: true/false)
gwPayment.gokwikPaymentStatusDelegate = self
self?.navigationController?.pushViewController(gwPayment, animated: true)

Implementing GokwikPaymentStatusDelegate for success or failure.

extension ViewController: GokwikPaymentStatusDelegate {
    func gokwikPayment(status: Bool, data: [String : Any]) {      

BASE URL: base URL for test and production environment

Test Server:

Production Server:

Other important info:

appid: YOUR APPID.


Above two things you need to send in order create API that you will get once you register with GoKwik.