# Create a pricing intent

Create a pricing intent by sending a POST request to the Pricing Intents endpoint, defining base fees, processor fees, and gateway fees to use as a reusable template for merchant processing accounts.

**Prerequisites:** [Authentication](/api/authentication)

A pricing intent is a template of fees that you apply to processing accounts when you board merchants. You can apply the same pricing intent to all processing accounts that you create or create multiple pricing intents to apply to different processing accounts. A pricing intent can include the following fee types:

- **Base fees:** For monthly maintenance, chargebacks, and early contract termination. All pricing intents must include base fees.
- **Processor fees:** For card payments and
  
  Automated Clearing House (ACH)
  
  payments. Processor fees also include the pricing model that you offer to the merchant, for example,
  
  RewardPay
  
  .
- **Gateway fees:** For using our payment gateway.

<a id="integration-steps"></a>
## Integration steps

- Create a pricing intent.

<a id="before-you-begin"></a>
## Before you begin

[Authenticate your requests](/api/authentication) before making API calls. If your request fails, see [Errors](/api/errors).

<a id="create-a-pricing-intent"></a>
## Create a pricing intent

Send a POST request to our Pricing Intents endpoint:

| Environment | URL |
| --- | --- |
| Test | [https://api.uat.payroc.com/v1/pricing-intents](https://api.uat.payroc.com/v1/pricing-intents) |
| Production | [https://api.payroc.com/v1/pricing-intents](https://api.payroc.com/v1/pricing-intents) |

<a id="request-parameters"></a>
### Request parameters

To create the body of your request, use the following parameters:

<a id="schema-requestbody"></a>
### Schema (`request.body`)

[Request body schema for `POST /pricing-intents`](/api/create-pricing-intent)

<a id="example-request"></a>
### Example request

<a id="request"></a>
### Request

POST [https://api.payroc.com/v1/pricing-intents](https://api.payroc.com/v1/pricing-intents)

**`Created pricing intent`**

```curl
curl -X POST https://api.payroc.com/v1/pricing-intents \
     -H "Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324" \
     -H "Authorization: Bearer <token>"
```

**`Created pricing intent`**

```python
import requests

url = "https://api.payroc.com/v1/pricing-intents"

headers = {
    "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
    "Authorization": "Bearer <token>"
}

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

print(response.json())
```

**`Created pricing intent`**

```javascript
const url = 'https://api.payroc.com/v1/pricing-intents';
const options = {
  method: 'POST',
  headers: {
    'Idempotency-Key': '8e03978e-40d5-43e8-bc93-6894a57f9324',
    Authorization: 'Bearer <token>'
  }
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**`Created pricing intent`**

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.payroc.com/v1/pricing-intents"

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

	req.Header.Add("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

**`Created pricing intent`**

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.payroc.com/v1/pricing-intents")

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

request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '8e03978e-40d5-43e8-bc93-6894a57f9324'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

**`Created pricing intent`**

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.payroc.com/v1/pricing-intents")
  .header("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324")
  .header("Authorization", "Bearer <token>")
  .asString();
```

**`Created pricing intent`**

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.payroc.com/v1/pricing-intents', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Idempotency-Key' => '8e03978e-40d5-43e8-bc93-6894a57f9324',
  ],
]);

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

**`Created pricing intent`**

```csharp
using RestSharp;

var client = new RestClient("https://api.payroc.com/v1/pricing-intents");
var request = new RestRequest(Method.POST);
request.AddHeader("Idempotency-Key", "8e03978e-40d5-43e8-bc93-6894a57f9324");
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

**`Created pricing intent`**

```swift
import Foundation

let headers = [
  "Idempotency-Key": "8e03978e-40d5-43e8-bc93-6894a57f9324",
  "Authorization": "Bearer <token>"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.payroc.com/v1/pricing-intents")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

<a id="response-fields"></a>
### Response fields

If your request is successful, our gateway creates the pricing intent. The response contains the following fields:

<a id="schema-responsebody"></a>
### Schema (`response.body`)

[Response body schema for `POST /pricing-intents`](/api/create-pricing-intent)

<a id="example-response"></a>
### Example response

<a id="response-201"></a>
### Response (201)

```json
{
  "base": {
    "addressVerification": 5,
    "annualFee": {
      "amount": 100,
      "billInMonth": "june"
    },
    "batch": 1000,
    "chargeback": 2500,
    "earlyTermination": 57500,
    "maintenance": 500,
    "minimum": 100,
    "pciNonCompliance": 4995,
    "platinumSecurity": {
      "amount": 1295,
      "billingFrequency": "monthly"
    },
    "regulatoryAssistanceProgram": 15,
    "retrieval": 1500,
    "voiceAuthorization": 95
  },
  "country": "US",
  "createdDate": "2024-07-02T09:00:00Z",
  "gateway": {
    "fees": {
      "monthly": 2000,
      "perDeviceMonthly": 10,
      "perTransaction": 2000,
      "setup": 5000
    }
  },
  "id": "5",
  "key": "Your-Unique-Identifier",
  "lastUpdatedDate": "2024-07-02T09:00:00Z",
  "metadata": {
    "yourCustomField": "abc123"
  },
  "processor": {
    "ach": {
      "fees": {
        "accountVerification": 100,
        "batch": 1000,
        "discountRateAbove10000": 10,
        "discountRateUnder10000": 5.25,
        "monthlyMinimum": 20000,
        "returns": 400,
        "statement": 800,
        "transaction": 50,
        "unauthorizedReturn": 1999
      }
    },
    "card": {
      "fees": {
        "amex": {
          "transaction": 5,
          "type": "optBlue",
          "volume": 1.25
        },
        "electronicBenefitsTransfer": {
          "transaction": 10
        },
        "mastercardVisaDiscover": {
          "transaction": 5,
          "volume": 1.25
        },
        "pinDebit": {
          "additionalDiscount": 1.25,
          "monthlyAccess": 1200,
          "transaction": 10
        },
        "specialityCards": {
          "transaction": 10
        }
      },
      "planType": "interchangePlus"
    }
  },
  "services": [
    {
      "enabled": true,
      "name": "hardwareAdvantagePlan"
    }
  ],
  "status": "pendingReview",
  "version": "5.2"
}
```
