> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paycrest.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Sender KYB

> Returns a sender's approved KYB, with its beneficial owners' details, this provider's stats with that
sender, and short-lived links to the company's and the owners' documents. Enabled per provider on request; contact Paycrest to turn it on.

You can only fetch a sender whose order you have filled or currently hold, and only when that
sender's KYB is approved. Otherwise, or if the feature is not enabled for you, the API returns
**404** with the same message, `Sender not found`.

Authenticate with HMAC. Provider routes do not accept a bare `API-Key` header. Sign the query
parameters as compact JSON, with `timestamp` as a number.

Treat the response as personal data.


> [!NOTE]
>
> This endpoint is enabled per provider on request; contact Paycrest to turn it on. Provider routes do not accept a bare `API-Key` header.

## Sign the request

Send `Authorization: HMAC <api-key-id>:<hex signature>`. Use the API key ID and API secret from **Settings → API keys**. The signature is HMAC-SHA256 of a JSON object built from the query parameters, keyed with your API secret, encoded as lowercase hex.

1. Put every query parameter into an object. Path parameters are not signed.
2. Coerce `timestamp` to a JSON number. Every other parameter stays a string (the first value, if a key is repeated).
3. Serialize the object as compact JSON, with no spaces, and with keys in alphabetical order. For this endpoint the signed string is `{"timestamp":1733300000}`.

`timestamp` is the current Unix time in seconds, and it must be no more than 5 minutes old. If you also send other query parameters, include them in the same object.

### Node.js

```javascript theme={null}
const crypto = require("crypto");

const apiKeyId = process.env.PAYCREST_API_KEY_ID;
const apiSecret = process.env.PAYCREST_API_SECRET;
const senderId = "11111111-1111-1111-1111-111111111111";
const timestamp = Math.floor(Date.now() / 1000);

// Compact JSON, timestamp as a number. Add sort-keys if the object has more than one field.
const payload = JSON.stringify({ timestamp });
const signature = crypto
  .createHmac("sha256", apiSecret)
  .update(payload)
  .digest("hex");

const res = await fetch(
  `https://api.paycrest.io/v2/provider/senders/${senderId}?timestamp=${timestamp}`,
  { headers: { Authorization: `HMAC ${apiKeyId}:${signature}` } }
);
const body = await res.json();
```

### Python

```python theme={null}
import hashlib, hmac, json, os, time, urllib.request

api_key_id = os.environ["PAYCREST_API_KEY_ID"]
api_secret = os.environ["PAYCREST_API_SECRET"]
sender_id = "11111111-1111-1111-1111-111111111111"
timestamp = int(time.time())

payload = json.dumps({"timestamp": timestamp}, separators=(",", ":"), sort_keys=True)
signature = hmac.new(api_secret.encode(), payload.encode(), hashlib.sha256).hexdigest()

req = urllib.request.Request(
    f"https://api.paycrest.io/v2/provider/senders/{sender_id}?timestamp={timestamp}",
    headers={"Authorization": f"HMAC {api_key_id}:{signature}"},
)
with urllib.request.urlopen(req) as resp:
    body = resp.read()
```

### curl

Compute the signature with one of the snippets above, then:

```bash theme={null}
curl "https://api.paycrest.io/v2/provider/senders/${SENDER_ID}?timestamp=${TIMESTAMP}" \
  -H "Authorization: HMAC ${API_KEY_ID}:${SIGNATURE}"
```


## OpenAPI

````yaml openapi-v2.yaml GET /provider/senders/{id}
openapi: 3.0.3
info:
  title: Paycrest Aggregator API
  version: 1.0.0
  description: >
    OpenAPI schema for the Paycrest Aggregator API. This covers sender,
    provider, and general endpoints.
servers:
  - url: https://api.paycrest.io/v2
security: []
tags:
  - name: Sender
    description: Endpoints for senders to create and manage payment orders
  - name: Provider
    description: Endpoints for providers to manage and fulfill orders
  - name: General
    description: General protocol and utility endpoints
paths:
  /provider/senders/{id}:
    get:
      tags:
        - Provider
      summary: Get a sender's approved KYB
      description: >
        Returns a sender's approved KYB, with its beneficial owners' details,
        this provider's stats with that

        sender, and short-lived links to the company's and the owners'
        documents. Enabled per provider on request; contact Paycrest to turn it
        on.


        You can only fetch a sender whose order you have filled or currently
        hold, and only when that

        sender's KYB is approved. Otherwise, or if the feature is not enabled
        for you, the API returns

        **404** with the same message, `Sender not found`.


        Authenticate with HMAC. Provider routes do not accept a bare `API-Key`
        header. Sign the query

        parameters as compact JSON, with `timestamp` as a number.


        Treat the response as personal data.
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
            format: uuid
          description: Sender profile ID, from `sender.id` on a v2 provider order.
        - in: query
          name: timestamp
          required: true
          schema:
            type: integer
            format: int64
            example: 1733300000
          description: >
            Unix time in seconds. Must be no more than 5 minutes old. Include it
            in the signed JSON as a

            number, not a string.
      responses:
        '200':
          description: Sender retrieved
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: success
                  message:
                    type: string
                    example: Sender retrieved
                  data:
                    $ref: '#/components/schemas/ProviderSenderKYBResponse'
        '401':
          description: Missing, stale, or invalid HMAC signature
        '404':
          description: >-
            Sender not found (also returned when the feature is off, you have no
            visible order from the sender, or the sender's KYB is not approved)
      security:
        - HmacAuth: []
      servers:
        - url: https://api.paycrest.io/v2
components:
  schemas:
    ProviderSenderKYBResponse:
      type: object
      description: >
        A sender's approved KYB as the provider who fills its orders sees it,
        with its beneficial owners' details

        and documents.
      properties:
        id:
          type: string
          format: uuid
        businessName:
          type: string
        tradingName:
          type: string
          description: Omitted when empty.
        registrationNumber:
          type: string
          description: Omitted when empty.
        registrationCountry:
          type: string
          description: ISO 3166-1 alpha-2 country of registration. Omitted when empty.
        registeredAddress:
          type: string
          description: Registered business address.
        website:
          type: string
          description: Omitted when empty.
        kybStatus:
          type: string
          enum:
            - approved
          description: >-
            Always `approved` on a successful response. Unapproved senders
            return 404.
        beneficialOwners:
          type: array
          items:
            $ref: '#/components/schemas/ProviderSenderKYBOwner'
        documents:
          type: array
          items:
            $ref: '#/components/schemas/ProviderSenderKYBDocument'
        stats:
          $ref: '#/components/schemas/ProviderSenderKYBStats'
    ProviderSenderKYBOwner:
      type: object
      description: |
        One beneficial owner with their identity details and documents.
      properties:
        id:
          type: string
          format: uuid
          description: >-
            The owner's ID. It appears in the keys of the owner's document
            links.
        fullName:
          type: string
        ownershipPercentage:
          type: number
          format: double
          description: Ownership share.
        dateOfBirth:
          type: string
          example: '1985-05-15'
          description: Date of birth as submitted.
        residentialAddress:
          type: string
        idType:
          type: string
          enum:
            - passport
            - drivers_license
            - national_id
            - other
          description: Omitted when empty.
        idNumber:
          type: string
          description: Number of the ID document. Omitted when empty.
        idCountry:
          type: string
          description: >-
            ISO 3166-1 alpha-2 code of the ID issuing country. Omitted when
            empty.
        bvn:
          type: string
          example: '22200000001'
          description: >-
            The owner's 11-digit BVN, for Nigerian owners when on file. Omitted
            otherwise.
        nin:
          type: string
          example: '33300000002'
          description: >-
            The owner's 11-digit NIN, for Nigerian owners when on file. Omitted
            otherwise.
        isPep:
          type: boolean
          nullable: true
          description: >-
            Whether the owner is a politically exposed person. `null` on owners
            submitted before the question was asked.
        pepDetail:
          type: string
          description: The owner's PEP explanation. Omitted when empty.
        documents:
          type: array
          description: >-
            The owner's government ID and proof of residential address, as
            signed links. Empty files are left out.
          items:
            $ref: '#/components/schemas/ProviderSenderKYBDocument'
    ProviderSenderKYBDocument:
      type: object
      description: >-
        One KYB document, of the company or of a beneficial owner, with a
        short-lived signed URL.
      properties:
        key:
          type: string
          description: >
            Document key used in the link path. For company documents, one of
            `certificate_of_incorporation`,

            `articles_of_incorporation`, `business_license`,
            `proof_of_business_address`,

            `aml_policy`, `kyc_policy`, or `other_N` for additional documents.
            For a beneficial owner,

            `owner_<ownerId>_government_id` or
            `owner_<ownerId>_proof_of_residential_address`.
        label:
          type: string
          description: Human-readable label, for example `Certificate of incorporation`.
        fileName:
          type: string
          description: File name from the stored document URL.
        url:
          type: string
          format: uri
          description: >-
            Absolute signed aggregator URL. No Authorization header is required.
            Expires at `expiresAt`.
        expiresAt:
          type: string
          format: date-time
          description: When `url` stops working, in UTC. Links are valid for 10 minutes.
    ProviderSenderKYBStats:
      type: object
      description: Counts only the calling provider's own orders with this sender.
      properties:
        fulfilledOrders:
          type: integer
          description: Number of settled orders this provider filled for the sender.
        volumeUsd:
          type: string
          description: >-
            USD value of those settled orders, to 2 decimal places (for example
            `"150.50"`).
        lastOrderAt:
          type: string
          format: date-time
          nullable: true
          description: >-
            Time of the latest order from the sender that was assigned to this
            provider, of any status.
  securitySchemes:
    HmacAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >
        HMAC authentication for provider routes.


        Send `Authorization: HMAC <api-key-id>:<hex signature>`. The signature
        is HMAC-SHA256 of the request

        payload, keyed with your API secret, encoded as lowercase hex.


        For GET and DELETE requests the payload is a compact JSON object of the
        query parameters, with keys in

        alphabetical order and no spaces. `timestamp` is a JSON number (Unix
        seconds, no more than 5 minutes

        old). Every other parameter is a string. Path parameters are not signed.
        Example for a request that

        only sends `timestamp`: `{"timestamp":1733300000}`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.