[Create subscription with payment at the moment]
POST {{url}}{{public-prefix}}/subscriptions
Request Body
{"plan_id"=>"{{plan_id}}", "customer_id"=>"{{customer_id}}", "quantity"=>1, "amount"=>"", "trial_period_days"=>0, "end_date"=>nil, "tags"=>["foo"], "discounts"=>[{"id"=>"{{discount_id}}", "cycle_amounts_left"=>1}], "taxes"=>[{"id"=>"{{tax_id}}"}], "one_time_costs"=>[{"id"=>"{{one_time_cost_id}}"}], "additional_costs"=>[{"id"=>"{{additional_cost_id}}"}], "payment_method_id"=>"{{payment_method_id}}", "external_id"=>"{{$randomUUID}}", "process_sync"=>"true"}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Authorization | string |
RESPONSES
status: Created
{"id":"1dec079d-e855-4d52-bde5-110c8da55baf","plan":{"id":"a4f65c53-37be-4b63-b4ee-a24090cdeba4","name":"New plan credit card","amount":"2500.0","currency":"ARS","cycle_unit":"monthly","cycle_amount":1,"type":"flat","country":"ARG","external_id":"41b24ea0-8cf5-48fa-a206-05db619a5232","trial_period_days":0,"tiers":[],"charge_after_period":false,"product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","start_day":null,"charge_proportional":null,"automatic_subscription_request_approval":true,"checkout_link":"https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/inR97l","success_url":"","collect_methods":{"cbu":[],"card":[{"id":"d2a7fd90-a8da-4276-8fee-2b5f91edab61","name":"Mercadopago Connect","type":"mercadopago_connect","status":"enabled","country":"ARG","max_payment_retries":0,"retry_period_time":0,"retry_period_unit":"days","currencies":["ARS"],"payment_categories":["card"],"public_key":"APP_USR-29d56597-5025-449c-883c-00b8a6c4c89c","metadata":{"expiration_days":30,"offline_payments_enabled":false}}],"ticket":[]},"locked":false,"taxes":[{"id":"9cacf4ba-080f-4120-a84e-6b824e92fe39","type":"flat","name":"New tax","amount":"130.0","region":null,"created_at":"2021-09-30T15:04:36-03:00","country":"ARG","description":"Tax description updated","external_id":"9e8bc664-dd8f-4477-8336-0d2663536c86"}],"discounts":[{"id":"bd9a61bd-c7f1-4920-a832-a43a5084b6f1","external_id":"e2dfa853-aba1-4512-846c-c10e42143135","name":"New discount","type":"flat","amount":"130.0","currency":"ARS","duration":"periodic","cycle_unit":"monthly","cycle_amount":10,"created_at":"2021-09-30T14:54:56-03:00","description":"A description of the discount"}],"one_time_costs":[{"id":"716d64f8-1b2f-4bf7-b2ba-3da72382244a","external_id":"994702d6-63b1-43ad-acd0-53686675bf65","type":"flat","name":"New one time cost","description":"A description of the one time cost","amount":"1300.0","country":"ARG","currency":"ARS"}]},"customer":{"id":"4d6eb2c1-a17d-415e-89df-2878626a48fb","external_id":"","email":"test2@test.com","language":"ES","timezone":"Buenos Aires","first_name":"Customer","last_name":"Test2","billing_info":{"id":"73efb20d-1e0b-44e8-9525-4c881fb47bce","address_line_1":"Street 123","address_line_2":"","country":"ARG","currency":"ARS","city":"City","state":"Buenos Aires","zip_code":"1112","phone":"111212123"},"tax_id":"20123123458","checkout_link":"https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/le3EQN","created_at":"2021-10-01T09:24:04-03:00"},"quantity":1,"amount":"2500.0","net_amount":"2620.0","currency":"ARS","status":"active","canceled_at":null,"paused_at":null,"trial_period_end":"2021-10-01T00:00:00-03:00","next_billing_date":"2021-11-01T00:00:00-03:00","created_at":"2021-10-01T09:26:21-03:00","payment_method":{"id":"6b3131ad-610b-414f-a04a-44c395ec5201","external_id":"8995014771","data":{"country":"ARG","number":"371180**7522","type":"card","cardholder_identification_type":"DNI","cardholder_identification_number":"33123123","expiration_month":11,"expiration_year":2025,"first_six_digits":"371180","last_four_digits":"7522","issuer_name":"American Express Argentina","cardholder_name":"APRO","card_brand_name":"American Express","card_brand_payment_type_id":"credit_card"},"created_at":"2021-10-01T09:25:28-03:00","collect_method_id":"d2a7fd90-a8da-4276-8fee-2b5f91edab61"},"product":{"id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","name":"New product","external_id":null,"created_at":"2021-09-29T15:58:51-03:00","checkout_link":"https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/qSR6_P"},"external_id":"edff0eed-67b7-409d-abf2-517ebd0f80a2","activate_at":"2021-10-01","cancel_at":null,"checkout_link":"https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/H-lgeG","discounts":[{"id":"bd9a61bd-c7f1-4920-a832-a43a5084b6f1","external_id":"e2dfa853-aba1-4512-846c-c10e42143135","name":"New discount","type":"flat","amount":"130.0","currency":"ARS","duration":"periodic","cycle_unit":"monthly","cycle_amount":10,"created_at":"2021-09-30T14:54:56-03:00","description":"A description of the discount"}],"invoice":{"id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","status":"paid","amount":"5300.0","external_id":null,"customer":{"id":"4d6eb2c1-a17d-415e-89df-2878626a48fb","email":"test2@test.com","first_name":"Customer","last_name":"Test2"},"subscriptions":[{"id":"1dec079d-e855-4d52-bde5-110c8da55baf","plan":{"id":"a4f65c53-37be-4b63-b4ee-a24090cdeba4","name":"New plan credit card"},"customer":{"id":"4d6eb2c1-a17d-415e-89df-2878626a48fb","email":"test2@test.com","first_name":"Customer","last_name":"Test2"},"quantity":1,"amount":"2500.0","net_amount":"2620.0","currency":"ARS","status":"active","canceled_at":null,"paused_at":null,"trial_period_end":"2021-10-01T00:00:00-03:00","next_billing_date":"2021-11-01T00:00:00-03:00","created_at":"2021-10-01T09:26:21-03:00","product":{"id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","name":"New product"},"activate_at":"2021-10-01","cancel_at":null}],"currency":"ARS","created_at":"2021-10-01T09:26:22-03:00","paid_at":"2021-10-01T09:26:22-03:00","checkout_link":"https://gateway.increase.app/pay-sandbox/checkout/v1/short_urls/a4GUCx","success_url":"?invoice_id=3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3\u0026customer_id=4d6eb2c1-a17d-415e-89df-2878626a48fb\u0026subscription_id=1dec079d-e855-4d52-bde5-110c8da55baf\u0026payment_method_id=6b3131ad-610b-414f-a04a-44c395ec5201","collect_methods":{"cbu":[],"card":[],"ticket":[]},"invoice_items":[{"id":"0f59b0cd-bb54-4e65-9af4-63278f43d519","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New tax for subscription","quantity":1,"unit_price":"120.0","amount":"120.0","currency":"ARS","item_number":6,"invoiceable_id":"e9cc9167-7796-4e10-8ee5-ad6ae4a0beb4","invoiceable_type":"Tax","created_at":"2021-10-01T09:26:22.336-03:00","updated_at":"2021-10-01T09:26:22.336-03:00","product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","denormalized_product_name":"New product","applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"693cc696-0024-40a3-8357-652ccbfb675e","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New tax","quantity":1,"unit_price":"130.0","amount":"130.0","currency":"ARS","item_number":5,"invoiceable_id":"9cacf4ba-080f-4120-a84e-6b824e92fe39","invoiceable_type":"Tax","created_at":"2021-10-01T09:26:22.330-03:00","updated_at":"2021-10-01T09:26:22.330-03:00","product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","denormalized_product_name":"New product","applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"3882785e-278e-477d-981d-7d047751955c","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New discount for subscription","quantity":1,"unit_price":"120.0","amount":"-120.0","currency":"ARS","item_number":4,"invoiceable_id":"bb913fef-135c-4901-a637-c2efb4b37b07","invoiceable_type":"Discount","created_at":"2021-10-01T09:26:22.319-03:00","updated_at":"2021-10-01T09:26:22.319-03:00","product_id":null,"denormalized_product_name":null,"applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"5b43403c-e720-40e7-ab0b-23d25ef1218c","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New discount","quantity":1,"unit_price":"130.0","amount":"-130.0","currency":"ARS","item_number":3,"invoiceable_id":"bd9a61bd-c7f1-4920-a832-a43a5084b6f1","invoiceable_type":"Discount","created_at":"2021-10-01T09:26:22.299-03:00","updated_at":"2021-10-01T09:26:22.299-03:00","product_id":null,"denormalized_product_name":null,"applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"b3d9dd83-beb9-476f-a94e-7c01e5f0e7bf","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New one time cost for subscription","quantity":1,"unit_price":"1500.0","amount":"1500.0","currency":"ARS","item_number":2,"invoiceable_id":"af2fa75f-2bfc-489d-8501-286ae421c7a5","invoiceable_type":"OneTimeCost","created_at":"2021-10-01T09:26:22.284-03:00","updated_at":"2021-10-01T09:26:22.284-03:00","product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","denormalized_product_name":"New product","applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"300ffa56-481e-4080-8993-f326f7429a1e","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New one time cost","quantity":1,"unit_price":"1300.0","amount":"1300.0","currency":"ARS","item_number":1,"invoiceable_id":"716d64f8-1b2f-4bf7-b2ba-3da72382244a","invoiceable_type":"OneTimeCost","created_at":"2021-10-01T09:26:22.264-03:00","updated_at":"2021-10-01T09:26:22.264-03:00","product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","denormalized_product_name":"New product","applicable_type":"Subscription","applicable_id":"1dec079d-e855-4d52-bde5-110c8da55baf"},{"id":"c186572e-20c5-4700-a7f3-98f07644f3a9","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","description":"New plan credit card","quantity":1,"unit_price":"2500.0","amount":"2500.0","currency":"ARS","item_number":0,"invoiceable_id":"1dec079d-e855-4d52-bde5-110c8da55baf","invoiceable_type":"Subscription","created_at":"2021-10-01T09:26:22.245-03:00","updated_at":"2021-10-01T09:26:22.245-03:00","product_id":"8e0bda25-c446-48a9-aab0-a9a7adc396fd","denormalized_product_name":"New product","applicable_type":null,"applicable_id":null}],"payments":[{"id":"abeec56f-25e6-4d69-8135-e489b5a72cdb","invoice_id":"3f5198f7-e1d3-43c1-a6d3-56b0a4695ec3","payment_method_id":"6b3131ad-610b-414f-a04a-44c395ec5201","status":"approved","amount":"5300.0","currency":"ARS","id_for_collect_provider":1878,"created_at":"2021-10-01T09:26:22.389-03:00","updated_at":"2021-10-01T09:26:22.650-03:00","denormalized_customer_email":"test2@test.com","retry_count":0,"metadata":{"mercadopago_id":null,"authorization_code":"1234567","external_resource_url":null},"rejection_code":null,"rejection_type":null,"account_id":"59640063-5b68-403e-9ddc-948d582cf8f2","rejection_description":null,"paid_at":"2021-10-01T09:26:22.600-03:00","processor_reference_id":"14647463936","denormalized_customer_first_name":"Customer","denormalized_customer_last_name":"Test2","refund_status":"unrequested","refresh_date":"2021-10-01T12:26:22.453-03:00","stop_debit":false,"sync":false}]},"one_time_costs":[{"id":"716d64f8-1b2f-4bf7-b2ba-3da72382244a","external_id":"994702d6-63b1-43ad-acd0-53686675bf65","type":"flat","name":"New one time cost","description":"A description of the one time cost","amount":"1300.0","country":"ARG","currency":"ARS"},{"id":"af2fa75f-2bfc-489d-8501-286ae421c7a5","external_id":"asad123-123asd","type":"flat","name":"New one time cost for subscription","description":"A description of the one time cost","amount":"1500.0","country":"ARG","currency":"ARS"}],"taxes":[{"id":"9cacf4ba-080f-4120-a84e-6b824e92fe39","type":"flat","name":"New tax","amount":"130.0","region":null,"created_at":"2021-09-30T15:04:36-03:00","country":"ARG","description":"Tax description updated","external_id":"9e8bc664-dd8f-4477-8336-0d2663536c86"},{"id":"e9cc9167-7796-4e10-8ee5-ad6ae4a0beb4","type":"flat","name":"New tax for subscription","amount":"120.0","region":null,"created_at":"2021-09-30T16:43:29-03:00","country":"ARG","description":"Tax description","external_id":"9e8bc664-dd8f-4477-8336-0d2663536c85"}],"errors":null}