Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

End Point

https:

...

//app.browntape.com/0.1/orders/add.json

Table of Contents

Parameters

Code Block
?username=XXXXXXXXXX
&auth_string=YYYYYYYYY

...

Code Block
{
  data: [
    {
      "order_reference": "12345678909090", //mandatory
      "channel_id": "68", //mandatory
      "channel_warehouse_code": "MyWarehouse", //optional
      "created": "2016-12-08 20:12:25", //mandatory
      “currency_id”: 1, //optional, if not set, user currency assumed
      “Is_replacement”: 1, //optional, if replacement order being passed
      “replaced_order_id”: 7346988742, //optional
      BTorderid"customer": { //mandatory
        "firstname": "Albert",
        "lastname": "Pinto",
        "email": "albert.pinto@xyz.com"
      },
      "shipping_address": { //mandatory
        "firstname": "Albert",
        "lastname": "Pinto",
        "email": "albert.pinto@xyz.com",
        "address_1": "BATA SHOWrOOM",
        "address_2": " PANJIM",
        "address_3": " Alto",
        "city": "PORVORIM",
        "zip": "403521",
        "state": "Goa",
        "country_code": "IN",
        "country": "India",
        "phone": "9898989898""gstin": "22AAAAA0000A1Z5" //(optional)
      },
      "is_billing_address_same_as_shipping": "N", //(Optional) takes Y and N only
      "billing_address": { //Optional
        "firstname": "Albert",
        "lastname": "Pinto",
        "email": "albert.pinto@xyz.com",
        "address_1": "BATA SHOWrOOM",
        "address_2": " PANJIM",
        "address_3": " Alto",
        "city": "PORVORIM",
        "zip": "403521",
        "state": "Goa",
        "country_code": "IN",
        "country": "India",
        "phone": "9898989898",
        "gstin": "22AAAAA0000A1Z5"//(optional)
      },
      "financial_status": "paid", //recommended, else 'unknown' status saved
      "fulfillment_status": "processing", //recommended, else 'unknown' status saved
      "amount": 335, //mandatory
      "shipping_value": 20, //(optional)
      "giftwrap_charges": 10, //(optional)
      "cod_fees_value": 40, //(optional)
      "discount": 15, //(optional)
      "discount_description": "Coupon SAVE 20%", //(optional, will be saved only if discount is mentioned)
      "executed_shipping_method": "Delhivery",
      //(optional)
      "tracking_number": "451716052126",
      //(optional)
      "order_reference2": "SLP1390296565", //(optional)
      "invoice_number": "36357", //(optional)
      "invoice_number_on_channel": "F0ID7GJ17-00003724", //(optional)
      "imei_number": "1234589552", //(optional)
      "item_titles_orders": [
        {
          "name": "Apple iPhone 4Sx", //mandatory
          "sku": "P1_red", //recommended,
          elseordershowsas'unmapped'"sku_reference": "QQE234", //optional-referenceforsku
          "quantity": 1, //mandatory
          "price": 145, //mandatory
          "total": 145, //mandatory
          "item_discount": 15, //optional
          "item_discount_description": "Coupon APPLE30", (optional, will be saved only if item_discount is mentioned)
          "tax": 6.9047619047619,
          “dispatch_by_date”: “2016-12-1120: 12: 25” // (optional)
        },
        {
          "name": "Apple iPhone 4C",
          "sku": "P1_black",
          "quantity": 2,
          "price": 145,
          "total": 290,
          "item_discount": 15, //optional
          "item_discount_description": "Coupon APPLE30", // (optional, will be saved only if item_discount is mentioned)
          "tax": 6.9047619047619,
          “dispatch_by_date”: “2016-12-1120: 12: 25” //optional
        }
      ],
      “transactions”: [
        {
          "source": "Gift Card",
          "source_transaction_ref": "GFT12345", //has to be unique for order
          "gross_value": 200,
          "fees_value": 0,
          "currency_id": 63
        },
        {
          "source": "credit_card",
          "source_transaction_ref": "ABCD12345",
          "gross_value": 210,
          "fees_value": 0,
          "currency_id": 63,
          "note": "balance money paid on cc"
        }
      ]
    }
  ]
}

Success Response

...

Code Block
{
  "success": true,
  "data": {
    "Orders": [
      {
        "status": true,
        "data": "OrderId:98204"#BTOrderID,
        DetailscanbefetchedviaOrdersGetcall
      }
    ]
  }
}

Error Response

...

Code Block
{
  "success": true,
  "data": {
    "Orders": [
      {
        "status": false,
        "data": [
          "0 : Customer Details Missing"
        ]
      }
    ]
  }
}

Currency Business Rules

...

  • If no currency_id is passed, then the currency of api user will be used

  • If order currency is passed, then order, items, discounts & transaction will get the same currency

  • For transactions, a separate currency_id (diff from order currency) can be passed. This is for cases if the part payment is collected in a diff currency than order.

  • In BT UI, order shows up in the currency chosen by the user. The conversion here is estimated based on XE conversion rates. In the order view page, the original currency of the order is displayed