Skip to main content

Fetch, add, and modify shipping details for a cart

Use the following REST APIs to add shipping details such as address and other related shipping information for any physical products in a cart.

  1. Save or replace an existing shipping (delivery) address:

Method:POST

URL:{marketplaceBaseUrl}/api/appMarket/v2/fulfillments

Payload:

   {
"shoppingCartId": "6512b7ff875fe104e5fde6da",
"deliveryAddress": {
"name": "Vikram",
"city": "Somerville",
"addressLine1": "50 Grove St1.",
"countryCode": "US",
"subdivisionCode": "MA",
"postalCode": "02114"
},
"sameAsBillingAddress": false
}

Sample response:

{
"content": [
{
"originAddressSnapshotUuid": "dcaa0613-5384-472b-b33a-97cfe281cab3",
"deliveryAddressSnapshotUuid": "f6e12f18-709d-417d-8f8a-899a5c1aa73b",
"channelUuid": "3a772922-83a5-4c14-aff2-d68c7b1c6d45",
"shoppingCartId": "6512b7ff875fe104e5fde6da",
"sameAsBillingAddress": false,
"state": "validated",
"date": {
"created": "2023-09-27T05:35:34.671Z",
"updated": "2023-09-27T07:23:14.925Z"
},
"uuid": "115fc7b4-43f6-4261-8ad7-a205502b17bb",
"entityType": "fulfillment",
"cartItemDetails": [
{
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": [],
"quantityShipped": 0,
"quantityCancelled": 0,
"isSupplierRejection": false,
"isPartialRejection": false
}
],
"shipments": [],
"shipmentRequests": [],
"shippingQuotesExpiryDate": "2121-01-01T00:00:00.000Z",
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"shippingCostEnabled": true,
"defaultShipping": true,
"companyUuid": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0",
"currency": "USD",
"shippingFee": {
"shippingFeeId": "6eec217f-0f38-43bd-b7a6-59c9262fad6a",
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2",
"shoppingCartFeeId": "8be34b89-1aa5-468f-8663-ad725221dd43"
},
"shoppingCartAmount": "440.0000000000",
"userUuid": "1b6a48ea-98f6-49c6-9544-c6bb6936556b",
"deliveryAddress": {
"id": "c29dba53-f049-42bc-be24-52d4b82a9f04",
"snapshot": "f6e12f18-709d-417d-8f8a-899a5c1aa73b",
"name": "Vikram",
"addressLine1": "50 Grove St1.",
"street1": "50 Grove St1.",
"city": "Somerville",
"state": "MA",
"stateCode": "MA",
"subdivisionCode": "MA",
"countryCode": "US",
"country": "US",
"postalCode": "02114",
"zip": "02114",
"created": "2023-09-27T05:35:33.099Z",
"modified": "2023-09-27T05:35:33.099Z"
},
"originAddress": {
"id": "c8684631-aefd-4eeb-aeb7-b119636ab54e",
"snapshot": "dcaa0613-5384-472b-b33a-97cfe281cab3",
"name": "AppDirect (Please ensure that you are using a valid, US-based address)",
"addressLine1": "651 California Street Floor 25",
"addressLine2": "",
"city": "San Francisco",
"subdivisionCode": "CA",
"countryCode": "US",
"postalCode": "94108",
"email": "",
"phone": "",
"created": "2019-09-07T16:50:19Z",
"modified": "2023-08-10T09:55:36.274Z"
},
"pendingFulfillmentItems": [
{
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"status": "PENDING_SUBSCRIPTION",
"type": "MANUAL",
"quantity": 1
}
],
"fulfilledItems": [],
"fulfillmentStatus": "UNFULFILLED"
}
],
"page": {
"size": 50,
"totalElements": 1,
"totalPages": 1,
"number": 1
}
}
  1. Fetch previously saved shipping details such as delivery address, shipping fee options (Quotes), and so on.

Method:GET

URL:{marketplaceBaseUrl}/api/appMarket/v2/fulfillments

Query parameters:shoppingCartId={#cartId}

For example, shoppingCartId= 6512b7ff875fe104e5fde6da

Sample response:

{
"content": [
{
"originAddressSnapshotUuid": "dcaa0613-5384-472b-b33a-97cfe281cab3",
"deliveryAddressSnapshotUuid": "f6e12f18-709d-417d-8f8a-899a5c1aa73b",
"channelUuid": "3a772922-83a5-4c14-aff2-d68c7b1c6d45",
"shoppingCartId": "6512b7ff875fe104e5fde6da",
"sameAsBillingAddress": false,
"state": "validated",
"date": {
"created": "2023-09-27T05:35:34.671Z",
"updated": "2023-09-27T07:23:14.925Z"
},
"uuid": "115fc7b4-43f6-4261-8ad7-a205502b17bb",
"entityType": "fulfillment",
"cartItemDetails": [
{
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": [],
"quantityShipped": 0,
"quantityCancelled": 0,
"isSupplierRejection": false,
"isPartialRejection": false
}
],
"shipments": [],
"shipmentRequests": [],
"shippingQuotesExpiryDate": "2121-01-01T00:00:00.000Z",
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"shippingCostEnabled": true,
"defaultShipping": true,
"companyUuid": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0",
"currency": "USD",
"shippingFee": {
"shippingFeeId": "6eec217f-0f38-43bd-b7a6-59c9262fad6a",
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2",
"shoppingCartFeeId": "8be34b89-1aa5-468f-8663-ad725221dd43"
},
"shoppingCartAmount": "440.0000000000",
"userUuid": "1b6a48ea-98f6-49c6-9544-c6bb6936556b",
"deliveryAddress": {
"id": "c29dba53-f049-42bc-be24-52d4b82a9f04",
"snapshot": "f6e12f18-709d-417d-8f8a-899a5c1aa73b",
"name": "Vikram",
"addressLine1": "50 Grove St1.",
"street1": "50 Grove St1.",
"city": "Somerville",
"state": "MA",
"stateCode": "MA",
"subdivisionCode": "MA",
"countryCode": "US",
"country": "US",
"postalCode": "02114",
"zip": "02114",
"created": "2023-09-27T05:35:33.099Z",
"modified": "2023-09-27T05:35:33.099Z"
},
"originAddress": {
"id": "c8684631-aefd-4eeb-aeb7-b119636ab54e",
"snapshot": "dcaa0613-5384-472b-b33a-97cfe281cab3",
"name": "AppDirect (Please ensure that you are using a valid, US-based address)",
"addressLine1": "651 California Street Floor 25",
"addressLine2": "",
"city": "San Francisco",
"subdivisionCode": "CA",
"countryCode": "US",
"postalCode": "94108",
"email": "",
"phone": "",
"created": "2019-09-07T16:50:19Z",
"modified": "2023-08-10T09:55:36.274Z"
},
"pendingFulfillmentItems": [
{
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"status": "PENDING_SUBSCRIPTION",
"type": "MANUAL",
"quantity": 1
}
],
"fulfilledItems": [],
"fulfillmentStatus": "UNFULFILLED"
}
],
"page": {
"size": 50,
"totalElements": 1,
"totalPages": 1,
"number": 1
}
}
  1. Update the shipping fee option:

Method: POST

URL:{marketplaceBaseUrl}/api/appMarket/v2/fulfillments/{#fulfillmentUuid}/shippingFees

Example URL: https://engage19.cyanopica.appdirect-test.io/api/appMarket/v2/fulfillments/115fc7b4-43f6-4261-8ad7-a205502b17bb/shippingFees

Payload:

	{"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"}


fullfillmentUuid & shippingQuoteId can be retrieved from the api response of fetching or saving shipping address mentioned earlier

Sample response:

{
"originAddressSnapshotUuid": "dcaa0613-5384-472b-b33a-97cfe281cab3",
"deliveryAddressSnapshotUuid": "a39f2d45-d264-4fff-b246-d8f84fa9a4a4",
"channelUuid": "3a772922-83a5-4c14-aff2-d68c7b1c6d45",
"shoppingCartId": "6512b7ff875fe104e5fde6da",
"sameAsBillingAddress": false,
"state": "validated",
"date": {
"created": "2023-09-27T05:35:34.671Z",
"updated": "2023-09-27T07:23:14.925Z"
},
"uuid": "115fc7b4-43f6-4261-8ad7-a205502b17bb",
"entityType": "fulfillment",
"cartItemDetails": [
{
"fulfillmentItemId": "61ea0ba5-a3d2-4246-a155-cbe8336c8885",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": [],
"quantityShipped": 0,
"quantityCancelled": 0,
"isSupplierRejection": false,
"isPartialRejection": false
}
],
"shipments": [],
"shipmentRequests": [],
"shippingQuotesExpiryDate": "2121-01-01T00:00:00.000Z",
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"shippingCostEnabled": true,
"defaultShipping": true,
"processedShoppingCarts": {
"a98134f83ef0b838d1869170c6a9f2b1": {
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"subtotalWithoutFees": "430.0000000000",
"cartItemDetails": [
{
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": []
}
],
"isCalculatedQuotes": false,
"expiry": 1695800136842
},
"eed309a70e8827515e88939e137fcc77": {
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"subtotalWithoutFees": "440.0000000000",
"cartItemDetails": [
{
"fulfillmentItemId": "1f50b9a6-b1e0-437a-aa28-8ff11e6489e2",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": []
}
],
"isCalculatedQuotes": false,
"expiry": 1695806594912
},
"328f086d6c4f8328572651c9df9a586c": {
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"subtotalWithoutFees": "440.0000000000",
"cartItemDetails": [
{
"fulfillmentItemId": "1af7c574-28b3-4d75-a1bd-c049c5151ebd",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": []
}
],
"isCalculatedQuotes": false,
"expiry": 1695824259352
},
"3dabdf0ef5ed050b1b1420d8b7ee77cb": {
"shippingQuotes": [
{
"name": {
"en-US": "Free Shipping Standard"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "81087333-4e66-4d34-871a-62b13996d593",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "56a9cfeb-2ca7-422e-8a0e-1b9a9aa0fc9e"
},
{
"name": {
"en-US": "FREE"
},
"shippingCostMethod": "TOTAL_ITEMS_COST",
"shippingRateId": "7784aafe-ab3d-4343-a1c2-a4f8e0bea44d",
"serviceType": "STANDARD",
"currency": "USD",
"cost": 0,
"isFree": true,
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2"
}
],
"subtotalWithoutFees": "440.0000000000",
"cartItemDetails": [
{
"fulfillmentItemId": "61ea0ba5-a3d2-4246-a155-cbe8336c8885",
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"quantity": 1,
"active": false,
"shippers": []
}
],
"isCalculatedQuotes": false,
"expiry": 1695824338095
}
},
"companyUuid": "9faf88c2-9e58-4f5b-a009-5dc9094fe2a0",
"currency": "USD",
"shippingFee": {
"shippingFeeId": "bc468e33-ebc2-4710-8375-399990f2d84c",
"shippingQuoteId": "e3c98671-7e3a-41ee-be52-a662634192e2",
"shoppingCartFeeId": "2f45cafe-524c-46df-8ac9-bc954bd4fdec"
},
"shoppingCartAmount": "440.0000000000",
"userUuid": "1b6a48ea-98f6-49c6-9544-c6bb6936556b",
"pendingFulfillmentItems": [
{
"productId": "283573",
"pricingPlanId": "53237150-1704-43bc-934e-81c91140a934",
"fulfillmentItemId": "61ea0ba5-a3d2-4246-a155-cbe8336c8885",
"cartItemId": "b7ec8290-d984-4608-bca6-f31191e61f05",
"status": "PENDING_SUBSCRIPTION",
"type": "MANUAL",
"quantity": 1
}
],
"fulfilledItems": [],
"fulfillmentStatus": "UNFULFILLED"

Was this page helpful?