ChargX Documentation

Admin API

Admin API documentation

Welcome to ChargX payment gateway Admin API documentation - set of methods for administrative purpose for your merchant account.

Before you start

Before you start, make sure:

To create a Secret API Key - follow the steps:

  1. Go to Dashboard, Settings → Secret API Keys.
  2. Create one and copy it.
  3. Store your secret key securely and never expose it in frontend code.

REST API endpoint

Basic URL: https://api.chargx.io/admin

Headers

The only mandatory header required for all types of requests is Authorization which should contain a value of Basic: Your-Secret-API-Key.

Create Product

Create a product.

Request:

POST https://api.chargx.io/admin/products

Headers:
Authorization=Basic sk_256c3fa9....t23f
content-type=application/json

Body:
{
  title: "Enterprise Subscription",
  options: [
    {
      title: "Plan",
      values: ["S", "M", "L"],
    },
  ],
  variants: [
    {
      title: "S plan",
      options: {
        Plan: "S",
      },
      prices: [
        {
          currency_code: "USD",
          amount: 600,
        },
      ],
      metadata: {
        recurring_payment: {
          unit: "days",
          amount: "49",
          length: "14",
          trial_amount: "0",
          total_occurrences: "12",
          trial_occurrences: "0",
        },
      },
    },
    {
      title: "M plan",
      options: {
        Plan: "M",
      },
      prices: [
        {
          currency_code: "USD",
          amount: 900,
        },
      ],
      metadata: {
        recurring_payment: {
          unit: "days",
          amount: "79",
          length: "14",
          trial_amount: "39",
          total_occurrences: "10",
          trial_occurrences: "1",
        },
      },
    },
    {
      title: "L plan",
      options: {
        Plan: "L",
      },
      prices: [
        {
          currency_code: "USD",
          amount: 1200,
        },
      ],
      metadata: {
        recurring_payment: {
          unit: "days",
          amount: "99",
          length: "30",
          trial_amount: "59",
          total_occurrences: "8",
          trial_occurrences: "2",
        },
      },
    },
  ],
}

Response:

{
  "product": {
    "variants": [
      {
        "prices": [
          {
            "id": "string",
            "title": "string",
            "currency_code": "usd",
            "amount": 0,
            "raw_amount": {},
            "min_quantity": 0,
            "max_quantity": 0,
            "price_set_id": "string",
            "created_at": "2025-08-24T14:15:22Z",
            "updated_at": "2025-08-24T14:15:22Z",
            "deleted_at": "2025-08-24T14:15:22Z"
          }
        ],
        "id": "string",
        "title": "string",
        "sku": "string",
        "barcode": "string",
        "ean": "string",
        "upc": "string",
        "allow_backorder": true,
        "manage_inventory": true,
        "hs_code": "string",
        "origin_country": "string",
        "mid_code": "string",
        "material": "string",
        "weight": 0,
        "length": 0,
        "height": 0,
        "width": 0,
        "options": [
          {"id": "string", "value": "string"}
        ],
        "created_at": "2025-08-24T14:15:22Z",
        "updated_at": "2025-08-24T14:15:22Z",
        "deleted_at": "2025-08-24T14:15:22Z",
        "images": [
          {
            "id": "string",
            "url": "string",
            "rank": 0
          }
        ],
        "thumbnail": "string",
        "metadata": {
          "recurring_payment": {
            "unit": "days" | "months",
            "amount": string,
            "length": string,
            "trial_amount": string,
            "total_occurrences": string,
            "trial_occurrences": string
          }
        }
      }
    ],
    "type": {
      "id": "string",
      "value": "string",
      "created_at": "2025-08-24T14:15:22Z",
      "updated_at": "2025-08-24T14:15:22Z"
    },
    "length": 0,
    "title": "string",
    "status": "draft",
    "options": [
      {"id": "string", "title": "string"}
    ],
    "description": "string",
    "id": "string",
    "created_at": "2025-08-24T14:15:22Z",
    "updated_at": "2025-08-24T14:15:22Z",
    "handle": "string",
    "subtitle": "string",
    "is_giftcard": true,
    "thumbnail": "string",
    "width": 0,
    "weight": 0,
    "height": 0,
    "origin_country": "string",
    "hs_code": "string",
    "mid_code": "string",
    "material": "string",
    "collection_id": "string",
    "type_id": "string",
    "images": [
      {"id": "string", "url": "string", "rank": 0}
    ],
    "discountable": true,
    "external_id": "string",
    "deleted_at": "2025-08-24T14:15:22Z"
  }
}

List Products

List subscription products.

Request:

GET https://api.chargx.io/admin/products

Headers:
Authorization=Basic sk_256c3fa9....t23f
content-type=application/json

Query parameters:

FieldTypeRequiredDescription
limitnumber⚙️ OptionalMaximum number of products to return. Default: 50.
offsetnumber⚙️ OptionalNumber of products to skip before starting to collect the result set. Default: 0.
qstring⚙️ OptionalFree‑text search over subscription product fields like title and description.
statusstring⚙️ OptionalFilter products by status, for example published or draft.
expandstring⚙️ OptionalComma‑separated list of relations to include, for example variants,images.
fieldsstring⚙️ OptionalComma‑separated list of fields to include in the response.

Response:

{
  "products": [
    {
      "id": "string",
      "title": "string",
      "subtitle": "string",
      "description": "string",
      "status": "string",
      "options": [
        {
          "id": "string",
          "title": "string"
        }
      ],
      "variants": [
        {
          "id": "string",
          "title": "string",
          "options": [
            {
              "id": "string",
              "value": "string"
            }
          ],
          "prices": [
            {
              "id": "string",
              "title": "string",
              "currency_code": "usd",
              "amount": 0,
              "min_quantity": 0,
              "max_quantity": 0
            }
          ],
          "metadata": {
            "recurring_payment": {
              "unit": "days" | "months",
              "amount": string,
              "length": string,
              "trial_amount": string,
              "total_occurrences": string,
              "trial_occurrences": string
            }
          },
          "created_at": "2025-08-24T14:15:22Z",
          "updated_at": "2025-08-24T14:15:22Z"
        },
        {
          "id": "string",
          "title": "string",
          "options": [
            {
              "id": "string",
              "value": "string"
            }
          ],
          "prices": [
            {
              "id": "string",
              "title": "string",
              "currency_code": "usd",
              "amount": 0,
              "min_quantity": 0,
              "max_quantity": 0
            }
          ],
          "metadata": {
            "recurring_payment": {
              "unit": "days" | "months",
              "amount": string,
              "length": string,
              "trial_amount": string,
              "total_occurrences": string,
              "trial_occurrences": string
            }
          },
          "created_at": "2025-08-24T14:15:22Z",
          "updated_at": "2025-08-24T14:15:22Z"
        },
        {
          "id": "string",
          "title": "string",
          "options": [
            {
              "id": "string",
              "value": "string"
            }
          ],
          "prices": [
            {
              "id": "string",
              "title": "string",
              "currency_code": "usd",
              "amount": 0,
              "min_quantity": 0,
              "max_quantity": 0
            }
          ],
          "metadata": {
            "recurring_payment": {
              "unit": "days" | "months",
              "amount": string,
              "length": string,
              "trial_amount": string,
              "total_occurrences": string,
              "trial_occurrences": string
            }
          },
          "created_at": "2025-08-24T14:15:22Z",
          "updated_at": "2025-08-24T14:15:22Z"
        }
      ],
      "collection_id": "string",
      "type_id": "string",
      "discountable": true,
      "thumbnail": "string",
      "created_at": "2025-08-24T14:15:22Z",
      "updated_at": "2025-08-24T14:15:22Z",
      "deleted_at": null
    }
  ],
  "count": 1,
  "limit": 20,
  "offset": 0
}

List Orders

List orders.

Request:

GET https://api.chargx.io/admin/orders

Headers:
Authorization=Basic sk_256c3fa9....t23f
content-type=application/json

Query parameters:

FieldTypeRequiredDescription
limitnumber⚙️ OptionalMaximum number of orders to return. Default: 50.
offsetnumber⚙️ OptionalNumber of orders to skip before starting to collect the result set. Default: 0.
qstring⚙️ OptionalFree‑text search over order fields like display_id and email.
statusstring⚙️ OptionalFilter orders by status, for example pending, completed, or canceled.
payment_statusstring⚙️ OptionalFilter orders by payment status, for example awaiting, captured, or refunded.
fulfillment_statusstring⚙️ OptionalFilter orders by fulfillment status, for example not_fulfilled, fulfilled, or partially_fulfilled.
expandstring⚙️ OptionalComma‑separated list of relations to include, for example items,customer,payments.
fieldsstring⚙️ OptionalComma‑separated list of fields to include in the response.

Response:

{
  "orders": [
    {
      "id": "string",
      "display_id": 0,
      "status": "string",
      "version": 0,
      "summary": {
        "paid_total": 0,
        "raw_paid_total": {
          "value": "string",
          "precision": 0
        },
        "refunded_total": 0,
        "accounting_total": 0,
        "credit_line_total": 0,
        "transaction_total": 0,
        "pending_difference": 0,
        "raw_refunded_total": {
          "value": "string",
          "precision": 0
        },
        "current_order_total": 0,
        "original_order_total": 0,
        "raw_accounting_total": {
          "value": "string",
          "precision": 0
        },
        "raw_credit_line_total": {
          "value": "string",
          "precision": 0
        },
        "raw_transaction_total": {
          "value": "string",
          "precision": 0
        },
        "raw_pending_difference": {
          "value": "string",
          "precision": 0
        },
        "raw_current_order_total": {
          "value": "string",
          "precision": 0
        },
        "raw_original_order_total": {
          "value": "string",
          "precision": 0
        }
      },
      "total": 0,
      "metadata": {},
      "created_at": "2025-08-24T14:15:22Z",
      "updated_at": "2025-08-24T14:15:22Z",
      "items": [
        {
          "id": "string",
          "title": "string",
          "subtitle": null,
          "thumbnail": null,
          "variant_id": null,
          "product_id": null,
          "product_title": null,
          "product_description": null,
          "product_subtitle": null,
          "product_type": null,
          "product_type_id": null,
          "product_collection": null,
          "product_handle": null,
          "variant_sku": null,
          "variant_barcode": null,
          "variant_title": null,
          "variant_option_values": null,
          "requires_shipping": false,
          "is_giftcard": false,
          "is_discountable": true,
          "is_tax_inclusive": false,
          "is_custom_price": false,
          "metadata": null,
          "raw_compare_at_unit_price": null,
          "raw_unit_price": {
            "value": "string",
            "precision": 0
          },
          "created_at": "2025-08-24T14:15:22Z",
          "updated_at": "2025-08-24T14:15:22Z",
          "deleted_at": null,
          "tax_lines": [],
          "adjustments": [],
          "compare_at_unit_price": null,
          "unit_price": 0,
          "quantity": 0,
          "raw_quantity": {
            "value": "string",
            "precision": 0
          },
          "detail": {
            "id": "string",
            "version": 0,
            "metadata": null,
            "order_id": "string",
            "raw_unit_price": {
              "value": "string",
              "precision": 0
            },
            "raw_compare_at_unit_price": null,
            "raw_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_fulfilled_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_delivered_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_shipped_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_return_requested_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_return_received_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_return_dismissed_quantity": {
              "value": "string",
              "precision": 0
            },
            "raw_written_off_quantity": {
              "value": "string",
              "precision": 0
            },
            "created_at": "2025-08-24T14:15:22Z",
            "updated_at": "2025-08-24T14:15:22Z",
            "deleted_at": null,
            "item_id": "string",
            "unit_price": 0,
            "compare_at_unit_price": null,
            "quantity": 0,
            "fulfilled_quantity": 0,
            "delivered_quantity": 0,
            "shipped_quantity": 0,
            "return_requested_quantity": 0,
            "return_received_quantity": 0,
            "return_dismissed_quantity": 0,
            "written_off_quantity": 0
          },
          "subtotal": 0,
          "total": 0,
          "original_subtotal": 0,
          "original_total": 0,
          "discount_subtotal": 0,
          "discount_tax_total": 0,
          "discount_total": 0,
          "tax_total": 0,
          "original_tax_total": 0,
          "refundable_total_per_unit": 0,
          "refundable_total": 0,
          "fulfilled_total": 0,
          "shipped_total": 0,
          "return_requested_total": 0,
          "return_received_total": 0,
          "return_dismissed_total": 0,
          "write_off_total": 0,
          "raw_subtotal": {
            "value": "string",
            "precision": 0
          },
          "raw_total": {
            "value": "string",
            "precision": 0
          },
          "raw_original_subtotal": {
            "value": "string",
            "precision": 0
          },
          "raw_original_total": {
            "value": "string",
            "precision": 0
          },
          "raw_discount_subtotal": {
            "value": "string",
            "precision": 0
          },
          "raw_discount_tax_total": {
            "value": "string",
            "precision": 0
          },
          "raw_discount_total": {
            "value": "string",
            "precision": 0
          },
          "raw_tax_total": {
            "value": "string",
            "precision": 0
          },
          "raw_original_tax_total": {
            "value": "string",
            "precision": 0
          },
          "raw_refundable_total_per_unit": {
            "value": "string",
            "precision": 0
          },
          "raw_refundable_total": {
            "value": "string",
            "precision": 0
          },
          "raw_fulfilled_total": {
            "value": "string",
            "precision": 0
          },
          "raw_shipped_total": {
            "value": "string",
            "precision": 0
          },
          "raw_return_requested_total": {
            "value": "string",
            "precision": 0
          },
          "raw_return_received_total": {
            "value": "string",
            "precision": 0
          },
          "raw_return_dismissed_total": {
            "value": "string",
            "precision": 0
          },
          "raw_write_off_total": {
            "value": "string",
            "precision": 0
          }
        }
      ],
      "payment_status": "string",
      "fulfillment_status": "string"
    }
  ],
  "count": 1,
  "limit": 20,
  "offset": 0
}

Payout

Use this method to initiate payout.

Request:

POST https://api.chargx.io/admin/payout

Headers:
Authorization=Basic sk_256c3fa9....t23f
content-type=application/json

Body:
{
  "amount": 10.05,
  "bank_details": {
    "bank_name": "Bank name",
    "beneficiary_name": "John Doe",
    "beneficiary_account_number": "12345678",
    "branch_transit": "001",
    "institution_number": "123",
    "swift_code": "TST123",
    "aba": "000111222",
    "iban": "GB00TEST123456789",
    "routing_code": "987654321"
  }
}

Parameters

FieldTypeRequiredDescription
idstring✅ YesUnique identifier for the bank record.
bank_namestring✅ YesName of the receiving bank.
beneficiary_namestring✅ YesName of the account holder receiving the funds.
beneficiary_account_numberstring⚙️ OptionalAccount number of the beneficiary.
branch_transitstring⚙️ OptionalBranch transit number (used in certain regions such as Canada).
institution_numberstring⚙️ OptionalFinancial institution identifier.
swift_codestring⚙️ OptionalSWIFT/BIC code for international transfers.
abastring⚙️ OptionalABA routing number used mainly in U.S. banking.
ibanstring⚙️ OptionalInternational Bank Account Number.
routing_codestring⚙️ OptionalRegional routing code if applicable.
reference_instructionsstring⚙️ OptionalAdditional notes or transfer instructions.
bank_address.streetstring⚙️ OptionalStreet address of the bank.
bank_address.unitstring⚙️ OptionalSuite or unit number.
bank_address.citystring⚙️ OptionalCity of the bank.
bank_address.state_provincestring⚙️ OptionalState or province of the bank.
bank_address.countrystring⚙️ OptionalCountry of the bank.
bank_address.zip_codenumber⚙️ OptionalZIP or postal code.
beneficiary_address.streetstring⚙️ OptionalStreet address of the beneficiary.
beneficiary_address.unitstring⚙️ OptionalUnit or building number.
beneficiary_address.citystring⚙️ OptionalCity of the beneficiary.
beneficiary_address.state_provincestring⚙️ OptionalState or province of the beneficiary.
beneficiary_address.countrystring⚙️ OptionalCountry of the beneficiary.
beneficiary_address.zip_codenumber⚙️ OptionalZIP or postal code.
corresponding_bank.namestring⚙️ OptionalCorrespondent bank name.
corresponding_bank.account_numberstring⚙️ OptionalAccount number at the correspondent bank.
corresponding_bank.swift_codestring⚙️ OptionalCorrespondent bank SWIFT/BIC code.
corresponding_bank.abastring⚙️ OptionalABA number if applicable.
corresponding_bank.ibanstring⚙️ OptionalIBAN code if applicable.
corresponding_bank.routing_codestring⚙️ OptionalRouting number for correspondent bank.
corresponding_bank.address.streetstring⚙️ OptionalCorrespondent bank street address.
corresponding_bank.address.unitstring⚙️ OptionalUnit or building number.
corresponding_bank.address.citystring⚙️ OptionalCity of correspondent bank.
corresponding_bank.address.state_provincestring⚙️ OptionalState/province of correspondent bank.
corresponding_bank.address.countrystring⚙️ OptionalCountry of correspondent bank.
corresponding_bank.address.zip_codenumber⚙️ OptionalPostal or ZIP code.
further_remit_to.beneficiary_namestring⚙️ OptionalAdditional beneficiary name if funds must be rerouted.
further_remit_to.beneficiary_account_numberstring⚙️ OptionalAccount number for further remittance beneficiary.

Response:

{
  "payout": {
    "id": "02KADK27HCACB6880WSN2WMYB1",
    "amount": 10.05,
    "status": "pending",
    "created_at": "2025-11-19T08:17:58.829Z",
    "updated_at": "2025-11-19T08:17:58.829Z",
    "deleted_at": null
  }
}