---
title: "Create Order Balance"
method: POST
path: "/balances/order"
tags: ["Add Balances"]
---

# Create Order Balance

`POST /balances/order`

Membuat order top up balance dan mengembalikan data pembayaran dari Xendit.

**Nominal balance yang diperbolehkan:**
- 25000
- 50000
- 100000
- 200000
- 500000
- 1000000

**Payment method yang diperbolehkan:**
- virtual_account
- qris
- shopeepay
- dana
- linkaja

**Catatan:**
- `promo_code` bersifat opsional.
- Endpoint ini akan membuat order pembayaran dan mengembalikan URL/halaman pembayaran Xendit.

## Headers

- `Accept` string, required
- `Authorization` string, required
- `Content-Type` string, required

## Request body

- OrderBalanceRequest
  - `balance` 25000 | 50000 | 100000 | 200000 | 500000 | 1000000, required — Nilai balance/top up yang ingin dibeli.
  - `payment_method` 'virtual_account' | 'qris' | 'shopeepay' | 'dana' | 'linkaja', required — Metode pembayaran yang dipilih.
  - `promo_code` string, nullable — Kode promo jika ada.

## Response `201`

Order balance created successfully

- OrderBalanceSuccessResponse
  - `response` object
    - `status` string
    - `status_code` integer
    - `message` string
  - `data` object
    - `order_number` string — Nomor order balance.
    - `balance` integer — Nominal balance yang dibeli.
    - `payment_method` string — Metode pembayaran yang dipilih.
    - `promo_code` string, nullable — Promo code yang digunakan, jika ada.
    - `discount_amount` integer — Nominal potongan dari promo code.
    - `payment_fee` integer — Biaya pembayaran.
    - `total_amount` integer — Total akhir yang harus dibayar.
    - `xendit` object
      - `reference_id` string — Reference ID internal untuk pembayaran.
      - `invoice_id` string — ID invoice dari Xendit.
      - `invoice_url` string — URL halaman pembayaran Xendit.
      - `expiry_date` string, date-time — Waktu kedaluwarsa pembayaran.

## Other responses

- `401` — Unauthorized (token tidak valid)
- `422` — Validation error

---

[API](https://skmtc.net/rapatin/apis/authentication.md) · [All operations](https://skmtc.net/rapatin/apis/authentication/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rapatin/authentication/revisions/5aa22566f41f/schema)
