# Payment to Merchant

<figure><img src="https://627965603-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FImVr2HJay0snj5ukhBJK%2Fuploads%2F8XvFFJ0EPOGZ2I9aieeU%2Funknown.png?alt=media&#x26;token=d43ee799-d44c-41d1-9e76-49dd67136df4" alt=""><figcaption></figcaption></figure>

## **Method and URL**

`POST` \[BASE\_URL]/wallet-backend/snap/v1.0/debit/payment-host-to-host

Purpose:  Initiate a debit/payment transaction using the customer’s Pivot Pay balance via host-to-host integration. The API returns a web redirect URL for the payment authorization page.<br>

Authorization:

* B2B Token&#x20;
* B2B2C Token

## **Request**

**Request Header**

<table><thead><tr><th>Header</th><th width="128.3310546875">Requirement</th><th>Description</th></tr></thead><tbody><tr><td>Content-Type</td><td>Mandatory</td><td>application/json</td></tr><tr><td>Authorization</td><td>Mandatory</td><td>Bearer {B2B_access_token}</td></tr><tr><td>Authorization-Customer</td><td>Mandatory</td><td>Bearer {B2B2C_access_token}</td></tr><tr><td>X-SIGNATURE</td><td>Mandatory</td><td><p>HMAC signature generated as per SNAP specification</p><p><br></p><p>HMAC_SHA512 (clientSecret, stringToSign) </p><p>stringToSign = HTTPMethod +”:“+ EndpointUrl +":"+ AccessToken +":“+ Lowercase(HexEncode(SHA-256(minify(RequestBody))))+ ":“ + TimeStamp</p></td></tr><tr><td>X-TIMESTAMP</td><td>Mandatory</td><td>Request timestamp in yyyy-MM-dd'T'HH:mm:ssXXX (ISO 8601 with offset)</td></tr><tr><td>X-PARTNER-ID</td><td>Mandatory</td><td>Partner ID assigned by Pivot</td></tr><tr><td>X-EXTERNAL-ID</td><td>Mandatory</td><td>Unique ID per request for idempotency / tracing</td></tr><tr><td>CHANNEL-ID</td><td>Mandatory</td><td>Channel identifier (e.g., 12345)</td></tr></tbody></table>

**Request Body**

```json
{
  "additionalInfo": {},
  "subMerchantId": "88042168-bfa6-4e5c-bcca-5abf1d40a181",
  "partnerReferenceNo": "ref04080002",
  "amount": {
    "value": "10000.00",
    "currency": "IDR"
  },
  "urlParams": [
    {
      "url": "https://test.com",
      "type": "PAY_RETURN",
      "isDeeplink": false
    }
  ]
}
```

**Request Parameter Detail**&#x20;

<table><thead><tr><th>Parameter</th><th width="108.0625">Data Type</th><th width="113.9609375">Character Limit</th><th width="131.66015625">Requirement</th><th>Description</th></tr></thead><tbody><tr><td>additionalInfo</td><td>Object</td><td>-</td><td>Optional</td><td>Container for additional fields</td></tr><tr><td>subMerchantId</td><td>String</td><td>36</td><td>Mandatory</td><td>Merchant ID.</td></tr><tr><td>partnerReferenceNo</td><td>String</td><td>64</td><td>Mandatory</td><td>Unique reference number from the merchant for this payment request.</td></tr><tr><td>amount</td><td>Object</td><td>-</td><td>Mandatory</td><td>Payment amount object.</td></tr><tr><td>amount.value</td><td>String</td><td>20</td><td>Mandatory</td><td>Payment amount in decimal string (e.g., "10000.00").</td></tr><tr><td>amount.currency</td><td>String</td><td>3</td><td>Mandatory</td><td>Currency code of the transaction, e.g., IDR.</td></tr><tr><td>urlParams</td><td>Array</td><td>-</td><td>Mandatory</td><td>List of URL parameter objects used for redirect handling.</td></tr><tr><td>urlParams[].url</td><td>String</td><td>255</td><td>Mandatory</td><td>URL for redirecting the user after payment (e.g., payment result page).</td></tr><tr><td>urlParams[].type</td><td>String</td><td>20</td><td>Mandatory</td><td>URL type. In this example: PAY_RETURN.</td></tr><tr><td>urlParams[].isDeeplink</td><td>Boolean</td><td>-</td><td>Mandatory</td><td>Indicates whether the URL is a deeplink (true) or a standard HTTP/HTTPS URL (false).</td></tr></tbody></table>

## **Response**

**Response Body**

```json
{
  "additionalInfo": {
    "urlExpiredAt": "2025-08-04T17:24:42+07:00"
  },
  "referenceNo": "0198748e-f3ff-7eaf-a8fa-9b4532d2a6f8",
  "responseCode": "2005400",
  "responseMessage": "Successful",
  "webRedirectUrl": "https://wallet-stg.harsya.com/whitelabel/payment?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ3YWxsZXQtYmFja2VuZCIsInN1YiI6IjE0NzFlNGFjLTI3N2ItNGJiNi04MmQ4LWFlZTY4ODNhNTg2ZCIsImV4cCI6MTc1NDMwMzA4MiwiaWRlbnRpZmllclZhbHVlIjoiMTQ3MWU0YWMtMjc3Yi00YmI2LTgyZDgtYWVlNjg4M2E1ODZkIiwibWVyY2hhbnRJZCI6Ijg4MDQyMTY4LWJmYTYtNGU1Yy1iY2NhLTVhYmYxZDQwYTE4MSIsInNlc3Npb25JZCI6IjAxOTg3NDhlLWYzZmYtN2VhZi1hOGZhLTliNDUzMmQyYTZmOCJ9.YRcwtvEXguqL_ugmoMbRtfzYyL-jb6CZwava8mXdOwk"
}
```

**Response Parameter Detail**

<table><thead><tr><th>Parameter</th><th width="108.3505859375">Data Type</th><th width="109.48828125">Character Limit</th><th width="125.462890625">Requirement</th><th>Description</th></tr></thead><tbody><tr><td>additionalInfo</td><td>Object</td><td>-</td><td>Optional</td><td>Additional response information.</td></tr><tr><td>additionalInfo.urlExpiredAt</td><td>String</td><td>30</td><td>Mandatory</td><td>Expiration timestamp for the webRedirectUrl in ISO 8601 format with timezone.</td></tr><tr><td>referenceNo</td><td>String</td><td>64</td><td>Mandatory</td><td>System-generated reference number for this payment transaction.</td></tr><tr><td>responseCode</td><td>String</td><td>7</td><td>Mandatory</td><td>Response status code. 2005400 indicates the payment request was created successfully.</td></tr><tr><td>responseMessage</td><td>String</td><td>100</td><td>Mandatory</td><td>Description of the result, e.g., Successful.</td></tr><tr><td>webRedirectUrl</td><td>String (URL)</td><td>2048</td><td>Mandatory</td><td>URL to which the user should be redirected to authorize/complete the payment.</td></tr></tbody></table>

\ <br>
