Getting a subscription

The method allows you to get information about the subscription

Getting a subscription

post
Header parameters
x-api-public-keystringoptional

Public API-key

x-api-signaturestringoptional

Signing the request body with a private API-key

Content-typestringoptional

Request content type

Example: application/json
Body

Request body for getting subscription data

idstringrequired

Subscription ID

Example: 671fafbb-8795-4d0b-8614-06d5a6190f4e
merchantIdstringrequired

Merchant ID

Example: 41fe615a-96dc-42c2-9629-196383411cd4
Responses
curl -L \
  --request POST \
  --url 'https://ocp.onchainpay.io/api-gateway/recurrents/get-subscription' \
  --header 'Content-Type: application/json' \
  --data '{
    "id": "671fafbb-8795-4d0b-8614-06d5a6190f4e",
    "merchantId": "41fe615a-96dc-42c2-9629-196383411cd4"
  }'
{
  "success": true,
  "response": {
    "id": "671fafbb-8795-4d0b-8614-06d5a6190f4e",
    "merchantId": "41fe615a-96dc-42c2-9629-196383411cd4",
    "billingLinkId": "60b5c367-1b93-448a-b08a-16da458102b5",
    "title": "Premium",
    "description": "Premium subscription. With premium subscription u can use premium functions",
    "spendInterval": "-1",
    "status": "PENDING",
    "message": null,
    "currency": "USD",
    "amount": "7.99",
    "webhookUrl": "https://merchant.domain/webhooks/subscription",
    "createdAt": "2024-12-26T08:21:33.222Z",
    "updatedAt": "2024-12-26T08:21:33.222Z"
  }
}

Last updated