Перейти к основному содержимому

Parspal Create Payment API

POST /parspalCreatePayment

Description

This API endpoint allows users to create a payment through Parspal by providing details such as payment category, group ID, and additional login count. The endpoint initiates the Parspal payment process and returns the necessary details to complete the transaction.

Request Body

The request utilizes GraphQL to perform the parspalCreatePayment mutation.

Mutation:

mutation parspalCreatePayment (
$category: PaymentCategory!,
$groupId: Int,
$moreLoginCount: Int
) {
parspalCreatePayment (
category: $category,
groupId: $groupId,
moreLoginCount: $moreLoginCount
) {
payment_id
link
status
message
error_type
error_code
}
}

Variables:

{
"category": "<Payment_Category>",
"groupId": 0,
"moreLoginCount": 0
}
  • category (PaymentCategory Enum): The category of the payment (e.g., subscription, one-time purchase).
  • groupId (Int): The ID of the group associated with the payment.
  • moreLoginCount (Int): The number of additional logins to be included in the payment.

Response:

  • Success (200 OK):

    • If the payment initiation is successful, the response will return the following details:
      • payment_id (String): The unique ID of the payment transaction.
      • link (String): The link to complete the payment.
      • status (String): The status of the payment request.
      • message (String): A message detailing the outcome of the request.
      • error_type (String, optional): The type of error encountered, if any.
      • error_code (String, optional): The error code associated with the error, if any.
    {
    "data": {
    "parspalCreatePayment": {
    "payment_id": "<Payment_ID>",
    "link": "<Payment_Link>",
    "status": "<Payment_Status>",
    "message": "<Status_Message>",
    "error_type": "<Error_Type>",
    "error_code": "<Error_Code>"
    }
    }
    }
  • Error (4XX/5XX):

    • If an issue arises during the payment process, the response will include relevant error messages and status codes.

Note:

Ensure that all required fields are provided and correctly formatted according to the platform's specifications. This API should be used to initiate and manage Parspal payments, allowing users to complete transactions within the platform.