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.
*** [USERNAME/PASSWORD - MEMBERS' 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 POST /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 POST /V1/integration/customer/token]
*** [QUOTE ID = RESPONSE POST /V1/carts/mine]
*** [SKU / QTY REQUIRED FOR CUSTOMER - SAMPLE KHFM00086520 x 1]
POST /V1/carts/mine/items
HOST: https://members.greendropship.com/rest/default
HEADERS:
Content-Type: application/json
Authorization: Bearer CUSTOMER_TOKEN
PAYLOAD:
{
"cartItem": {
"sku": "SKU",
"qty": QTY,
"quote_id": "QUOTE_ID"
}
}
RESPONSE:
{
"item_id": 46703,
"sku": "KHFM00086520",
"qty": 1,
"name": "BOBS RED MILL: Old Country Style Muesli Whole Grain Cereal, 18 oz",
"product_type": "simple",
"quote_id": "QUOTE_ID"
}
*** [CUSTOMER_TOKEN = RESPONSE POST /V1/integration/customer/token]
Was used a sample address, need be submitted the shipping address of
the customer of our member.
From the response, can be selected which method should be used to
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": "mpmultishipping",
"method_code": "mpmultishipping",
"carrier_title": "Vendor",
"method_title": "MultiShipping",
"amount": 0,
"base_amount": 0,
"available": true,
"error_message": "",
"price_excl_tax": 0,
"price_incl_tax": 0
},
{
"available": true,
"amount": 0,
"carrier_code": "mpmultishipping",
"carrier_title": "Vendor",
"method_code": "mpmultishipping",
"method_title": "MultiShipping",
"sellerShipping": [{
"seller_id": 4177,
"item_ids": "331067",
"products": "BOBS RED MILL: Old Country Style Muesli Whole Grain Cereal, 18 oz x 1",
"seller_name": "Green Drop Ship",
"message": "(Flat rate shipping is based on cubic volume and total weight.)",
"methods": {
"webkulshipping_9": {
"method": "Flat Rate Shipping (Shipping)",
"cost": 9.99,
"base_amount": 9.99,
"error": 0
},
"webkulshipping_36": {
"method": "FBA - Select ONLY if ordering FBA or WFS prep services. (Shipping)",
"cost": 0,
"base_amount": 0,
"error": 0
}
}
}]
}
]
*** [CUSTOMER_TOKEN = RESPONSE POST /V1/integration/customer/token]
*** [ADDRESS INFORMATION > SHIPPING ADDRESS SAMPLE]
*** [ADDRESS INFORMATION > BILLING ADDRESS SAMPLE]
*** [SHIPPING_CARRIER_CODE = RESPONSE POST /V1/carts/mine/estimate-shipping-methods]
*** [SHIPPING_METHOD_CODE = RESPONSE POST /V1/carts/mine/estimate-shipping-methods]
Was used a sample address for shipping, need be submitted the shipping address
of the customer of our member.
Was used a sample address for billing, need be submitted the billing address
of our member.
Only valid mpmultishipping for SHIPPING_CARRIER_CODE and
SHIPPING_METHOD_CODE.
From the response, where exists the key sellerShipping some data needs to be
extracted from the previous API call If only are being placed orders for
items from vendor Green Drop Ship.
MULTI_CUSTOMSHIP = If is not an FBA order use the field cost of the
method "Flat Rate Shipping (Shipping)". In this case, based on
the sample is $9.99
SELECTED_SHIPPING = JSON string with the following fields:
idx_vendor = Index key of the vendor
idx_method = Index key of the selected method
'sellerid' => ['sellerShipping'][idx_vendor]['seller_id'],
'itemid' => ['sellerShipping'][idx_vendor]['item_ids'],
'price' => ['sellerShipping'][idx_vendor]['methods'][idx_method ]['cost'],
'baseamount' => ['sellerShipping'][idx_vendor]['methods'][idx_method ]['base_amount'],
'code' => ['sellerShipping'][idx_vendor]['methods'][idx_method ],
'method' => ['sellerShipping'][idx_vendor]['methods'][idx_method ]['method']
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"
},
"extension_attributes": {
"multi_customship": "MULTI_CUSTOMSHIP",
"selected_shipping": "SELECTED_SHIPPING",
},
"shipping_carrier_code": "SHIPPING_CARRIER_CODE",
"shipping_method_code": "SHIPPING_METHOD_CODE"
}
}
RESPONSE:
{
"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"
},
"extension_attributes": {
"multi_customship": "4.99",
"selected_shipping": "{\"sellerid\":\"4177\",\"itemid\":\"331067\",\"price\":\"4.99\",\"baseamount\":\"4.99\",\"code\":\"webkulshipping_1\",\"method\":\"Flat Rate Shipping(Shipping)\"}"
},
"shipping_carrier_code": "mpmultishipping",
"shipping_method_code": "mpmultishipping"
}
}
*** [CUSTOMER_TOKEN = RESPONSE POST /V1/integration/customer/token]
*** [STRIPE_TOKEN - NEED BE SUBMITTED THIS INFO FROM OUR MEMBER ]
*** [METHOD = RESPONSE POST /V1/carts/mine/shipping_information]
STRIPE_TOKEN format is pm_1EkcHALcxRajh5XXXXXXXXXX, you can
get this from the last email received when placing orders.
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
* (Remove Store Credit from a specified cart)
In the script before placing the order (POST /V1/carts/mine/payment-information), the store credit needs to be applied.
*** [CUSTOMER_TOKEN = RESPONSE POST /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 POST /V1/integration/customer/token]
*** [METHOD = RESPONSE POST /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.