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: 31d5766b-ddfa-4311-831c-7c90fd16f3d2
merchantIdstringrequired

Merchant ID

Example: 2612ad7b-ed3d-45e4-aab2-6a13e2ecd0e0
Responses
application/json
objectoptional

Successful response

post
POST /api-gateway/recurrents/get-subscription HTTP/1.1
Host: ocp.onchainpay.io
Content-Type: application/json
Accept: */*
Content-Length: 97

{
  "id": "31d5766b-ddfa-4311-831c-7c90fd16f3d2",
  "merchantId": "2612ad7b-ed3d-45e4-aab2-6a13e2ecd0e0"
}
200Success
{
  "success": true,
  "response": {
    "id": "31d5766b-ddfa-4311-831c-7c90fd16f3d2",
    "merchantId": "2612ad7b-ed3d-45e4-aab2-6a13e2ecd0e0",
    "billingLinkId": "e34d0746-b972-4b07-a9be-931f1578e898",
    "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-25T14:35:23.174Z",
    "updatedAt": "2024-12-25T14:35:23.174Z"
  }
}

Last updated