Get Subscription

Retrieve the subscription details of a customer using the subscription_id. Successful request returns subscription object and status:active.




Get Subscription Method

HTTP MethodEndpointDescription
GETBASE_URL/v1/subscriptions/{subscription_id}Retrieve subscription details



Get Subscription Response

{
  "id": "d98a63b8-97e4-4059-825f-0f62340407e9",
  "name": "MONTHLY_2019",
  "amount": "14000",
  "currency": "IDR",
  "created_at": "2019-05-29T09:11:01.810452",
  "schedule": {
    "interval": 1,
    "interval_unit": "month",
    "current_interval" : 1,
    "start_time": "2019-05-29T09:11:01.803677",
    "previous_execution_at": "2019-05-29T09:11:01.803677",
    "next_execution_at": "2019-06-29T09:11:01.803677"
  },
  "status": "active",
  "token": "48111111sHfSakAvHvFQFEjTivUV1114",
  "payment_type": "credit_card",
  "transaction_ids": [
    "9beb839d-8fe2-41ec-bc5e-045e5001d286",
    "eb47cd5d-acd3-4e53-a155-7bd41aa38052",
    "9d286585-bd19-43be-95dc-da3d32ab18af",
    "ec3175c6-9f0a-4ce5-9332-abfb1db0852f",
    "00f7d40d-26e2-4624-a797-9ddc54ca9987",
    "421bd123-d8b2-4476-bcea-165f9e176cbb"
  ],
  "metadata": {
    "description": "Recurring payment for A"
  },
  "customer_details": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "+62812345678"
  }
}
{
  "id": "d98a63b8-97e4-4059-825f-0f62340407e9",
  "name": "MONTHLY_2019",
  "amount": "14000",
  "currency": "IDR",
  "created_at": "2019-05-29T09:11:01.810452",
  "schedule": {
    "interval": 1,
    "interval_unit": "month",
	  "current_interval" : 1,
    "start_time": "2019-05-29T09:11:01.803677",
    "previous_execution_at": "2019-05-29T09:11:01.803677",
    "next_execution_at": "2019-06-29T09:11:01.803677"
  },
  "status": "active",
  "token": "48111111sHfSakAvHvFQFEjTivUV1114",
  "payment_type": "credit_card",
  "metadata": {
    "description": "Recurring payment for A"
  },
  "customer_details": {
    "first_name": "John",
    "last_name": "Doe",
    "email": "[email protected]",
    "phone": "+62812345678"
  },
  "gopay": {                                                    
    "account_id": "phy56f8f-2683-4248-8080-e59b36c6bbgf"
  }
}
{
  "status_message": "Subscription doesn't exist."
}
{
  "status_message": "Sorry, Our system is recovering from unexpected issues. Please retry."
}
JSON AttributeDescriptionType
idSubscription ID given by Midtrans.String
nameSubscription name given by you.String
amountAmount specified by you for recurring charge.String
currencyISO-4217 representation of three-letter alphabetic currency code. Value: IDR.
Note: Currently only IDR is supported.
String
created_atTimestamp at which the subscription schedule is created in ISO 8601 format. Time Zone (GMT+7).String
scheduleDetails of the subscription schedule.Object
statusCurrent subscription Status.
Note: Possible status values are active and inactive.
String
tokenPayment token used for subscription.String
payment_typeThe payment method used by the customer. Value: credit_card.
Note: Currently only credit_card and gopay are supported.
String
transaction_idsList of transaction IDs which are successfully charged.Array(String)
metadataMetadata of subscription specified by you.
Note: Limit the size to less than 1KB.
Object
customer_detailsDetails of the customer.Object
status_messageDescription of the errorString
Language
Credentials
Basic
base64
:
Click Try It! to start a request and see the response here!