Below are the steps required to be able to integrate with our API for Order Management. Note, you would need to integrate with both Magento and Stripe.
Steps required to submit orders:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [USERNAME/PASSWORD - MEMBERS'S CREDENTIALS]
POST /V1/integration/customer/token
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
PAYLOAD: {"username":"USERNAME","password":"PASSWORD"}
RESPONSE: "CUSTOMER_TOKEN"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
POST /V1/carts/mine
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:[]
RESPONSE: QUOTE_ID
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
*** [QUOTE ID = RESPONSE FROM /V1/carts/mine]
*** [SKU / QTY REQUIRED FOR CUSTOMER - SAMPLE KHFM00295056 x 1]
POST /V1/carts/mine/items
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{"cart_item":{"sku":"SKU","qty":QTY,"quote_id":"QUOTE_ID"}}
RESPONSE:
{"item_id":46703,"sku":"KHFM00295056","qty":1,"name":"HAWAIIAN SPRINGS: Water, 1.5 lt","product_type":"simple","quote_id":"QUOTE_ID"}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
*** [ADDRESS SAMPLE - NEED BE SUBMITTED SHIPPING ADDRESS OF CUSTOMER OF OUR MEMBER]
*** [FROM RESPONSE, CAN BE SELECTED WHICH METHOD SHOULD BE USED FOR SHIP THIS ORDER]
POST /V1/carts/mine/estimate-shipping-methods
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{"address":{"region_code":"CA","country_id":"US","street":["123 Oak Ave"],"postcode":"10577","city":"Los Angeles","firstname":"Henry","lastname":"Aguilar","email":"henry.aguilar@outlook.com","telephone":"(222) 222-2222"}}
RESPONSE:
[{"carrier_code":"freeshipping","method_code":"freeshipping","carrier_title":"Select this if this is an FBA order","method_title":"FBA Order","amount":0,"base_amount":0,"available":true,"error_message":"","price_excl_tax":0,"price_incl_tax":0},{"carrier_code":"shqfedex","method_code":null,"carrier_title":"FedEx Ground\/Home Delivery (NO PO BOXES!) - UP TO 5 BUSINESS DAY TRANSIT TIME","amount":0,"base_amount":null,"available":false,"error_message":"There are no valid services available. ","price_excl_tax":0,"price_incl_tax":0},{"carrier_code":"shqusps1","method_code":null,"carrier_title":"USPS - First Class","amount":0,"base_amount":null,"available":false,"error_message":"No Valid Rates found for Carrier","price_excl_tax":0,"price_incl_tax":0},{"carrier_code":"shqusps2","method_code":"PriorityMail","carrier_title":"USPS PRIORITY*","method_title":"Priority Mail","amount":42.16,"base_amount":42.16,"available":true,"error_message":"","price_excl_tax":42.16,"price_incl_tax":42.16}]
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
*** [ADDRESS INFORMATION > SHIPPING ADDRESS SAMPLE - NEED BE SUBMITTED SHIPPING ADDRESS OF CUSTOMER OF OUR MEMBER]
*** [ADDRESS INFORMATION > BILLING ADDRESS SAMPLE - NEED BE SUBMITTED BILLING ADDRESS OF OUR MEMBER]
*** [SHIPPING_CARRIER_CODE = RESPONSE FROM /V1/carts/mine/estimate-shipping-methods]
*** [SHIPPING_METHOD_CODE = RESPONSE FROM /V1/carts/mine/estimate-shipping-methods]
POST /V1/carts/mine/shipping-information
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{"addressInformation":{"shipping_address":{"region_code":"CA","country_id":"US","street":["123 Oak Ave"],"postcode":"10577","city":"Los Angeles","firstname":"Henry","lastname":"Aguilar","email":"henry.aguilar@outlook.com","telephone":"(222) 222-2222"},"billing_address":{"region_code":"FL","country_id":"US","street":["7807 NW 37TH STREET"],"postcode":"33166","city":"Doral","firstname":"Allen","lastname":"Infante","email":"allen.infante@outlook.com","telephone":"(111) 111-1111"},"shipping_carrier_code":"SHIPPING_CARRIER_CODE","shipping_method_code":"SHIPPING_METHOD_CODE"}}
RESPONSE:
{"payment_methods":[{"code":"stripe_payments","title":"Credit Cards"}],"totals":{"grand_total":3.47,"base_grand_total":3.47,"subtotal":3.47,"base_subtotal":3.47,"discount_amount":0,"base_discount_amount":0,"subtotal_with_discount":3.47,"base_subtotal_with_discount":3.47,"shipping_amount":0,"base_shipping_amount":0,"shipping_discount_amount":0,"base_shipping_discount_amount":0,"tax_amount":0,"base_tax_amount":0,"weee_tax_applied_amount":null,"shipping_tax_amount":0,"base_shipping_tax_amount":0,"subtotal_incl_tax":3.47,"shipping_incl_tax":0,"base_shipping_incl_tax":0,"base_currency_code":"USD","quote_currency_code":"USD","items_qty":1,"items":[{"item_id":46703,"price":3.47,"base_price":3.47,"qty":1,"row_total":3.47,"base_row_total":3.47,"row_total_with_discount":0,"tax_amount":0,"base_tax_amount":0,"tax_percent":0,"discount_amount":0,"base_discount_amount":0,"discount_percent":0,"price_incl_tax":3.47,"base_price_incl_tax":3.47,"row_total_incl_tax":3.47,"base_row_total_incl_tax":3.47,"options":"[]","weee_tax_applied_amount":null,"weee_tax_applied":null,"name":"HAWAIIAN SPRINGS: Water, 1.5 lt"}],"total_segments":[{"code":"subtotal","title":"Subtotal","value":3.47},{"code":"shipping","title":"Shipping & Handling (Select this if this is an FBA order - FBA Order)","value":0},{"code":"tax","title":"Tax","value":0,"extension_attributes":{"tax_grandtotal_details":[]}},{"code":"grand_total","title":"Grand Total","value":3.47,"area":"footer"}]}}
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
*** [STRIPE_TOKEN - NEED BE SUBMITTED THIS INFO FROM OUR MEMBER / FORMAT IS pm_1EkcHALcxRajh5XXXXXXXXXX, you can get this from last email received when placing orders]
*** [METHOD = RESPONSE FROM /V1/carts/mine/shipping_information]
POST /V1/carts/mine/payment-information
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{"paymentMethod":{"method":"METHOD","additional_data":{"token":"STRIPE_TOKEN"}}}
RESPONSE: ENTITY_ID
If you want to use Store Credits:
GET /V1/carts/mine/aw-get-customer-store-credit (Retrieve customer Store Credit details)
GET /V1/carts/mine/aw-store-credit (Returns information for a Store Credit in a specified cart)
PUT /V1/carts/mine/apply-aw-store-credit (Add Store Credit to a specified cart)
DELETE /V1/carts/mine/remove-aw-store-credit (Delete Store Credit from a specified cart)
In the script before place order (POST /V1/carts/mine/payment-information), the store credit need be applied
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
PUT /V1/carts/mine/apply-aw-store-credit
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
RESPONSE: true
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
*** [CUSTOMER_TOKEN = RESPONSE FROM /V1/integration/customer/token]
*** [METHOD = RESPONSE FROM /V1/carts/mine/shipping_information (the only method valid is "free" if you are paying the 100% of the total amount with store credits)]
POST /V1/carts/mine/payment-information
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{"paymentMethod":{"method":"free","additional_data":null}}
RESPONSE: ENTITY_ID
Comments
0 comments
Please sign in to leave a comment.