> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://dev.admoji.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://dev.admoji.com/_mcp/server.

# Mark as chargeback

POST https://openapi.admoji.com/api/v2/open/customers/mark-chargeback
Content-Type: application/json

Mark a customer as chargeback, blacklist them, and deactivate all recurrings.

Reference: https://dev.admoji.com/api-reference/admoji-crm-api/customers/mark-customer-chargeback

## Authentication

- `Authorization` header (required) — Format: `ApiKey <your_key>`

## Servers

- `https://openapi.admoji.com` (Live, default)
- `https://openapi.staging.admoji.com` (Test)

## Request

### Headers

- `Idempotency-Key` (string, required) — UUID to prevent duplicate POST operations

### Body (application/json)

This endpoint expects an object.

- `CustomerID` (integer, required)
- `Option` (enum, required) — cb = chargeback, cbalert = chargeback alert
  - Allowed values: `cb`, `cbalert`
- `GatewayTransactionID` (string, required)
- `IsRefund` (boolean, optional) — When true, treats the chargeback as a refund. Defaults to false.
- `Note` (string, optional) — Optional message to add to customer notes

## Response

### 200

Customer marked

- `Status` (enum, optional) — 0 = success, 1 = validation error, 2 = internal error
  - Allowed values: `0`, `1`, `2`

## Examples

**Request**

```json
{
  "CustomerID": 1,
  "Option": "cb",
  "GatewayTransactionID": "string"
}
```

**Response**

```json
{
  "Status": 0
}
```

**SDK Code**

```python
import requests

url = "https://openapi.admoji.com/api/v2/open/customers/mark-chargeback"

payload = {
    "CustomerID": 1,
    "Option": "cb",
    "GatewayTransactionID": "string"
}
headers = {
    "Idempotency-Key": "Idempotency-Key",
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://openapi.admoji.com/api/v2/open/customers/mark-chargeback';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': 'Idempotency-Key',
    Authorization: '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"CustomerID":1,"Option":"cb","GatewayTransactionID":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://openapi.admoji.com/api/v2/open/customers/mark-chargeback"

	payload := strings.NewReader("{\n  \"CustomerID\": 1,\n  \"Option\": \"cb\",\n  \"GatewayTransactionID\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://openapi.admoji.com/api/v2/open/customers/mark-chargeback")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = 'Idempotency-Key'
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"CustomerID\": 1,\n  \"Option\": \"cb\",\n  \"GatewayTransactionID\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://openapi.admoji.com/api/v2/open/customers/mark-chargeback")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"CustomerID\": 1,\n  \"Option\": \"cb\",\n  \"GatewayTransactionID\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://openapi.admoji.com/api/v2/open/customers/mark-chargeback', [
  'body' => '{
  "CustomerID": 1,
  "Option": "cb",
  "GatewayTransactionID": "string"
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://openapi.admoji.com/api/v2/open/customers/mark-chargeback");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"CustomerID\": 1,\n  \"Option\": \"cb\",\n  \"GatewayTransactionID\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Idempotency-Key": "Idempotency-Key",
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "CustomerID": 1,
  "Option": "cb",
  "GatewayTransactionID": "string"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://openapi.admoji.com/api/v2/open/customers/mark-chargeback")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```