Orders

Create order

This is where you can initiate an order with ShopBack, by using the initiateOrder method. We also provide a number of methods to refund orders. For example if the consumer returns one (or all) item(s) of an order, you can initiate a full or partial refund. You would be asked to send us the SKU number of the items to be refunded.

post/order/initiate

Request

Headers

Authorizationstring required

Authorization

X-ShopBack-Idempotent-Idstring
Example:faa5e09a-8cf3-43f7-8309-d94deb426e66

Idempotent Id for the request. If this is absent, every request will be treated as unique and will be processed as such. (This is optional for now, but will be made required in the future)

Request body */*

totalAmountnumber required

Total amount of order, includes all items

originalAmountnumber

Pre discount amount of order, includes all items

voucherCodestring

Any voucher code to be applied on order

discountnumber

The discount amount

consumerEmailstring

Consumer's email

consumerPhoneNumberstring

Consumer's Phone Number

callbackUrlstring

The server to server payment notification (payment notification webhook). Refer here for more details

closeUrlstring

The URL to which merchant would like to redirect users once the charging is completed for failed transaction

returnToShopUrlstring

The URL to which merchant would like to redirect users once transaction is completed for successful transaction

platformVersionstring

Platform Version

consumerPhoneNumberExtensioninteger

Consumer's country code

consumerTitlestring

Title of the consumer

consumerFirstNamestring

Consumer's First Name

consumerLastNamestring

Consumer's Last Name

consumerMiddleNamestring

Consumer's Middle Name

taxAmountnumber

Total tax for the order

currencystring required

Currency of the order in the 3 figure code as per ISO 4217

shippingMethod'NORMAL' | 'EXPRESS' | 'PICKUP' | 'FREE' | 'MERCHANT_SPECIFIED'

Shipping method preferred for order

merchantRefstring

Merchant order reference. This is the field that the merchant uses to identify the order from their side on. This field is deprecated. Please use cartId or merchantOrderId depending on your order creation strategy.

shippingAmountnumber

This field captures the shipping fees associated with the chosen shipping method

merchantOrderIdstring

The final merchant order id. This is applicable for platforms which creates the order id as soon as the checkout process starts, for e.g. Woocommerce orders. Platforms such as Shopify does not create an order until the callback is triggered. Such platforms make use of an internal reference id, also called cart Id - use the field merchantRef for internal reference id.

cartIdstring

Merchant's cart id. This field stores the merchant's card id value. This is the internal order reference number until the order is created at the merchant's store.

storeUuidstring

Merchant's Online Store identifier at ShopBack side. If it is omitted latest created Online Store will be used

Example request

{
  "voucherCode": "FLAT50",
  "discount": 10,
  "consumerEmail": "bruce.willis@shopback.com",
  "consumerPhoneNumber": "+6512341234",
  "callbackUrl": "http://merchant.com/order/193123123/callback",
  "closeUrl": "http://merchant.com/order/193123123/close",
  "returnToShopUrl": "http://merchant.com/order/193123123/returnToShop",
  "platformVersion": "12.2.3",
  "consumerPhoneNumberExtension": 65,
  "consumerTitle": "Mr",
  "consumerFirstName": "Bob",
  "consumerLastName": "Mann",
  "consumerMiddleName": "John",
  "currency": "SGD",
  "shippingMethod": "NORMAL",
  "shippingAddress": {
    "line1": "Blk 35 Mandalay Road",
    "line2": "# 13-37 Mandalay Towers",
    "suburb": "Sentosa",
    "city": "Malacca City",
    "province": "Shanghai",
    "state": "Selangor",
    "district": "New Delhi",
    "subDistrict": "Kecamatan Walakaka",
    "municipality": "Sapporo",
    "village": "Kakran",
    "road": "111 Chaengwatthana Road",
    "county": "Pudong",
    "viaName": "New Delhi",
    "taluk": "Meenachil Taluk",
    "postcode": "308215",
    "countryCode": "SG"
  },
  "billingAddress": {
    "line1": "Blk 35 Mandalay Road",
    "line2": "# 13-37 Mandalay Towers",
    "suburb": "Sentosa",
    "city": "Malacca City",
    "province": "Shanghai",
    "state": "Selangor",
    "district": "New Delhi",
    "subDistrict": "Kecamatan Walakaka",
    "municipality": "Sapporo",
    "village": "Kakran",
    "road": "111 Chaengwatthana Road",
    "county": "Pudong",
    "viaName": "New Delhi",
    "taluk": "Meenachil Taluk",
    "postcode": "308215",
    "countryCode": "SG"
  },
  "items": [
    {
      "name": "radioactive man comic book",
      "sku": "93847598347",
      "description": "radioactive man comic book",
      "images": [
        {
          "imageLocation": "https://homepages.cae.wisc.edu/~ece533/images/serrano.png"
        }
      ],
      "warranty": 100,
      "discount": 10
    }
  ],
  "merchantRef": "abc1234xyz",
  "shippingAmount": 10,
  "cartId": "abc1234xyz",
  "storeUuid": "281ac28b-e785-429d-bf12-5a50e9db9377",
  "partner": {
    "merchantEntityId": "UEN in Singapore"
  }
}

Response

successful operation

orderContextTokenstring
orderIdinteger required
orderUuidstring

Changes

No recorded changes to this operation across all 2 revisions of this API.