How to get a Subscription using the API?
To get a subscription using the API, make a GET request to the endpoint /api/v1/subscriptions/<globalID> using the subscription's globalID.
You can find the documentation for this endpoint here.
Example
After making the request, if everything went well, the request status code will be 2xx and the response body will contain the subscription.
We will return the following example response:
{
"subscription": {
"globalID": "UGF5bWVudFN1YnNjcmlwdGlvbjo2M2UzYjJiNzczZDNkOTNiY2RkMzI5OTM=",
"value": 100,
"customer": {
"name": "Dan",
"email": "email0@example.com",
"phone": "5511999999999",
"taxID": {
"taxID": "31324227036",
"type": "BR:CPF"
}
}
},
"dayGenerateCharge": 5
}
Code examples
- Shell + cURL
- JavaScript + Fetch
curl --request GET \
--url https://api.woovi.com/api/v1/subscriptions/UGF5bWVudFN1YnNjcmlwdGlvbjo2M2UzYjJiNzczZDNkOTNiY2RkMzI5OTM= \
--header 'Authorization: <AUTHORIZATION>'
fetch(
'https://api.woovi.com/api/v1/subscriptions/UGF5bWVudFN1YnNjcmlwdGlvbjo2M2UzYjJiNzczZDNkOTNiY2RkMzI5OTM=',
{
headers: {
Authorization: '<AUTHORIZATION>',
},
},
);