> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.qikify.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# API Documentations

## ${color}[#000000](Debit Customer Credit Account)
Debit a customer's credit account by a specific amount.

|| POST: api.getkoin.io/open/credit-accounts/debit


### **Authentication**
> This endpoint requires an API Key (Bearer token). Only backend servers are authorized to call this endpoint.

```
Authorization: Bearer <API_KEY>
```


### **Headers**
| Name | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| `Accept` | `string` | ✅ | Must be `application/json` |
| `Content-Type` | `string` | ✅ | Must be `application/json` |
| `Authorization` | `string` | ✅ | Bearer API key for backend authentication |


### **Request Body**
| Field | Type | Required | Description |
| ---- | ---- | ---- | ---- |
| `customer_id` | `string` | ✅ | The unique identifier of the customer. |
| `amount` | `number` | ✅ | Amount to be debited from the customer's credit account. |
| `currency` | `string` | ✅ | The ISO 4217 currency code (e.g. `USD`). |
| `reason` | `string` | ❌ | Reason for the debit transaction. |
| `tags` | `string` | ❌ | Optional tag for categorizing or tracking the transaction. |

### **Example request**
```
curl --location 'https://api.getkoin.io/open/credit-accounts/debit' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer aBEcqyjTI1twdn8ukXhDDjjXA5AgMb79pUNNulOlDwGu0jAQvPzXebMDn0I0XP1xgkDA6frmdp6fsAR3' \
--data '{
    "customer_id": "123456789",
    "amount": 10,
    "currency": "USD",
    "reason": "Refund for order #12345",
    "tags": "adjustment"
}'
```

**Example Response (200 OK)**

```
    "data": {
        "presentment_amount": "10.00",
        "presentment_currency": "USD",
        "amount": "10.00",
        "currency": "USD",
        "amount_usd": "10.00",
        "status": "success",
        "shopify_credit_id": null,
        "shopify_debit_id": "d_8a62c4e7f8e44c93b124",
        "error_message": null,
        "reason": "Refund for order #12345",
        "expires_at": null,
        "executed_at": "2025-10-21T12:30:00Z",
        "tags": "refund",
        "source_type": "third_party",
        "created_at": "2025-10-21T12:30:00Z",
        "updated_at": "2025-10-21T12:30:00Z",
        "type": "DEBIT"
    }
```

### Rate Limit: 
120 requests per minute