Get recurring subscription

GET https://app.ecwid.com/api/v3/{storeId}/subscriptions/{subscriptionId}

Request and response example

Request:

GET /api/v3/1003/subscriptions/66839 HTTP/1.1
Authorization: Bearer secret_token
Host: app.ecwid.com

Response:

{
  "subscriptionId": 66839,
  "customerId": 43343272,
  "status": "CANCELLED",
  "statusUpdated": "2021-07-23 21:17:26 +0000",
  "created": "2021-06-16 12:53:40 +0000",
  "cancelled": "2021-07-23 21:17:26 +0000",
  "nextCharge": "2021-07-16 12:53:40 +0000",
  "createTimestamp": 1623848020508,
  "updateTimestamp": 1627075046478,
  "chargeSettings": {
    "recurringInterval": "MONTH",
    "recurringIntervalCount": 1
  },
  "paymentMethod": {
    "creditCardMaskedNumber": "*1111",
    "creditCardBrand": "visa"
  },
  "orderTemplate": {
    "id": "121",
    "email": "[email protected]",
    "additionalInfo": {
      "creditCard": "*1111 (12/2024)",
      "creditCardExpirationMonth": "12",
      "creditCardExpirationYear": "2024",
      "google_customer_id": "11111111.2222222222",
      "stripeCardId": "pm_1X2xXXX34XXxXxxXxxxXXXX",
      "stripeCreditCardBrand": "visa",
      "stripeCreditCardLast4Digit": "1111",
      "stripeCustomerId": "cus_XXXxxxX12xxxxX",
      "stripeFingerprint": "xxxxxXXX1X2xxxXX",
      "stripeLiveMode": "false"
    },
    "orderComments": "",
    "paymentMethod": "Credit or debit card",
    "paymentModule": "Stripe",
    "total": 26.84,
    "subtotal": 12,
    "usdTotal": 32.545878290056045,
    "tax": 4.84,
    "customerTaxExempt": false,
    "customerTaxId": "",
    "customerTaxIdValid": false,
    "reversedTaxApplied": false,
    "items": [
      {
        "id": 762397105,
        "productId": 11111111,
        "categoryId": 0,
        "price": 12,
        "productPrice": 12,
        "shipping": 10,
        "tax": 4.84,
        "fixedShippingRate": 0,
        "sku": "006789",
        "name": "Mug",
        "shortDescription": "This is the best product in the world!",
        "quantity": 1,
        "quantityInStock": 37,
        "weight": 0.2,
        "trackQuantity": false,
        "fixedShippingRateOnly": false,
        "digital": false,
        "productAvailable": true,
        "imageUrl": "https://d2j6dbq0eux0bg.cloudfront.net/images/11111/111111.jpg",
        "recurringChargeSettings": {
          "recurringInterval": "MONTH",
          "intervalCount": 1
        },
        "selectedOptions": [
          {
            "name": "Color",
            "type": "CHOICE",
            "value": "White",
            "valuesArray": [
              "White"
            ],
            "selections": [
              {
                "selectionTitle": "White",
                "selectionModifier": 0,
                "selectionModifierType": "ABSOLUTE"
              }
            ]
          }
        ],
        "taxes": [
          {
            "name": "VAT",
            "value": 22,
            "total": 4.84,
            "taxOnDiscountedSubtotal": 2.64,
            "taxOnShipping": 2.2,
            "includeInPrice": true
          }
        ],
        "dimensions": {
          "length": 21,
          "width": 21,
          "height": 21
        }
      }
    ],
    "billingPerson": {
      "name": "First Last",
      "companyName": "",
      "street": "Otto-Braun-Straße",
      "city": "Berlin",
      "countryCode": "DE",
      "countryName": "Germany",
      "postalCode": "10178",
      "stateOrProvinceCode": "BE",
      "stateOrProvinceName": "Berlin",
      "phone": "+491625555012"
    },
    "shippingPerson": {
      "name": "First Last",
      "companyName": "",
      "street": "Otto-Braun-Straße",
      "city": "Berlin",
      "countryCode": "DE",
      "countryName": "Germany",
      "postalCode": "10178",
      "stateOrProvinceCode": "BE",
      "stateOrProvinceName": "Berlin",
      "phone": "+11111111111"
    },
    "shippingOption": {
      "shippingMethodName": "Local delivery – City",
      "shippingRate": 10
    },
    "handlingFee": {},
    "pricesIncludeTax": false
  },
  "orders": [
    {
      "id": 266645518,
      "total": 26.84,
      "createDate": "2021-06-16 12:53:39 +0000"
    }
  ]
}

Required access scopes

Your app must have the following access scopes to make this request: read_subscriptions

Path params

All path params are required.

Param
Type
Description

storeId

number

Ecwid store ID.

subscriptionId

number

Internal subscription ID.

Headers

The Authorization header is required.

Header
Format
Description

Authorization

Bearer secret_ab***cd

Access token of the application.

Response JSON

A JSON object with the following fields:

Field
Type
Description

subscriptionId

number

Internal subscription ID.

customerId

number

Internal ID of the customer who bought subscription.

status

string

One of: ACTIVE CANCELLED LAST_CHARGE_FAILED

REQUIRES_PAYMENT_CONFIRMATION

statusUpdated

string

Datetime when the subscription status was updated for the last time.

For example, 2024-05-26 13:37:46 +0000

created

string

Datetime when the order containing subscription was placed.

For example, 2024-05-26 13:37:46 +0000

cancelled

string

Datetime when the subscription was cancelled.

For example, 2024-05-26 13:37:46 +0000

nextCharge

string

Datetime of the next recurring charge for the subscription.

For example, 2024-05-26 13:37:46 +0000

createTimestamp

number

Datetime when the order containing subscription was placed in UNIX timestamp format.

For example, 1623848020508

updateTimestamp

number

Datetime when the subscription status was updated for the last time in UNIX timestamp format.

For example, 1623848020508

chargeSettings

Details about recurring charges set up for the subscription.

paymentMethod

Details about the payment method used for the subscription.

orders

object orders

Short details about the order containing the subscription: ID, total, creation date.

orderTemplate

Detailed information about the order containing the subscription.

chargeSettings

Field
Type
Description

recurringInterval

string

Search term for the time scale of subscription's recurring interval.

One of: DAY WEEK MONTH YEAR

recurringIntervalCount

number

Search term for the frequency of subscription's recurring charges. One of: for DAY - 1 (daily) for WEEK - 1 (weekly) or 2 (biweekly) for MONTH - 1 (monthly) or 3 (quarterly) for YEAR - 1 (annually)

paymentMethod

Field
Type
Description

creditCardMaskedNumber

string

Credit card masked number, e.g. *1111.

creditCardBrand

string

Credit card brand, e.g. Visa.

orders

Field
Type
Description

id

number

Internal order ID.

total

number

Order total .

createDate

string

Order creation date and time, e.g. 2021-06-16 12:53:39 +0000.

orderTemplate

A JSON object with the order details in the same format as in the GET order request.

Last updated

Was this helpful?