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

# Get Purchase History By ID

GET https://api-sandbox.coinflow.cash/api/customer/history/{paymentId}

Gets the Purchase for a Customer by ID

Reference: https://docs.coinflow.cash/api-reference/api-reference/customers/get-customer-payment-by-id

## Authentication

- `x-coinflow-auth-session-key` header (required) — The session key generated for the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key
- `x-coinflow-auth-wallet` header (required) — The web3 wallet of the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key
- `x-coinflow-auth-blockchain` header (required) — The blockchain associated with the end user - see https://docs.coinflow.cash/api-reference/api-reference/authentication/get-session-key

## Request

### Path parameters

- `paymentId` (string, required) — - Payment id to filter the request by

## Response

### 200

Ok

- `payment` (PaymentHistory, required)

## Types

### PaymentHistory

- `paymentId` (string, required)
- `merchant` (string, required)
- `totals` (TotalsResponse, required)
- `createdAt` (datetime, required)
- `status` (string, required)
- `signature` (string, optional)
- `subscription` (SubscriptionDisplay, optional)

### TotalsResponse

- `subtotal` (CurrencyCents, required)
- `creditCardFees` (CurrencyCents, required)
- `chargebackProtectionFees` (CurrencyCents, required)
- `gasFees` (CurrencyCents, required)
- `fxFees` (CurrencyCents, required)
- `total` (CurrencyCents, required)
- `networkFees` (CurrencyCents, optional)
- `payInFees` (CurrencyCents, optional)
- `reserve` (CurrencyCents, optional)
- `merchantPaidCreditCardFees` (CurrencyCents, optional)
- `merchantPaidChargebackProtectionFees` (CurrencyCents, optional)
- `merchantPaidGasFees` (CurrencyCents, optional)
- `merchantPaidFxFees` (CurrencyCents, optional)
- `merchantPaidNetworkFees` (CurrencyCents, optional)
- `invoicedCreditCardFees` (CurrencyCents, optional)
- `invoicedChargebackProtectionFees` (CurrencyCents, optional)
- `invoicedGasFees` (CurrencyCents, optional)
- `invoicedFxFees` (CurrencyCents, optional)
- `invoicedNetworkFees` (CurrencyCents, optional)
- `rebate` (CurrencyCents, optional)
- `invoicedRebate` (CurrencyCents, optional)

### SubscriptionDisplay

- `id` (string, required)
- `customerId` (string, required)
- `merchantId` (string, required)
- `email` (string, required)
- `plan` (string, required)
- `planCode` (string, required)
- `status` (enum, required)
  - Allowed values: `Active`, `Canceled`, `Expired`, `Concluded`, `Failed`, `Blocked`
- `blockchain` (enum, optional)
  - Allowed values: `solana`, `eth`, `polygon`, `base`, `user`, `arbitrum`, `stellar`, `monad`, `tempo`
- `nextPaymentAt` (datetime, optional)

### CurrencyCents

- `cents` (integer, required)
- `currency` (enum, required)
  - Allowed values: `USD`, `AED`, `AFN`, `ALL`, `AMD`, `ANG`, `AOA`, `ARS`, `AUD`, `AWG`, `AZN`, `BAM`, `BBD`, `BDT`, `BGN`, `BHD`, `BIF`, `BMD`, `BND`, `BOB`, `BRL`, `BSD`, `BTN`, `BWP`, `BYN`, `BZD`, `CAD`, `CHF`, `CLF`, `CLP`, `CNY`, `COP`, `CRC`, `CUP`, `CVE`, `CZK`, `DJF`, `DKK`, `DOP`, `DZD`, `EGP`, `ETB`, `EUR`, `FJD`, `GBP`, `GEL`, `GHS`, `GMD`, `GNF`, `GTQ`, `GYD`, `HKD`, `HNL`, `HTG`, `HUF`, `IDR`, `ILS`, `INR`, `IQD`, `IRR`, `ISK`, `JMD`, `JOD`, `JPY`, `KES`, `KGS`, `KHR`, `KMF`, `KRW`, `KWD`, `KYD`, `KZT`, `LAK`, `LBP`, `LKR`, `LRD`, `LSL`, `LYD`, `MAD`, `MDL`, `MGA`, `MKD`, `MMK`, `MNT`, `MOP`, `MRU`, `MUR`, `MWK`, `MVR`, `MXN`, `MYR`, `MZN`, `NAD`, `NGN`, `NIO`, `NOK`, `NPR`, `NZD`, `OMR`, `PAB`, `PEN`, `PGK`, `PHP`, `PKR`, `PLN`, `PYG`, `QAR`, `RON`, `RSD`, `RWF`, `SAR`, `SCR`, `SDG`, `SEK`, `SGD`, `SLE`, `SLL`, `SOS`, `SRD`, `STN`, `SVC`, `SYP`, `SZL`, `THB`, `TJS`, `TMT`, `TND`, `TOP`, `TRY`, `TTD`, `TWD`, `TZS`, `UAH`, `UGX`, `UYU`, `UZS`, `VND`, `VUV`, `WST`, `XAF`, `XCD`, `XOF`, `XPF`, `YER`, `ZAR`, `ZMW`, `ZWL`, `CDF`, `ERN`, `FKP`, `KPW`, `RUB`, `SBD`, `SHP`, `SSP`, `VES`

## Examples

**Response**

```json
{
  "payment": {
    "paymentId": "string",
    "merchant": "string",
    "totals": {
      "subtotal": {
        "cents": 1,
        "currency": "USD"
      },
      "creditCardFees": {
        "cents": 1,
        "currency": "USD"
      },
      "chargebackProtectionFees": {
        "cents": 1,
        "currency": "USD"
      },
      "gasFees": {
        "cents": 1,
        "currency": "USD"
      },
      "fxFees": {
        "cents": 1,
        "currency": "USD"
      },
      "total": {
        "cents": 1,
        "currency": "USD"
      },
      "networkFees": {
        "cents": 1,
        "currency": "USD"
      },
      "payInFees": {
        "cents": 1,
        "currency": "USD"
      },
      "reserve": {
        "cents": 1,
        "currency": "USD"
      },
      "merchantPaidCreditCardFees": {
        "cents": 1,
        "currency": "USD"
      },
      "merchantPaidChargebackProtectionFees": {
        "cents": 1,
        "currency": "USD"
      },
      "merchantPaidGasFees": {
        "cents": 1,
        "currency": "USD"
      },
      "merchantPaidFxFees": {
        "cents": 1,
        "currency": "USD"
      },
      "merchantPaidNetworkFees": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedCreditCardFees": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedChargebackProtectionFees": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedGasFees": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedFxFees": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedNetworkFees": {
        "cents": 1,
        "currency": "USD"
      },
      "rebate": {
        "cents": 1,
        "currency": "USD"
      },
      "invoicedRebate": {
        "cents": 1,
        "currency": "USD"
      }
    },
    "createdAt": "2024-01-15T09:30:00Z",
    "status": "string",
    "signature": "string",
    "subscription": {
      "id": "string",
      "customerId": "string",
      "merchantId": "string",
      "email": "string",
      "plan": "string",
      "planCode": "string",
      "status": "Active",
      "blockchain": "solana",
      "nextPaymentAt": "2024-01-15T09:30:00Z"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-sandbox.coinflow.cash/api/customer/history/paymentId"

headers = {"x-coinflow-auth-session-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api-sandbox.coinflow.cash/api/customer/history/paymentId';
const options = {method: 'GET', headers: {'x-coinflow-auth-session-key': '<apiKey>'}};

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"
	"net/http"
	"io"
)

func main() {

	url := "https://api-sandbox.coinflow.cash/api/customer/history/paymentId"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-coinflow-auth-session-key", "<apiKey>")

	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://api-sandbox.coinflow.cash/api/customer/history/paymentId")

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

request = Net::HTTP::Get.new(url)
request["x-coinflow-auth-session-key"] = '<apiKey>'

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.get("https://api-sandbox.coinflow.cash/api/customer/history/paymentId")
  .header("x-coinflow-auth-session-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-sandbox.coinflow.cash/api/customer/history/paymentId', [
  'headers' => [
    'x-coinflow-auth-session-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-sandbox.coinflow.cash/api/customer/history/paymentId");
var request = new RestRequest(Method.GET);
request.AddHeader("x-coinflow-auth-session-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["x-coinflow-auth-session-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/customer/history/paymentId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

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()
```