İçeriğe geç
Lumean

Açıklamalar İngilizce

Bölümün arayüzü dilinize çevrildi, ancak işlem, şema ve hata açıklamaları yalnızca Rusça ve İngilizce mevcut — burada İngilizce sürüm gösteriliyor.
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.

Parametreler

Değerler doğrudan istek satırına yazılır ve URL kendiliğinden oluşur. Aşağıda her parametrenin türü, zorunlu olup olmadığı ve izin verilen değerleri var.

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

    İstek gövdesi

    application/jsonzorunlu

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

    Örnek gövde
    {
      "nominals": [
        1
      ]
    }

    Alanlar

    nominalszorunlu

    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.

    en az öğe: 1en fazla öğe: 1000
    array<number>
    Örnek [100,100,250]

    Olası yanıtlar

    200

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

    Gövde örneği
    {
      "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
        }
      }
    }
    Yanıt alanları
    successzorunlu

    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
    messagezorunlu

    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
    datazorunlu

    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
    uuidzorunlu

    The batch id.

    string
    sourcezorunlu

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

    Değerlerpurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    codes_countzorunlu

    How many codes the batch holds.

    integer
    nominal_totalzorunlu

    Sum of the code nominals, LMC minor units.

    integer
    nominal_total_formattedzorunlu

    Sum of the nominals, LMC.

    number
    cost_totalisteğe bağlı

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

    integer
    cost_total_formattedisteğe bağlı

    Charged to the reseller balance, LMC.

    number
    discount_bpsisteğe bağlı

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

    integer
    codesisteğe bağlı

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

    array<GiftCode>GiftCode
    dizi öğesi
    uuidzorunlu

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

    string
    code_maskedzorunlu

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

    string
    codeisteğe bağlı

    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
    nominalzorunlu

    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_formattedzorunlu

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

    number
    costisteğe bağlı

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

    integer
    cost_formattedisteğe bağlı

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

    number
    discount_bpsisteğe bağlı

    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
    sourcezorunlu

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

    Değerlerpurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    fundingzorunlu

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

    Değerlerrubcryptomixedadmin
    GiftCodeFundingGiftCodeFunding
    statuszorunlu

    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.

    Değerleractiverefundingredeemedrefundedcancelledannulled
    GiftCodeStatusGiftCodeStatus
    activatable_atzorunlu

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

    null olabilirdate-time
    string
    redeemed_atzorunlu

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

    null olabilirdate-time
    string
    cancelled_atzorunlu

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

    null olabilirdate-time
    string
    created_atzorunlu

    When the code was issued.

    null olabilirdate-time
    string
    currency_assetzorunlu

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

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

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

    integer
    created_atzorunlu

    When the batch was issued.

    null olabilirdate-time
    string
    currency_assetzorunlu

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

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    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[].

    Gövde örneği
    {
      "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
        }
      }
    }
    Yanıt alanları
    successzorunlu

    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
    messagezorunlu

    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
    datazorunlu

    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
    uuidzorunlu

    The batch id.

    string
    sourcezorunlu

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

    Değerlerpurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    codes_countzorunlu

    How many codes the batch holds.

    integer
    nominal_totalzorunlu

    Sum of the code nominals, LMC minor units.

    integer
    nominal_total_formattedzorunlu

    Sum of the nominals, LMC.

    number
    cost_totalisteğe bağlı

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

    integer
    cost_total_formattedisteğe bağlı

    Charged to the reseller balance, LMC.

    number
    discount_bpsisteğe bağlı

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

    integer
    codesisteğe bağlı

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

    array<GiftCode>GiftCode
    dizi öğesi
    uuidzorunlu

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

    string
    code_maskedzorunlu

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

    string
    codeisteğe bağlı

    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
    nominalzorunlu

    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_formattedzorunlu

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

    number
    costisteğe bağlı

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

    integer
    cost_formattedisteğe bağlı

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

    number
    discount_bpsisteğe bağlı

    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
    sourcezorunlu

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

    Değerlerpurchaseresellersystem
    GiftCodeSourceGiftCodeSource
    fundingzorunlu

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

    Değerlerrubcryptomixedadmin
    GiftCodeFundingGiftCodeFunding
    statuszorunlu

    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.

    Değerleractiverefundingredeemedrefundedcancelledannulled
    GiftCodeStatusGiftCodeStatus
    activatable_atzorunlu

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

    null olabilirdate-time
    string
    redeemed_atzorunlu

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

    null olabilirdate-time
    string
    cancelled_atzorunlu

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

    null olabilirdate-time
    string
    created_atzorunlu

    When the code was issued.

    null olabilirdate-time
    string
    currency_assetzorunlu

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

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

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

    integer
    created_atzorunlu

    When the batch was issued.

    null olabilirdate-time
    string
    currency_assetzorunlu

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

    object
    codezorunlu

    Code of the asset the amounts are expressed in.

    DeğerlerLUMC
    string
    precisionzorunlu

    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.

    Bu yanıtı çözümle
    Gövde örneği
    {
      "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
    }
    Yanıt alanları
    successzorunlu

    Always false in error responses.

    boolean
    messagezorunlu

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

    string
    reasonzorunlu

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

    Değerlerquote_mismatch
    string
    error_codezorunlu

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

    Değerlerquote_mismatch
    string
    actual_lmc_minorzorunlu

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

    integer
    Örnek 380000000
    quoted_lmc_minorzorunlu

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

    integer
    Örnek 360000000
    422

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

    Bu yanıtı çözümle
    Gövde örneği
    {
      "message": "string",
      "errors": {
        "key": [
          "string"
        ]
      }
    }
    Yanıt alanları
    messagezorunlu

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

    string
    errorszorunlu

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

    object
    *isteğe bağlı
    rastgele anahtarlar
    array<string>

    Yapay zekâ için bu sayfa

    .md sürümünü açllm.md

    API sürümü 1.0.0