latestOpenAPI 3.0.02026-08-101013821017.9 KB

4b69392f93b9

Third Party Subscription Engine Support

Accept subscription information from third-party subscription engine

Accept Subscription Information (Including Billing Agreements) for supporting third-party subscription engine.

Use ECO billing optimization tool for third-party subscription engine.

post/v1/shoppers/me/carts/active (subscriptionInfo)

Request body

Example request

{
  "cart": {
    "lineItems": {
      "lineItem": {
        "quantity": "2",
        "product": {
          "id": "1234"
        },
        "subscriptionInfo": {
          "autoRenewal": true,
          "terms": "subscription terms",
          "startTime": "2020-08-01T00:00:00.000Z",
          "endTime": "2021-08-01T00:00:00.000Z",
          "billingAgreementId": "6ed70eb4-da79-46f1-9e7d-210c043d3c9e"
        },
        "billingOptimization": {
          "subscriptionId": "555444",
          "segmentId": "12",
          "renewalAttempNumber": 3
        }
      }
    },
    "chargeType": "customer_initiated"
  }
}

Response

Successful response.

Example response

{
  "lineItems": {
    "lineItem": [
      {
        "subscriptionInfo": {
          "autoRenewal": true,
          "terms": "subscription term",
          "startTime": "2020-08-01T00:00:00.000Z",
          "endTime": "2021-08-01T00:00:00.000Z",
          "billingAgreementId": "6ed70eb4-da79-46f1-9e7d-210c043d3c9e"
        },
        "billingOptimization": {
          "subscriptionId": "555444",
          "segmentId": "12",
          "renewalAttempNumber": 3
        }
      }
    ],
    "customAttributes": {
      "attribute": [
        {
          "name": "hasExternalSubscriptionInfo",
          "type": "Boolean",
          "value": true
        }
      ]
    },
    "chargeType": "customer_initiated"
  }
}