# Validate payment intent signature

`POST /v2/payments/intents/signature`

**Base URLs:**

- Sandbox: `https://api.sandbox.bobpay.co.za`
- Production: `https://api.bobpay.co.za`

**Authentication:** Bearer token required. Obtain one via `POST /login` (see the Authentication page).

## Example request

```bash
curl -X POST "https://api.sandbox.bobpay.co.za/v2/payments/intents/signature" \
  -H "content-type: application/json" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -d '{
    "recipient_account_code": "SAN001",
    "custom_payment_id": "478",
    "email": "customer@bob.co.za",
    "mobile_number": "",
    "amount": 499.99,
    "item_name": "Order 1452",
    "item_description": "Lego Star Wars",
    "notify_url": "https://api-sandbox.bobpay.co.za/payment/bobpay",
    "success_url": "https://sandbox.bobpay.co.za/accounts/payment-confirmation?provider=bobpay&id=478",
    "pending_url": "https://sandbox.bobpay.co.za/accounts/payment-confirmation?provider=bobpay&id=478",
    "cancel_url": "https://sandbox.bobpay.co.za/accounts/payment-cancel?provider=bobpay&id=478",
    "signature": "1eb8d2109cb744f0b6a63f168a75ac8e"
}'
```

This endpoint checks whether a previously generated signature is valid for a payment intent.

### Request

**Method:** `POST`
**URL:** `https://api.sandbox.bobpay.co.za/v2/payments/intents/signature`

#### Request body parameters

| Key | Description | Type | Required |
| --- | --- | --- | --- |
| recipient_account_code | The code of the account to receive the payment. | string | Yes |
| custom_payment_id | Custom identifier for the payment. | string | Yes |
| email | Payer's email address. | string | Conditional* |
| mobile_number | Payer's mobile number. | string | Conditional* |
| amount | The payment amount. | float | Yes |
| item_name | Name of the item being purchased. Included in the signature calculation, even when empty. | string | No |
| item_description | Description of the item. | string | No |
| notify_url | URL to send payment status notifications. | string | No |
| success_url | URL to redirect to on successful payment. | string | No |
| pending_url | URL to redirect to if payment is pending. | string | No |
| cancel_url | URL to redirect to if payment is cancelled. | string | No |
| signature | The signature previously generated for this payment intent. | string | Yes |

\* **Note:** Either `email` or `mobile_number` must be provided.

If the signature is valid, the payment intent is echoed back with a `200 OK` response. If the signature is invalid, a `400 Bad Request` error is returned.

---

### Response

**Status code:** `200 OK`
**Content-Type:** `application/json`

#### Response body

```json
{
    "id": 0,
    "uuid": "",
    "short_reference": "",
    "recipient_account_code": "SAN001",
    "email": "customer@bob.co.za",
    "custom_payment_id": "478",
    "notify_url": "https://api-sandbox.bobpay.co.za/payment/bobpay",
    "success_url": "https://sandbox.bobpay.co.za/accounts/payment-confirmation?provider=bobpay&id=478",
    "pending_url": "https://sandbox.bobpay.co.za/accounts/payment-confirmation?provider=bobpay&id=478",
    "cancel_url": "https://sandbox.bobpay.co.za/accounts/payment-cancel?provider=bobpay&id=478",
    "item_name": "Order 1452",
    "item_description": "Lego Star Wars",
    "amount": 499.99,
    "total_paid_amount": 0,
    "signature": "1eb8d2109cb744f0b6a63f168a75ac8e",
    "status": "",
    "payment_method": "",
    "payment_id": 0,
    "payment": {
        "id": 0,
        "payment_method_id": 0,
        "payment_method": "",
        "amount": 0,
        "status": ""
    },
    "is_test": false,
    "time_created": null,
    "time_modified": null
}
```

---

#### Response fields

| Field | Description | Type |
| --- | --- | --- |
| id | Unique identifier for the payment intent. | integer |
| uuid | Universally unique identifier for the payment intent. | string |
| short_reference | Short reference or code for easy tracking/display. | string |
| recipient_account_code | Code of the account receiving the payment. | string |
| email | Payer's email address. | string |
| account_id | Unique identifier of the account initiating the payment. | integer |
| custom_payment_id | Your custom reference for the payment. | string |
| notify_url | URL to notify when payment status changes. | string |
| success_url | Redirect URL for successful payment. | string |
| pending_url | Redirect URL for pending payment. | string |
| cancel_url | Redirect URL for cancelled payment. | string |
| item_name | Name of the item being purchased. | string |
| item_description | Description of the item. | string |
| amount | Amount of the payment intent. | float |
| total_paid_amount | Amount paid so far towards this intent. | float |
| signature | Signature used for this intent (should match request). | string |
| status | Current status of the payment intent (`canceled`, `chargeback`, `deleted`, `failed`, `paid`, `partially_refunded`, `refund_pending`, `refunded`, `unpaid`). | string |
| payment_method | The actual method used for the payment. | string |
| payment_id | Internal system ID of the payment record associated with this intent. | integer |
| payment | Object containing payment transaction details. | object |
| is_test | Boolean flag indicating if this payment intent is a test transaction. | boolean |
| time_created | Timestamp of when the payment intent was created. | string (datetime) |
| time_modified | Timestamp of the last modification to the payment intent. | string (datetime) |
| payment.id | Unique identifier for the actual payment transaction. | integer |
| payment.payment_method_id | Internal ID referencing the specific payment method used. | integer |
| payment.payment_method | Name of the payment method used for the transaction. | string |
| payment.amount | The amount processed in this payment transaction. | float |
| payment.status | Status of the payment transaction (`cancelled`, `chargeback`, `failed`, `partially_refunded`, `pending`, `refund_pending`, `refunded`, `reversed`, `success`). | string |
