Certificates for payment


API documentation for working with payment certificates

Table with field descriptions

Field Type Required? Description
id int No Unique identifier of the certificate (required when updating).
code string Yes Unique certificate code.
is_active bool No Certificate activity status (default is true).
value int No Face value of the certificate.

1. Obtaining all certificates

Method: GET
URL: {domain}/external/payment-certificate/

Description:
Returns a list of all site payment certificates.

Query example:

GET {domain}/external/payment-certificate/

Example answer:

[
    {
        "id": 1,
        "code": "CERT-001",
        "is_active": true,
        "value": 500
    },
    {
        "id": 2,
        "code": "CERT-002",
        "is_active": false,
        "value": 1000
    }
]

2. Obtaining one certificate

Method: GET
URL: {domain}/external/payment-certificate/{id}/

Description:
Returns data for a single certificate by its identifier.

Query example:

GET {domain}/external/payment-certificate/1/

Example answer:

{
    "id": 1,
    "code": "CERT-001",
    "is_active": true,
    "value": 500
}

3. Single certificate renewal

Method: PUT
URL: {domain}/external/payment-certificate/{id}/

Description:
Updates the data of a single certificate by its identifier.

Query example:

PUT {domain}/external/payment-certificate/1/
Content-Type: application/json

Request body:

{
    "code": "CERT-001-UPDATED",
    "is_active": false,
    "value": 750
}

Example answer:

{
    "id": 1,
    "code": "CERT-001-UPDATED",
    "is_active": false,
    "value": 750
}

4. Create multiple certificates

Method: POST
URL: {domain}/external/payment-certificate/bulk-create/

Description:
Creates multiple certificates at the same time.

Query example:

POST {domain}/external/payment-certificate/bulk-create/
Content-Type: application/json

Request body:

[
    {
        "code": "CERT-NEW-001",
        "is_active": true,
        "value": 1000
    },
    {
        "code": "CERT-NEW-002",
        "is_active": false,
        "value": 1500
    }
]

Example answer:

[
    {
        "id": 3,
        "code": "CERT-NEW-001",
        "is_active": true,
        "value": 1000
    },
    {
        "id": 4,
        "code": "CERT-NEW-002",
        "is_active": false,
        "value": 1500
    }
]

5. Updating multiple certificates

Method: PUT
URL: {domain}/external/payment-certificate/bulk-update/

Description:
Updates the data of several certificates simultaneously.

Query example:

PUT {domain}/external/payment-certificate/bulk-update/
Content-Type: application/json

Request body:

[
    {
        "id": 1,
        "code": "CERT-001-UPDATED",
        "value": 800,
        "is_active": true
    },
    {
        "id": 2,
        "code": "CERT-002-UPDATED",
        "value": 1200,
        "is_active": true
    }
]

Example answer:

[
    {
        "id": 1,
        "code": "CERT-001-UPDATED",
        "is_active": true,
        "value": 800
    },
    {
        "id": 2,
        "code": "CERT-002-UPDATED",
        "is_active": true,
        "value": 1200
    }
]

Was the article helpful?

Yes, thank you! Unfortunately no

article.helpfulQuestion