get https://api.sandbox.midtrans.com/v1/subscriptions/
Retrieve the subscription details of a customer using the subscription_id
. Successful request returns subscription object
and status:active
.
Get Subscription Method
HTTP Method | Endpoint | Description |
---|---|---|
GET | BASE_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 Attribute | Description | Type |
---|---|---|
id | Subscription ID given by Midtrans. | String |
name | Subscription name given by you. | String |
amount | Amount specified by you for recurring charge. | String |
currency | ISO-4217 representation of three-letter alphabetic currency code. Value: IDR .Note: Currently only IDR is supported. | String |
created_at | Timestamp at which the subscription schedule is created in ISO 8601 format. Time Zone (GMT+7). | String |
schedule | Details of the subscription schedule. | Object |
status | Current subscription Status. Note: Possible status values are active and inactive . | String |
token | Payment token used for subscription. | String |
payment_type | The payment method used by the customer. Value: credit_card . Note: Currently only credit_card and gopay are supported. | String |
transaction_ids | List of transaction IDs which are successfully charged. | Array(String) |
metadata | Metadata of subscription specified by you. Note: Limit the size to less than 1KB. | Object |
customer_details | Details of the customer. | Object |
status_message | Description of the error | String |