Cancel a Subscription

DELETE https://gateway-api.paycertify.com/api/subscriptions/{subscription_id}

To cancel a subscription, you should use the Subscription ID response field to reference the subscription being canceled. This endpoint simply cancels the subscription and stops charging it.

Parameter Type Length Presence Description Example
subscription_id uuid 36 Required The Subscription record ID, sent on the URL 41f00869-d7b3-413e-9476-9ef1a8bc2f28
Parameter Type Length Description Example
subscription.id uuid 36 The Subscription record ID e57aa3bf-a3df-4056-b1f2-d4de7252fe99
subscription.merchant_id uuid 36 The user’s merchant ID e57aa3bf-a3df-4056-b1f2-d4de7252fe99
subscription.user_id uuid 36 The user’s ID e57aa3bf-a3df-4056-b1f2-d4de7252fe99
subscription.status string 6-8 Result of Subscription request trialing
subscription.description string 1-255 A brief description of the current subscription Monthly tennis club signature
subscription.interval string 3-5 Time period measure you require (day, week, month) day
subscription.interval_count number - Number of interval between payments 1
subscription.processor_id uuid 36 The processor’s ID e57aa3bf-a3df-4056-b1f2-d4de7252fe99
subscription.merchant_subscription_id string 1-255 A merchant assigned identifier (your subscription ID) MY-ORDER
subscription.first_name string 1-255 Customer’s first name John
subscription.last_name string 1-255 Customer’s last name Doe
subscription.street_address_1 string 1-255 Billing address first line (street address) 59 N Santa Cruz Avenue
subscription.street_address_2 string 1-255 Billing address second line (suite, apt, etc) Suite M
subscription.city string 1-255 Billing address city Los Gatos
subscription.state string 2 Billing address state abbreviation, ISO 3166-2 format. CA
subscription.country string 2 Billing address country abbreviation, ISO 3166-1 alpha-2 format. US
subscription.zip string 2-255 Billing address postal code 95030
subscription.email string 1-255 Customer’s email [email protected]
subscription.mobile_phone string 11-15 Customer’s phone in E.164 format +11231231234
subscription.amount number 0.01-9999999 Amount to be charged every recurring cycle 3.56
subscription.trial_amount number 0.01-9999999 The amount charged on Subscription creating, used for paid trial periods. 3.56
subscription.start_date datetime 19 The date and time when subscription should start Y-m-d h:m:s format. 2018-10-01 12:00:00
subscription.end_date datetime 19 The date and time when subscription should end Y-m-d h:m:s format. 2019-10-01 12:00:00
subscription.next_cycle_date datetime 19 The date and time of the next charge Y-m-d h:m:s format. 2019-10-01 12:00:00
subscription.transactions array - Listing of Subscription related transactions -
subscription.updated_at datetime 19 Last time this event was updated, on ISO 8601 UTC 2018-02-16T16:33:40+00:00
subscription.created_at datetime 19 Time that event was created, on ISO 8601 UTC 2018-02-16T16:33:40+00:00
subscription.card_number string 8-19 Redacted card number 411111**1111
subscription.card_expiry_month string 2 The expiration month with two positions 01
subscription.card_expiry_year string 4 The expiration year with four positions 2021
curl --request DELETE \
  --url https://gateway-api.paycertify.com/api/subscriptions/{subscription_id} \
  --header 'Authorization: Bearer YOUR_API_TOKEN'
{
    "subscription": {
        "id": "e57aa3bf-a3df-4056-b1f2-d4de7252fe99",
        "merchant_id": "c8444f15-887b-45bf-a143-a1112962f600",
        "user_id": "03825915-d9ac-48c9-9bda-8055ed415c25",
        "status": "canceled",
        "description": "Monthly tennis club signature",
        "interval": "day",
        "interval_count": "1",
        "processor_id": "5364358a-b8f7-4f45-b600-7fc614bf0285",
        "merchant_subscription_id": "MY-ORDER",
        "first_name": "John",
        "last_name": "Doe",
        "street_address_1": "59 N Santa Cruz Avenue",
        "street_address_2": "Suite M",
        "city": "Los Gatos",
        "state": "CA",
        "country": "US",
        "zip": "41970",
        "email": "[email protected]",
        "mobile_phone": "+11231231234",
        "amount": "1.00",
        "trial_amount": null,
        "start_date": "2018-07-09T00:00:00+0000",
        "end_date": "2018-07-10T00:00:00+0000",
        "next_cycle_date": "2018-09-11T21:24:19+0000",
        "transactions": [
            {
                "id": "3410596f-d596-42d4-9811-41d43868e984",
                "merchant_id": "455a1c64-385b-41b2-a56f-34bf6c5c5335",
                "user_id": "6e064bf5-0e18-466b-811b-f967e8d73b9f",
                "processor_id": "30ff7682-6ec7-48f3-8d7a-62319a9c3c59",
                "merchant_transaction_id": "REC-MY-ORDER-0000",
                "card_number": "411111******1111",
                "card_brand": "visa",
                "card_expiry_month": "01",
                "card_expiry_year": "2021",
                "first_name": "John",
                "last_name": "Doe",
                "street_address_1": "59 N Santa Cruz Avenue",
                "street_address_2": "Suite M",
                "city": "Los Gatos",
                "state": "CA",
                "country": "US",
                "zip": "95030",
                "email": "[email protected]",
                "mobile_phone": "+11231231234",
                "updated_at": "2018-02-16T16:33:40+00:00",
                "created_at": "2018-02-16T16:33:39+00:00",
                "events": [
                    {
                        "id": "84a8ab86-ee0e-47d4-8686-4e42fa58355e",
                        "success": true,
                        "threeds_response": null,
                        "avs_response": null,
                        "event_type": "refund",
                        "amount": "1.00",
                        "ip_address": "127.0.0.1",
                        "processor_code": "00",
                        "processor_message": "APPROVAL TAS656 ",
                        "processor_transaction_id": "000000000252616",
                        "processor_threeds_response": null,
                        "processor_avs_response": "0",
                        "updated_at": "2018-02-16T16:33:40+00:00",
                        "created_at": "2018-02-16T16:33:39+00:00"
                    },
                    {
                        "id": "84a8ab86-ee0e-47d4-8686-1e12fa12345e",
                        "success": true,
                        "threeds_response": null,
                        "avs_response": null,
                        "event_type": "sale",
                        "amount": "1.00",
                        "ip_address": "127.0.0.1",
                        "processor_code": "00",
                        "processor_message": "APPROVAL TAS656 ",
                        "processor_transaction_id": "000000000252616",
                        "processor_threeds_response": null,
                        "processor_avs_response": "0",
                        "updated_at": "2018-02-16T16:33:40+00:00",
                        "created_at": "2018-02-16T16:33:39+00:00"
                    }
                ]
            }
        ],
        "updated_at": "2018-09-10T21:24:19+0000",
        "created_at": "2018-09-10T21:24:19+0000",
        "card_number": "411111******1111",
        "card_expiry_month": "01",
        "card_expiry_year": "2021"
    }
}