> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unibee.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Promo Credit Increment

> Increase user promo credit amount

## Endpoint Overview

**POST** `https://api.unibee.dev/merchant/credit/promo_credit_increment`

Increase user promo credit amount

***

## Authorization

All UniBee Merchant API requests require authentication via API key.

| Header          | Required | Description                           |
| --------------- | -------- | ------------------------------------- |
| `Authorization` | Yes      | Bearer `<your_api_key>`               |
| `Content-Type`  | Yes      | `application/json` (for request body) |

***

## Parameters

Parameters for this endpoint are listed below. The schema is also shown in the Try it panel.

### Request body

| Name          | Type    | Required | Description                                   |
| ------------- | ------- | -------- | --------------------------------------------- |
| `amount`      | integer | Yes      | The amount to increase, should greater than 0 |
| `currency`    | string  | Yes      | currency of recharge                          |
| `description` | string  | No       | description of increase action                |
| `name`        | string  | No       | name of increase action                       |
| `userId`      | integer | Yes      | filter id of user                             |

***

## Request examples

### cURL

```bash theme={null}
curl -X POST "https://api.unibee.dev/merchant/credit/promo_credit_increment" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 0,
  "currency": "",
  "description": "",
  "name": "",
  "userId": 0
}'
```

### Sandbox

```bash theme={null}
curl -X POST "https://api-sandbox.unibee.top/merchant/credit/promo_credit_increment" \
  -H "Authorization: Bearer YOUR_SANDBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 0,
  "currency": "",
  "description": "",
  "name": "",
  "userId": 0
}'
```

***

## Response

Success responses return a JSON envelope with `code`, `data`, `message`, `redirect`, and `requestId`. `code` `0` indicates success.

| Field                         | Type    | Description                  |
| ----------------------------- | ------- | ---------------------------- |
| `code`                        | integer | Response code. `0` = success |
| `data`                        | object  | Response payload             |
| `data.UserPromoCreditAccount` | object  |                              |
| `message`                     | string  | Human-readable message       |
| `requestId`                   | string  | Request ID for support       |

***

## Error handling

| HTTP status | Meaning                                                                   |
| ----------- | ------------------------------------------------------------------------- |
| 400         | Bad request — invalid or missing parameters. Check `message` in the body. |
| 401         | Unauthorized — missing or invalid API key.                                |
| 404         | Not found — invalid path or resource.                                     |
| 500         | Server error — retry with backoff.                                        |

When `code` in the response body is non-zero, check `message` for details. Use `requestId` when contacting support.


## OpenAPI

````yaml post /merchant/credit/promo_credit_increment
openapi: 3.0.0
info:
  description: UniBee Api Server
  license:
    name: Apache-2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  title: OpenAPI UniBee
  version: daily,buildtime:202607240926
servers:
  - url: https://api.unibee.dev
  - url: https://api-sandbox.unibee.top
security:
  - Authorization: []
paths:
  /merchant/credit/promo_credit_increment:
    post:
      tags:
        - Promo Credit
      summary: Promo Credit Increment
      description: Increase user promo credit amount
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/unibee.api.merchant.credit.PromoCreditIncrementReq
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  code:
                    format: int
                    properties: {}
                    type: integer
                  data:
                    properties:
                      UserPromoCreditAccount:
                        $ref: '#/components/schemas/unibee.api.bean.CreditAccount'
                      creditTransaction:
                        $ref: '#/components/schemas/unibee.api.bean.CreditTransaction'
                    type: object
                  merchantId:
                    format: int64
                    properties: {}
                    type: integer
                  message:
                    format: string
                    properties: {}
                    type: string
                  redirect:
                    format: string
                    properties: {}
                    type: string
                  requestId:
                    format: string
                    properties: {}
                    type: string
                type: object
          description: ''
components:
  schemas:
    unibee.api.merchant.credit.PromoCreditIncrementReq:
      description: Increase user promo credit amount
      properties:
        amount:
          description: The amount to increase, should greater than 0
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency of recharge
          format: string
          properties: {}
          type: string
        description:
          description: description of increase action
          format: string
          properties: {}
          type: string
        idempotencyKey:
          description: >-
            Optional. Client-supplied idempotency key, max 256 chars (UUID
            recommended). Retrying the same key returns the original credit
            transaction and does NOT increase the balance a second time. Reusing
            the same key with a different amount or currency is rejected.
            Increment and decrement use separate namespaces and are isolated per
            merchant and user, so reusing the same key on the decrement
            endpoint, under another merchant, or for another user does not
            collide. If two requests with the same key are still in-flight, the
            later one returns an error and should be retried by the caller.
          format: string
          properties: {}
          type: string
        name:
          description: name of increase action
          format: string
          properties: {}
          type: string
        userId:
          description: filter id of user
          format: int64
          properties: {}
          type: integer
      required:
        - userId
        - currency
        - amount
      type: object
    unibee.api.bean.CreditAccount:
      properties:
        amount:
          description: credit amount, in cent if type is main
          format: int64
          properties: {}
          type: integer
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        currencyAmount:
          description: currency amount, in cent
          format: int64
          properties: {}
          type: integer
        exchangeRate:
          description: >-
            keep two decimal places，multiply by 100 saved, 1 currency = 1 credit
            * (exchange_rate/100), main account fixed rate to 100
          format: int64
          properties: {}
          type: integer
        id:
          description: Id
          format: int64
          properties: {}
          type: integer
        payoutEnable:
          description: 0-no, 1-yes
          format: int
          properties: {}
          type: integer
        rechargeEnable:
          description: 0-no, 1-yes
          format: int
          properties: {}
          type: integer
        totalDecrementAmount:
          description: the total decrement amount
          format: int64
          properties: {}
          type: integer
        totalIncrementAmount:
          description: the total increment amount
          format: int64
          properties: {}
          type: integer
        type:
          description: type of credit account, 1-main account, 2-gift account
          format: int
          properties: {}
          type: integer
        userId:
          description: user_id
          format: int64
          properties: {}
          type: integer
      type: object
    unibee.api.bean.CreditTransaction:
      properties:
        accountType:
          description: >-
            type of credit account, 1-main recharge account, 2-promo credit
            account
          format: int
          properties: {}
          type: integer
        bizId:
          description: business id
          format: string
          properties: {}
          type: string
        by:
          format: string
          properties: {}
          type: string
        createTime:
          description: create utc time
          format: int64
          properties: {}
          type: integer
        creditAmountAfter:
          description: the credit amount after transaction,cent
          format: int64
          properties: {}
          type: integer
        creditAmountBefore:
          description: the credit amount before transaction,cent
          format: int64
          properties: {}
          type: integer
        creditId:
          description: id of credit account
          format: int64
          properties: {}
          type: integer
        currency:
          description: currency
          format: string
          properties: {}
          type: string
        deltaAmount:
          description: delta amount,cent
          format: int64
          properties: {}
          type: integer
        deltaCurrencyAmount:
          description: delta currency amount, in cent
          format: int64
          properties: {}
          type: integer
        description:
          description: recharge transaction description
          format: string
          properties: {}
          type: string
        exchangeRate:
          description: >-
            ExchangeRate for transaction, keep two decimal places，multiply by
            100 saved, 1 currency = 1 credit * (exchange_rate/100), main account
            fixed rate to 100
          format: int64
          properties: {}
          type: integer
        id:
          description: Id
          format: int64
          properties: {}
          type: integer
        invoiceId:
          description: invoice_id
          format: string
          properties: {}
          type: string
        merchantId:
          description: merchant id
          format: int64
          properties: {}
          type: integer
        name:
          description: recharge transaction title
          format: string
          properties: {}
          type: string
        transactionId:
          description: unique id for timeline
          format: string
          properties: {}
          type: string
        transactionType:
          description: >-
            transaction type。1-recharge income，2-payment out，3-refund
            income，4-withdraw out，5-withdraw failed income, 6-admin
            change，7-recharge refund out
          format: int
          properties: {}
          type: integer
        userId:
          description: user_id
          format: int64
          properties: {}
          type: integer
      type: object
  securitySchemes:
    Authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````