Create a new subscription
curl --request POST \
--url https://api-stg.pandablue.com/v3/subscriptions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-Date: <x-date>' \
--header 'X-Login: <x-login>' \
--data '
{
"invoice_id": "<string>",
"amount": 123,
"currency": "<string>",
"country": "<string>",
"payer": {
"id": "<string>",
"document": "<string>",
"document_type": "<string>",
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
},
"subscription": {
"start_date": "2023-12-25",
"plan_unit": 123,
"auto_renewal": false
},
"description": "<string>",
"client_ip": "<string>",
"back_url": "<string>",
"success_url": "<string>",
"error_url": "<string>",
"notification_url": "<string>"
}
'import requests
url = "https://api-stg.pandablue.com/v3/subscriptions"
payload = {
"invoice_id": "<string>",
"amount": 123,
"currency": "<string>",
"country": "<string>",
"payer": {
"id": "<string>",
"document": "<string>",
"document_type": "<string>",
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
},
"subscription": {
"start_date": "2023-12-25",
"plan_unit": 123,
"auto_renewal": False
},
"description": "<string>",
"client_ip": "<string>",
"back_url": "<string>",
"success_url": "<string>",
"error_url": "<string>",
"notification_url": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"X-Date": "<x-date>",
"X-Login": "<x-login>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
'X-Date': '<x-date>',
'X-Login': '<x-login>',
Authorization: '<authorization>'
},
body: JSON.stringify({
invoice_id: '<string>',
amount: 123,
currency: '<string>',
country: '<string>',
payer: {
id: '<string>',
document: '<string>',
document_type: '<string>',
email: '[email protected]',
first_name: '<string>',
last_name: '<string>'
},
subscription: {start_date: '2023-12-25', plan_unit: 123, auto_renewal: false},
description: '<string>',
client_ip: '<string>',
back_url: '<string>',
success_url: '<string>',
error_url: '<string>',
notification_url: '<string>'
})
};
fetch('https://api-stg.pandablue.com/v3/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-stg.pandablue.com/v3/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoice_id' => '<string>',
'amount' => 123,
'currency' => '<string>',
'country' => '<string>',
'payer' => [
'id' => '<string>',
'document' => '<string>',
'document_type' => '<string>',
'email' => '[email protected]',
'first_name' => '<string>',
'last_name' => '<string>'
],
'subscription' => [
'start_date' => '2023-12-25',
'plan_unit' => 123,
'auto_renewal' => false
],
'description' => '<string>',
'client_ip' => '<string>',
'back_url' => '<string>',
'success_url' => '<string>',
'error_url' => '<string>',
'notification_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-Date: <x-date>",
"X-Login: <x-login>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stg.pandablue.com/v3/subscriptions"
payload := strings.NewReader("{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Date", "<x-date>")
req.Header.Add("X-Login", "<x-login>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stg.pandablue.com/v3/subscriptions")
.header("Content-Type", "<content-type>")
.header("X-Date", "<x-date>")
.header("X-Login", "<x-login>")
.header("Authorization", "<authorization>")
.body("{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stg.pandablue.com/v3/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-Date"] = '<x-date>'
request["X-Login"] = '<x-login>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": 123,
"redirect_url": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"payment_amount": 123,
"redirect": true
}{
"code": 123,
"description": "<string>",
"type": "<string>"
}{
"code": 123,
"description": "<string>",
"type": "<string>"
}{
"code": 123,
"description": "<string>"
}Manage subscriptions
Create a subscription (OneShot)
This endpoint allows the creation of a new subscription with payment details.
POST
/
v3
/
subscriptions
Create a new subscription
curl --request POST \
--url https://api-stg.pandablue.com/v3/subscriptions \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--header 'X-Date: <x-date>' \
--header 'X-Login: <x-login>' \
--data '
{
"invoice_id": "<string>",
"amount": 123,
"currency": "<string>",
"country": "<string>",
"payer": {
"id": "<string>",
"document": "<string>",
"document_type": "<string>",
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
},
"subscription": {
"start_date": "2023-12-25",
"plan_unit": 123,
"auto_renewal": false
},
"description": "<string>",
"client_ip": "<string>",
"back_url": "<string>",
"success_url": "<string>",
"error_url": "<string>",
"notification_url": "<string>"
}
'import requests
url = "https://api-stg.pandablue.com/v3/subscriptions"
payload = {
"invoice_id": "<string>",
"amount": 123,
"currency": "<string>",
"country": "<string>",
"payer": {
"id": "<string>",
"document": "<string>",
"document_type": "<string>",
"email": "[email protected]",
"first_name": "<string>",
"last_name": "<string>"
},
"subscription": {
"start_date": "2023-12-25",
"plan_unit": 123,
"auto_renewal": False
},
"description": "<string>",
"client_ip": "<string>",
"back_url": "<string>",
"success_url": "<string>",
"error_url": "<string>",
"notification_url": "<string>"
}
headers = {
"Content-Type": "<content-type>",
"X-Date": "<x-date>",
"X-Login": "<x-login>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Content-Type': '<content-type>',
'X-Date': '<x-date>',
'X-Login': '<x-login>',
Authorization: '<authorization>'
},
body: JSON.stringify({
invoice_id: '<string>',
amount: 123,
currency: '<string>',
country: '<string>',
payer: {
id: '<string>',
document: '<string>',
document_type: '<string>',
email: '[email protected]',
first_name: '<string>',
last_name: '<string>'
},
subscription: {start_date: '2023-12-25', plan_unit: 123, auto_renewal: false},
description: '<string>',
client_ip: '<string>',
back_url: '<string>',
success_url: '<string>',
error_url: '<string>',
notification_url: '<string>'
})
};
fetch('https://api-stg.pandablue.com/v3/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-stg.pandablue.com/v3/subscriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'invoice_id' => '<string>',
'amount' => 123,
'currency' => '<string>',
'country' => '<string>',
'payer' => [
'id' => '<string>',
'document' => '<string>',
'document_type' => '<string>',
'email' => '[email protected]',
'first_name' => '<string>',
'last_name' => '<string>'
],
'subscription' => [
'start_date' => '2023-12-25',
'plan_unit' => 123,
'auto_renewal' => false
],
'description' => '<string>',
'client_ip' => '<string>',
'back_url' => '<string>',
'success_url' => '<string>',
'error_url' => '<string>',
'notification_url' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>",
"X-Date: <x-date>",
"X-Login: <x-login>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-stg.pandablue.com/v3/subscriptions"
payload := strings.NewReader("{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("X-Date", "<x-date>")
req.Header.Add("X-Login", "<x-login>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-stg.pandablue.com/v3/subscriptions")
.header("Content-Type", "<content-type>")
.header("X-Date", "<x-date>")
.header("X-Login", "<x-login>")
.header("Authorization", "<authorization>")
.body("{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-stg.pandablue.com/v3/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["X-Date"] = '<x-date>'
request["X-Login"] = '<x-login>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"invoice_id\": \"<string>\",\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"country\": \"<string>\",\n \"payer\": {\n \"id\": \"<string>\",\n \"document\": \"<string>\",\n \"document_type\": \"<string>\",\n \"email\": \"[email protected]\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\"\n },\n \"subscription\": {\n \"start_date\": \"2023-12-25\",\n \"plan_unit\": 123,\n \"auto_renewal\": false\n },\n \"description\": \"<string>\",\n \"client_ip\": \"<string>\",\n \"back_url\": \"<string>\",\n \"success_url\": \"<string>\",\n \"error_url\": \"<string>\",\n \"notification_url\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"subscription_id": 123,
"redirect_url": "<string>",
"expiration_date": "2023-11-07T05:31:56Z",
"payment_amount": 123,
"redirect": true
}{
"code": 123,
"description": "<string>",
"type": "<string>"
}{
"code": 123,
"description": "<string>",
"type": "<string>"
}{
"code": 123,
"description": "<string>"
}Headers
Body
application/json
Subscription details
Response
Subscription created successfully