How to add the payment transaction status in order placed by using Demandware OCAPI?












0















I'm developing API for the mobile app of e-commerce website which is on Demandware. I am using the OCAPI 18.8 to place an order and send the payment details to third-party payment processor which is Vantiv. I get the transaction ID and response code from Vantiv and want to update my order to store these payment transaction details into my order. But I could not find any resource in OCAPI which let me add the transaction Id and response code received from Vantiv. Below is the order which I have placed through OCAPI:



{
"_v": "18.8",
"_type": "order",
"_resource_state": "xyz",
"adjusted_merchandize_total_tax": 0,
"adjusted_shipping_total_tax": 0,
"billing_address": {
"_type": "order_address",
"city": "Boston",
"country_code": "US",
"first_name": "John",
"full_name": "John Martin",
"id": "xyz",
"last_name": "Martin"
},
"channel_type": "storefront",
"confirmation_status": "not_confirmed",
"created_by": "Customer",
"creation_date": "2018-11-20T10:37:58.055Z",
"currency": "USD",
"customer_info": {
"_type": "customer_info",
"customer_id": "xyz",
"customer_name": "Ammar Shahbaz",
"customer_no": "xyz"
},
"customer_name": "Ammar Shahbaz",
"export_status": "not_exported",
"last_modified": "2018-11-20T10:37:58.376Z",
"merchandize_total_tax": 0,
"notes": {
"_type": "simple_link",
"link": "link"
},
"order_no": "123",
"order_token": "xyz",
"order_total": 299.8,
"payment_instruments": [
{
"_type": "order_payment_instrument",
"amount": 299.8,
"payment_card": {
"_type": "payment_card",
"card_type": "Visa",
"credit_card_expired": false,
"expiration_month": 1,
"expiration_year": 2021,
"holder": "John Doe",
"masked_number": "************4240",
"number_last_digits": "4240"
},
"payment_instrument_id": "xyz",
"payment_method_id": "CREDIT_CARD"
}
],
"payment_status": "not_paid",
"product_items": [
{
"_type": "product_item",
"adjusted_tax": 0,
"base_price": 149.9,
"bonus_product_line_item": false,
"gift": false,
"item_id": "xyz",
"item_text": "Long Sleeve Sequin Shift Dress",
"price": 299.8,
"price_after_item_discount": 299.8,
"price_after_order_discount": 299.8,
"product_id": "xyz",
"product_name": "Dress",
"quantity": 2,
"shipment_id": "xyz",
"tax": 0,
"tax_basis": 299.8,
"tax_class_id": "xyz",
"tax_rate": 0,
"c_cost": 25.17,
"c_finalSale": false,
"c_outlet": false,
"c_taxClassID": "xyz"
}
],
"product_sub_total": 299.8,
"product_total": 299.8,
"shipments": [
{
"_type": "shipment",
"adjusted_merchandize_total_tax": 0,
"adjusted_shipping_total_tax": 0,
"gift": false,
"merchandize_total_tax": 0,
"product_sub_total": 299.8,
"product_total": 299.8,
"shipment_id": "xyz",
"shipment_total": 299.8,
"shipping_address": {
"_type": "order_address",
"city": "Boston",
"country_code": "US",
"first_name": "John",
"full_name": "John Martin",
"id": "xyz",
"last_name": "Martin"
},
"shipping_method": {
"_type": "shipping_method",
"description": "Order received within 5-8 business days",
"id": "xyz",
"name": "Standard",
"price": 0,
"shipping_promotions": [
{
"_type": "shipping_promotion",
"callout_msg": "Free shipping on U.S. orders of $125+",
"link": "link",
"promotion_id": "xyz",
"promotion_name": "Free Shipping With $125 Purchase"
}
],
"c_BxFlatrateFlag": false,
"c_IsBorderlinxMethod": false
},
"shipping_status": "not_shipped",
"shipping_total": 0,
"shipping_total_tax": 0,
"tax_total": 0
}
],
"shipping_items": [
{
"_type": "shipping_item",
"adjusted_tax": 0,
"base_price": 0,
"item_id": "xyz",
"item_text": "Shipping",
"price": 0,
"price_after_item_discount": 0,
"shipment_id": "xyz",
"tax": 0,
"tax_basis": 0,
"tax_class_id": "xyz",
"tax_rate": 0
}
],
"shipping_status": "not_shipped",
"shipping_total": 0,
"shipping_total_tax": 0,
"site_id": "site name",
"status": "created",
"taxation": "net",
"tax_total": 0


}



I have tried this resource



Patch /orders/{order_no}/payment_instruments/{payment_instrument_id} 
{
"amount" : 299.8,
"payment_card" : {
"number":"424459xxxxxx4240",
"security_code":"121",
"holder":"John Martin",
"card_type":"Visa",
"expiration_month":1,
"expiration_year":2021
},
"payment_method_id" : "CREDIT_CARD",
"c_PaymentProcessor": "VANTIV_CREDIT",
"c_paymentTransaction": {
"custom": {
"litleAFTresponse": "Approved",
"litleAFTTxnId": "8283868xxx8288282"
}
}


}



to update my order but no success.
Please let me know if you have any suggestion. Thanks.










share|improve this question





























    0















    I'm developing API for the mobile app of e-commerce website which is on Demandware. I am using the OCAPI 18.8 to place an order and send the payment details to third-party payment processor which is Vantiv. I get the transaction ID and response code from Vantiv and want to update my order to store these payment transaction details into my order. But I could not find any resource in OCAPI which let me add the transaction Id and response code received from Vantiv. Below is the order which I have placed through OCAPI:



    {
    "_v": "18.8",
    "_type": "order",
    "_resource_state": "xyz",
    "adjusted_merchandize_total_tax": 0,
    "adjusted_shipping_total_tax": 0,
    "billing_address": {
    "_type": "order_address",
    "city": "Boston",
    "country_code": "US",
    "first_name": "John",
    "full_name": "John Martin",
    "id": "xyz",
    "last_name": "Martin"
    },
    "channel_type": "storefront",
    "confirmation_status": "not_confirmed",
    "created_by": "Customer",
    "creation_date": "2018-11-20T10:37:58.055Z",
    "currency": "USD",
    "customer_info": {
    "_type": "customer_info",
    "customer_id": "xyz",
    "customer_name": "Ammar Shahbaz",
    "customer_no": "xyz"
    },
    "customer_name": "Ammar Shahbaz",
    "export_status": "not_exported",
    "last_modified": "2018-11-20T10:37:58.376Z",
    "merchandize_total_tax": 0,
    "notes": {
    "_type": "simple_link",
    "link": "link"
    },
    "order_no": "123",
    "order_token": "xyz",
    "order_total": 299.8,
    "payment_instruments": [
    {
    "_type": "order_payment_instrument",
    "amount": 299.8,
    "payment_card": {
    "_type": "payment_card",
    "card_type": "Visa",
    "credit_card_expired": false,
    "expiration_month": 1,
    "expiration_year": 2021,
    "holder": "John Doe",
    "masked_number": "************4240",
    "number_last_digits": "4240"
    },
    "payment_instrument_id": "xyz",
    "payment_method_id": "CREDIT_CARD"
    }
    ],
    "payment_status": "not_paid",
    "product_items": [
    {
    "_type": "product_item",
    "adjusted_tax": 0,
    "base_price": 149.9,
    "bonus_product_line_item": false,
    "gift": false,
    "item_id": "xyz",
    "item_text": "Long Sleeve Sequin Shift Dress",
    "price": 299.8,
    "price_after_item_discount": 299.8,
    "price_after_order_discount": 299.8,
    "product_id": "xyz",
    "product_name": "Dress",
    "quantity": 2,
    "shipment_id": "xyz",
    "tax": 0,
    "tax_basis": 299.8,
    "tax_class_id": "xyz",
    "tax_rate": 0,
    "c_cost": 25.17,
    "c_finalSale": false,
    "c_outlet": false,
    "c_taxClassID": "xyz"
    }
    ],
    "product_sub_total": 299.8,
    "product_total": 299.8,
    "shipments": [
    {
    "_type": "shipment",
    "adjusted_merchandize_total_tax": 0,
    "adjusted_shipping_total_tax": 0,
    "gift": false,
    "merchandize_total_tax": 0,
    "product_sub_total": 299.8,
    "product_total": 299.8,
    "shipment_id": "xyz",
    "shipment_total": 299.8,
    "shipping_address": {
    "_type": "order_address",
    "city": "Boston",
    "country_code": "US",
    "first_name": "John",
    "full_name": "John Martin",
    "id": "xyz",
    "last_name": "Martin"
    },
    "shipping_method": {
    "_type": "shipping_method",
    "description": "Order received within 5-8 business days",
    "id": "xyz",
    "name": "Standard",
    "price": 0,
    "shipping_promotions": [
    {
    "_type": "shipping_promotion",
    "callout_msg": "Free shipping on U.S. orders of $125+",
    "link": "link",
    "promotion_id": "xyz",
    "promotion_name": "Free Shipping With $125 Purchase"
    }
    ],
    "c_BxFlatrateFlag": false,
    "c_IsBorderlinxMethod": false
    },
    "shipping_status": "not_shipped",
    "shipping_total": 0,
    "shipping_total_tax": 0,
    "tax_total": 0
    }
    ],
    "shipping_items": [
    {
    "_type": "shipping_item",
    "adjusted_tax": 0,
    "base_price": 0,
    "item_id": "xyz",
    "item_text": "Shipping",
    "price": 0,
    "price_after_item_discount": 0,
    "shipment_id": "xyz",
    "tax": 0,
    "tax_basis": 0,
    "tax_class_id": "xyz",
    "tax_rate": 0
    }
    ],
    "shipping_status": "not_shipped",
    "shipping_total": 0,
    "shipping_total_tax": 0,
    "site_id": "site name",
    "status": "created",
    "taxation": "net",
    "tax_total": 0


    }



    I have tried this resource



    Patch /orders/{order_no}/payment_instruments/{payment_instrument_id} 
    {
    "amount" : 299.8,
    "payment_card" : {
    "number":"424459xxxxxx4240",
    "security_code":"121",
    "holder":"John Martin",
    "card_type":"Visa",
    "expiration_month":1,
    "expiration_year":2021
    },
    "payment_method_id" : "CREDIT_CARD",
    "c_PaymentProcessor": "VANTIV_CREDIT",
    "c_paymentTransaction": {
    "custom": {
    "litleAFTresponse": "Approved",
    "litleAFTTxnId": "8283868xxx8288282"
    }
    }


    }



    to update my order but no success.
    Please let me know if you have any suggestion. Thanks.










    share|improve this question



























      0












      0








      0








      I'm developing API for the mobile app of e-commerce website which is on Demandware. I am using the OCAPI 18.8 to place an order and send the payment details to third-party payment processor which is Vantiv. I get the transaction ID and response code from Vantiv and want to update my order to store these payment transaction details into my order. But I could not find any resource in OCAPI which let me add the transaction Id and response code received from Vantiv. Below is the order which I have placed through OCAPI:



      {
      "_v": "18.8",
      "_type": "order",
      "_resource_state": "xyz",
      "adjusted_merchandize_total_tax": 0,
      "adjusted_shipping_total_tax": 0,
      "billing_address": {
      "_type": "order_address",
      "city": "Boston",
      "country_code": "US",
      "first_name": "John",
      "full_name": "John Martin",
      "id": "xyz",
      "last_name": "Martin"
      },
      "channel_type": "storefront",
      "confirmation_status": "not_confirmed",
      "created_by": "Customer",
      "creation_date": "2018-11-20T10:37:58.055Z",
      "currency": "USD",
      "customer_info": {
      "_type": "customer_info",
      "customer_id": "xyz",
      "customer_name": "Ammar Shahbaz",
      "customer_no": "xyz"
      },
      "customer_name": "Ammar Shahbaz",
      "export_status": "not_exported",
      "last_modified": "2018-11-20T10:37:58.376Z",
      "merchandize_total_tax": 0,
      "notes": {
      "_type": "simple_link",
      "link": "link"
      },
      "order_no": "123",
      "order_token": "xyz",
      "order_total": 299.8,
      "payment_instruments": [
      {
      "_type": "order_payment_instrument",
      "amount": 299.8,
      "payment_card": {
      "_type": "payment_card",
      "card_type": "Visa",
      "credit_card_expired": false,
      "expiration_month": 1,
      "expiration_year": 2021,
      "holder": "John Doe",
      "masked_number": "************4240",
      "number_last_digits": "4240"
      },
      "payment_instrument_id": "xyz",
      "payment_method_id": "CREDIT_CARD"
      }
      ],
      "payment_status": "not_paid",
      "product_items": [
      {
      "_type": "product_item",
      "adjusted_tax": 0,
      "base_price": 149.9,
      "bonus_product_line_item": false,
      "gift": false,
      "item_id": "xyz",
      "item_text": "Long Sleeve Sequin Shift Dress",
      "price": 299.8,
      "price_after_item_discount": 299.8,
      "price_after_order_discount": 299.8,
      "product_id": "xyz",
      "product_name": "Dress",
      "quantity": 2,
      "shipment_id": "xyz",
      "tax": 0,
      "tax_basis": 299.8,
      "tax_class_id": "xyz",
      "tax_rate": 0,
      "c_cost": 25.17,
      "c_finalSale": false,
      "c_outlet": false,
      "c_taxClassID": "xyz"
      }
      ],
      "product_sub_total": 299.8,
      "product_total": 299.8,
      "shipments": [
      {
      "_type": "shipment",
      "adjusted_merchandize_total_tax": 0,
      "adjusted_shipping_total_tax": 0,
      "gift": false,
      "merchandize_total_tax": 0,
      "product_sub_total": 299.8,
      "product_total": 299.8,
      "shipment_id": "xyz",
      "shipment_total": 299.8,
      "shipping_address": {
      "_type": "order_address",
      "city": "Boston",
      "country_code": "US",
      "first_name": "John",
      "full_name": "John Martin",
      "id": "xyz",
      "last_name": "Martin"
      },
      "shipping_method": {
      "_type": "shipping_method",
      "description": "Order received within 5-8 business days",
      "id": "xyz",
      "name": "Standard",
      "price": 0,
      "shipping_promotions": [
      {
      "_type": "shipping_promotion",
      "callout_msg": "Free shipping on U.S. orders of $125+",
      "link": "link",
      "promotion_id": "xyz",
      "promotion_name": "Free Shipping With $125 Purchase"
      }
      ],
      "c_BxFlatrateFlag": false,
      "c_IsBorderlinxMethod": false
      },
      "shipping_status": "not_shipped",
      "shipping_total": 0,
      "shipping_total_tax": 0,
      "tax_total": 0
      }
      ],
      "shipping_items": [
      {
      "_type": "shipping_item",
      "adjusted_tax": 0,
      "base_price": 0,
      "item_id": "xyz",
      "item_text": "Shipping",
      "price": 0,
      "price_after_item_discount": 0,
      "shipment_id": "xyz",
      "tax": 0,
      "tax_basis": 0,
      "tax_class_id": "xyz",
      "tax_rate": 0
      }
      ],
      "shipping_status": "not_shipped",
      "shipping_total": 0,
      "shipping_total_tax": 0,
      "site_id": "site name",
      "status": "created",
      "taxation": "net",
      "tax_total": 0


      }



      I have tried this resource



      Patch /orders/{order_no}/payment_instruments/{payment_instrument_id} 
      {
      "amount" : 299.8,
      "payment_card" : {
      "number":"424459xxxxxx4240",
      "security_code":"121",
      "holder":"John Martin",
      "card_type":"Visa",
      "expiration_month":1,
      "expiration_year":2021
      },
      "payment_method_id" : "CREDIT_CARD",
      "c_PaymentProcessor": "VANTIV_CREDIT",
      "c_paymentTransaction": {
      "custom": {
      "litleAFTresponse": "Approved",
      "litleAFTTxnId": "8283868xxx8288282"
      }
      }


      }



      to update my order but no success.
      Please let me know if you have any suggestion. Thanks.










      share|improve this question
















      I'm developing API for the mobile app of e-commerce website which is on Demandware. I am using the OCAPI 18.8 to place an order and send the payment details to third-party payment processor which is Vantiv. I get the transaction ID and response code from Vantiv and want to update my order to store these payment transaction details into my order. But I could not find any resource in OCAPI which let me add the transaction Id and response code received from Vantiv. Below is the order which I have placed through OCAPI:



      {
      "_v": "18.8",
      "_type": "order",
      "_resource_state": "xyz",
      "adjusted_merchandize_total_tax": 0,
      "adjusted_shipping_total_tax": 0,
      "billing_address": {
      "_type": "order_address",
      "city": "Boston",
      "country_code": "US",
      "first_name": "John",
      "full_name": "John Martin",
      "id": "xyz",
      "last_name": "Martin"
      },
      "channel_type": "storefront",
      "confirmation_status": "not_confirmed",
      "created_by": "Customer",
      "creation_date": "2018-11-20T10:37:58.055Z",
      "currency": "USD",
      "customer_info": {
      "_type": "customer_info",
      "customer_id": "xyz",
      "customer_name": "Ammar Shahbaz",
      "customer_no": "xyz"
      },
      "customer_name": "Ammar Shahbaz",
      "export_status": "not_exported",
      "last_modified": "2018-11-20T10:37:58.376Z",
      "merchandize_total_tax": 0,
      "notes": {
      "_type": "simple_link",
      "link": "link"
      },
      "order_no": "123",
      "order_token": "xyz",
      "order_total": 299.8,
      "payment_instruments": [
      {
      "_type": "order_payment_instrument",
      "amount": 299.8,
      "payment_card": {
      "_type": "payment_card",
      "card_type": "Visa",
      "credit_card_expired": false,
      "expiration_month": 1,
      "expiration_year": 2021,
      "holder": "John Doe",
      "masked_number": "************4240",
      "number_last_digits": "4240"
      },
      "payment_instrument_id": "xyz",
      "payment_method_id": "CREDIT_CARD"
      }
      ],
      "payment_status": "not_paid",
      "product_items": [
      {
      "_type": "product_item",
      "adjusted_tax": 0,
      "base_price": 149.9,
      "bonus_product_line_item": false,
      "gift": false,
      "item_id": "xyz",
      "item_text": "Long Sleeve Sequin Shift Dress",
      "price": 299.8,
      "price_after_item_discount": 299.8,
      "price_after_order_discount": 299.8,
      "product_id": "xyz",
      "product_name": "Dress",
      "quantity": 2,
      "shipment_id": "xyz",
      "tax": 0,
      "tax_basis": 299.8,
      "tax_class_id": "xyz",
      "tax_rate": 0,
      "c_cost": 25.17,
      "c_finalSale": false,
      "c_outlet": false,
      "c_taxClassID": "xyz"
      }
      ],
      "product_sub_total": 299.8,
      "product_total": 299.8,
      "shipments": [
      {
      "_type": "shipment",
      "adjusted_merchandize_total_tax": 0,
      "adjusted_shipping_total_tax": 0,
      "gift": false,
      "merchandize_total_tax": 0,
      "product_sub_total": 299.8,
      "product_total": 299.8,
      "shipment_id": "xyz",
      "shipment_total": 299.8,
      "shipping_address": {
      "_type": "order_address",
      "city": "Boston",
      "country_code": "US",
      "first_name": "John",
      "full_name": "John Martin",
      "id": "xyz",
      "last_name": "Martin"
      },
      "shipping_method": {
      "_type": "shipping_method",
      "description": "Order received within 5-8 business days",
      "id": "xyz",
      "name": "Standard",
      "price": 0,
      "shipping_promotions": [
      {
      "_type": "shipping_promotion",
      "callout_msg": "Free shipping on U.S. orders of $125+",
      "link": "link",
      "promotion_id": "xyz",
      "promotion_name": "Free Shipping With $125 Purchase"
      }
      ],
      "c_BxFlatrateFlag": false,
      "c_IsBorderlinxMethod": false
      },
      "shipping_status": "not_shipped",
      "shipping_total": 0,
      "shipping_total_tax": 0,
      "tax_total": 0
      }
      ],
      "shipping_items": [
      {
      "_type": "shipping_item",
      "adjusted_tax": 0,
      "base_price": 0,
      "item_id": "xyz",
      "item_text": "Shipping",
      "price": 0,
      "price_after_item_discount": 0,
      "shipment_id": "xyz",
      "tax": 0,
      "tax_basis": 0,
      "tax_class_id": "xyz",
      "tax_rate": 0
      }
      ],
      "shipping_status": "not_shipped",
      "shipping_total": 0,
      "shipping_total_tax": 0,
      "site_id": "site name",
      "status": "created",
      "taxation": "net",
      "tax_total": 0


      }



      I have tried this resource



      Patch /orders/{order_no}/payment_instruments/{payment_instrument_id} 
      {
      "amount" : 299.8,
      "payment_card" : {
      "number":"424459xxxxxx4240",
      "security_code":"121",
      "holder":"John Martin",
      "card_type":"Visa",
      "expiration_month":1,
      "expiration_year":2021
      },
      "payment_method_id" : "CREDIT_CARD",
      "c_PaymentProcessor": "VANTIV_CREDIT",
      "c_paymentTransaction": {
      "custom": {
      "litleAFTresponse": "Approved",
      "litleAFTTxnId": "8283868xxx8288282"
      }
      }


      }



      to update my order but no success.
      Please let me know if you have any suggestion. Thanks.







      api e-commerce payment-processing demandware






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 '18 at 13:57







      Awais

















      asked Nov 20 '18 at 13:32









      AwaisAwais

      12




      12
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394157%2fhow-to-add-the-payment-transaction-status-in-order-placed-by-using-demandware-oc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53394157%2fhow-to-add-the-payment-transaction-status-in-order-placed-by-using-demandware-oc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

          ts Property 'filter' does not exist on type '{}'

          mat-slide-toggle shouldn't change it's state when I click cancel in confirmation window