Saltar al contenido
Lumean

Descripciones en inglés

La interfaz de la sección está traducida a su idioma, pero las descripciones de operaciones, esquemas y errores solo existen en ruso y en inglés: aquí se muestra la versión en inglés.
POST/reseller/codes

Issue gift codes

Issues gift codes at the reseller's personal discount, paid from the reseller balance. The response carries the batch with the FULL codes.

Body: nominals — code nominals in LMC (strings or numbers), one per code.

Idempotency: send the Idempotency-Key header (1–64 characters A-Z a-z 0-9 _ . : -) so that a network retry cannot issue a second batch. A retry with the same key and the same nominals returns the original batch — 200 plus the Idempotent-Replayed: true header, and the balance is not charged again; the same key with different nominals gives 422 idempotency_key_mismatch.

Required key permission: reseller.write.

Parámetros

Los valores se escriben directamente en la línea de la solicitud y la URL se arma sola. Abajo están el tipo, la obligatoriedad y los valores permitidos de cada parámetro.

POSThttps://api.lumean.app/api/public/reseller/codes

    Cuerpo de la solicitud

    application/jsonobligatorio

    Issuing codes from the reseller balance. The Idempotency-Key header is optional but recommended: with it a network retry cannot issue a second batch.

    Ejemplo de cuerpo
    {
      "nominals": [
        1
      ]
    }

    Campos

    nominalsobligatorio

    Code nominals in LMC, one number per code: as many codes as elements. Numbers and decimal strings are accepted; a nominal is either one of the presets from GET /reseller/settings or between min_nominal and max_nominal. The number of elements is capped by limits.max_codes_per_issue from GET /reseller.

    mín. elementos: 1máx. elementos: 1000
    array<number>
    Ejemplo [100,100,250]

    Respuestas posibles

    200

    A replay by Idempotency-Key: the original batch, with the Idempotent-Replayed: true header; the balance is not charged again.

    Ejemplo de cuerpo
    {
      "success": true,
      "message": "string",
      "data": {
        "uuid": "string",
        "source": "purchase",
        "codes_count": 1,
        "nominal_total": 1,
        "nominal_total_formatted": 1,
        "cost_total": 1,
        "cost_total_formatted": 1,
        "discount_bps": 1,
        "codes": [
          {
            "uuid": "string",
            "code_masked": "string",
            "code": "string",
            "nominal": 1,
            "nominal_formatted": 1,
            "cost": 1,
            "cost_formatted": 1,
            "discount_bps": 1,
            "source": "purchase",
            "funding": "rub",
            "status": "active",
            "activatable_at": "2026-07-17T12:34:56+00:00",
            "redeemed_at": "2026-07-17T12:34:56+00:00",
            "cancelled_at": "2026-07-17T12:34:56+00:00",
            "created_at": "2026-07-17T12:34:56+00:00",
            "currency_asset": {
              "code": "string",
              "precision": 1
            }
          }
        ],
        "created_at": "2026-07-17T12:34:56+00:00",
        "currency_asset": {
          "code": "string",
          "precision": 1
        }
      }
    }
    Campos de la respuesta
    successobligatorio

    Success flag. Branch on the HTTP status code instead: any 2xx response carries true here, while an error comes back in a different shape that need not contain this field at all.

    boolean
    messageobligatorio

    A human-readable note in the account language. Fine to show to a user; do not parse it — the wording changes without notice and is not an error code.

    string
    dataobligatorio

    The issued batch. On a replay by Idempotency-Key (code 200, header Idempotent-Replayed: true) it is the same batch as in the first response; the balance is not charged again.

    GiftCodeBatchGiftCodeBatch
    uuidobligatorio

    The batch id.

    string
    sourceobligatorio

    Always reseller — the batch was issued from the reseller balance.

    Valorespurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    codes_countobligatorio

    How many codes the batch holds.

    integer
    nominal_totalobligatorio

    Sum of the code nominals, LMC minor units.

    integer
    nominal_total_formattedobligatorio

    Sum of the nominals, LMC.

    number
    cost_totalopcional

    How much was charged to the reseller balance (nominals minus the discount), LMC minor units.

    integer
    cost_total_formattedopcional

    Charged to the reseller balance, LMC.

    number
    discount_bpsopcional

    The reseller personal discount at issue time, basis points (1000 = 10%).

    integer
    codesopcional

    The batch codes with the FULL code value — store them: they are bearer money.

    array<GiftCode>GiftCode
    elemento del array
    uuidobligatorio

    Code UUID. Use it in the GET /reseller/codes/{uuid} and POST /reseller/codes/{uuid}/cancel paths.

    string
    code_maskedobligatorio

    The code with a mask, LUM-****-****-XXXX: safe to show in a UI and to write to logs.

    string
    codeopcional

    The FULL code value — what the recipient types to redeem it. The reseller public API returns it in the list, on show and on issue. Treat it as a secret: whoever knows the code can redeem it.

    string
    nominalobligatorio

    The code’s nominal value in minor LMC units: real = nominal / 10^currency_asset.precision. This is how much LMC the redeemer receives.

    integer
    nominal_formattedobligatorio

    The same nominal value in whole LMC — a number ready to display.

    number
    costopcional

    What the code cost the reseller after the discount, in minor LMC units. Present only for reseller codes (source: reseller).

    integer
    cost_formattedopcional

    The same cost in whole LMC. Present only for reseller codes.

    number
    discount_bpsopcional

    The reseller’s discount at the moment of issue, in basis points (100 = 1%). A later change of the personal discount does not affect this code. Present only for reseller codes.

    integer
    sourceobligatorio

    Where the code came from: bought by a user with money (purchase) or issued by a reseller from their own balance (reseller).

    Valorespurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    fundingobligatorio

    What paid for the code: roubles (rub), crypto (crypto) or both (mixed — a reseller code issued from a balance topped up both ways).

    Valoresrubcryptomixedadmin
    GiftCodeFundingGiftCodeFunding
    statusobligatorio

    Gift code status: active — issued and awaiting redemption (possibly still frozen until activatable_at); refunding — a refund is in progress, redemption and cancellation are unavailable; redeemed — redeemed, the nominal is on the redeemer's balance; refunded — the money went back to the buyer's card; cancelled — the reseller cancelled the code and the cost returned to their balance; annulled — annulled with no refund.

    Valoresactiverefundingredeemedrefundedcancelledannulled
    GiftCodeStatusGiftCodeStatus
    activatable_atobligatorio

    The moment from which the code can be redeemed; until then it is frozen. null means no restriction.

    admite nulldate-time
    string
    redeemed_atobligatorio

    When the code was redeemed. null until it is. The API never reveals who redeemed it.

    admite nulldate-time
    string
    cancelled_atobligatorio

    When the reseller cancelled the code. null if it was not cancelled.

    admite nulldate-time
    string
    created_atobligatorio

    When the code was issued.

    admite nulldate-time
    string
    currency_assetobligatorio

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codeobligatorio

    Code of the asset the amounts are expressed in.

    ValoresLUMC
    string
    precisionobligatorio

    How many decimals LMC has: real = value / 10^precision.

    integer
    created_atobligatorio

    When the batch was issued.

    admite nulldate-time
    string
    currency_assetobligatorio

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codeobligatorio

    Code of the asset the amounts are expressed in.

    ValoresLUMC
    string
    precisionobligatorio

    How many decimals LMC has: real = value / 10^precision.

    integer
    201

    The batch is issued. data holds the batch with the FULL codes in codes[].

    Ejemplo de cuerpo
    {
      "success": true,
      "message": "string",
      "data": {
        "uuid": "string",
        "source": "purchase",
        "codes_count": 1,
        "nominal_total": 1,
        "nominal_total_formatted": 1,
        "cost_total": 1,
        "cost_total_formatted": 1,
        "discount_bps": 1,
        "codes": [
          {
            "uuid": "string",
            "code_masked": "string",
            "code": "string",
            "nominal": 1,
            "nominal_formatted": 1,
            "cost": 1,
            "cost_formatted": 1,
            "discount_bps": 1,
            "source": "purchase",
            "funding": "rub",
            "status": "active",
            "activatable_at": "2026-07-17T12:34:56+00:00",
            "redeemed_at": "2026-07-17T12:34:56+00:00",
            "cancelled_at": "2026-07-17T12:34:56+00:00",
            "created_at": "2026-07-17T12:34:56+00:00",
            "currency_asset": {
              "code": "string",
              "precision": 1
            }
          }
        ],
        "created_at": "2026-07-17T12:34:56+00:00",
        "currency_asset": {
          "code": "string",
          "precision": 1
        }
      }
    }
    Campos de la respuesta
    successobligatorio

    Success flag. Branch on the HTTP status code instead: any 2xx response carries true here, while an error comes back in a different shape that need not contain this field at all.

    boolean
    messageobligatorio

    A human-readable note in the account language. Fine to show to a user; do not parse it — the wording changes without notice and is not an error code.

    string
    dataobligatorio

    The issued batch. On a replay by Idempotency-Key (code 200, header Idempotent-Replayed: true) it is the same batch as in the first response; the balance is not charged again.

    GiftCodeBatchGiftCodeBatch
    uuidobligatorio

    The batch id.

    string
    sourceobligatorio

    Always reseller — the batch was issued from the reseller balance.

    Valorespurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    codes_countobligatorio

    How many codes the batch holds.

    integer
    nominal_totalobligatorio

    Sum of the code nominals, LMC minor units.

    integer
    nominal_total_formattedobligatorio

    Sum of the nominals, LMC.

    number
    cost_totalopcional

    How much was charged to the reseller balance (nominals minus the discount), LMC minor units.

    integer
    cost_total_formattedopcional

    Charged to the reseller balance, LMC.

    number
    discount_bpsopcional

    The reseller personal discount at issue time, basis points (1000 = 10%).

    integer
    codesopcional

    The batch codes with the FULL code value — store them: they are bearer money.

    array<GiftCode>GiftCode
    elemento del array
    uuidobligatorio

    Code UUID. Use it in the GET /reseller/codes/{uuid} and POST /reseller/codes/{uuid}/cancel paths.

    string
    code_maskedobligatorio

    The code with a mask, LUM-****-****-XXXX: safe to show in a UI and to write to logs.

    string
    codeopcional

    The FULL code value — what the recipient types to redeem it. The reseller public API returns it in the list, on show and on issue. Treat it as a secret: whoever knows the code can redeem it.

    string
    nominalobligatorio

    The code’s nominal value in minor LMC units: real = nominal / 10^currency_asset.precision. This is how much LMC the redeemer receives.

    integer
    nominal_formattedobligatorio

    The same nominal value in whole LMC — a number ready to display.

    number
    costopcional

    What the code cost the reseller after the discount, in minor LMC units. Present only for reseller codes (source: reseller).

    integer
    cost_formattedopcional

    The same cost in whole LMC. Present only for reseller codes.

    number
    discount_bpsopcional

    The reseller’s discount at the moment of issue, in basis points (100 = 1%). A later change of the personal discount does not affect this code. Present only for reseller codes.

    integer
    sourceobligatorio

    Where the code came from: bought by a user with money (purchase) or issued by a reseller from their own balance (reseller).

    Valorespurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    fundingobligatorio

    What paid for the code: roubles (rub), crypto (crypto) or both (mixed — a reseller code issued from a balance topped up both ways).

    Valoresrubcryptomixedadmin
    GiftCodeFundingGiftCodeFunding
    statusobligatorio

    Gift code status: active — issued and awaiting redemption (possibly still frozen until activatable_at); refunding — a refund is in progress, redemption and cancellation are unavailable; redeemed — redeemed, the nominal is on the redeemer's balance; refunded — the money went back to the buyer's card; cancelled — the reseller cancelled the code and the cost returned to their balance; annulled — annulled with no refund.

    Valoresactiverefundingredeemedrefundedcancelledannulled
    GiftCodeStatusGiftCodeStatus
    activatable_atobligatorio

    The moment from which the code can be redeemed; until then it is frozen. null means no restriction.

    admite nulldate-time
    string
    redeemed_atobligatorio

    When the code was redeemed. null until it is. The API never reveals who redeemed it.

    admite nulldate-time
    string
    cancelled_atobligatorio

    When the reseller cancelled the code. null if it was not cancelled.

    admite nulldate-time
    string
    created_atobligatorio

    When the code was issued.

    admite nulldate-time
    string
    currency_assetobligatorio

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codeobligatorio

    Code of the asset the amounts are expressed in.

    ValoresLUMC
    string
    precisionobligatorio

    How many decimals LMC has: real = value / 10^precision.

    integer
    created_atobligatorio

    When the batch was issued.

    admite nulldate-time
    string
    currency_assetobligatorio

    The currency of the amounts in the response — LMC. Use precision to convert amounts in minor units into whole LMC.

    object
    codeobligatorio

    Code of the asset the amounts are expressed in.

    ValoresLUMC
    string
    precisionobligatorio

    How many decimals LMC has: real = value / 10^precision.

    integer
    409

    reseller_inactive — the account is blocked; reseller_insufficient_balance — the balance is not enough.

    Analizar esta respuesta
    Ejemplo de cuerpo
    {
      "success": false,
      "message": "The pay-as-you-go quote is stale — request a fresh one.",
      "reason": "quote_mismatch",
      "error_code": "quote_mismatch",
      "actual_lmc_minor": 380000000,
      "quoted_lmc_minor": 360000000
    }
    Campos de la respuesta
    successobligatorio

    Always false in error responses.

    boolean
    messageobligatorio

    Error text in the key's language (set through the X-Locale header).

    string
    reasonobligatorio

    Machine-readable failure reason — branch on this, not on the message text.

    Valoresquote_mismatch
    string
    error_codeobligatorio

    The same machine-readable code as in reason — a second name for the field. The values always match; branch on either.

    Valoresquote_mismatch
    string
    actual_lmc_minorobligatorio

    What the top-up costs right now (LMC minor units).

    integer
    Ejemplo 380000000
    quoted_lmc_minorobligatorio

    The price you agreed to earlier (LMC minor units).

    integer
    Ejemplo 360000000
    422

    Validation error; gift_code_nominal_not_allowed, reseller_too_many_codes, idempotency_key_mismatch — the same key with different nominals.

    Analizar esta respuesta
    Ejemplo de cuerpo
    {
      "message": "string",
      "errors": {
        "key": [
          "string"
        ]
      }
    }
    Campos de la respuesta
    messageobligatorio

    A summary of the validation errors in words, in the response language (X-Locale).

    string
    errorsobligatorio

    A per-field breakdown: the key names a request field, the value lists the complaints about it.

    object
    *opcional
    claves arbitrarias
    array<string>

    Esta página para IA

    Abrir .mdllm.md

    versión de la API 1.0.0