Create Rule

Overview

This route will allow user to create Rule for PlastiqPay. Once a rule is created for a buyer, the rule can only be updated with criterias. Only one rule can be created for a buyer.

Resource Access

POST https://<hostname>/buyer/v1/buyer/<buyerID>/rule

Arguments

The requested criteria can be a combination of one or more of the following fields:

FieldSub-fieldAdditional Information
typeMandatory
criteriaMandatory
ruleTypeMandatory
supplierIdsOptional
ConditionMandatory
amountFromOptional
amountToOptional

Example Request

🚧

POST https://<hostname>/buyer/v1/buyer/146aa943-23c7-57ef-9757-66ee5c97d704/rule


{
 "type" : "PLASTIQ_ROUTING_RULE",
 "criteria": [
   {
       "ruleType": "CHK",
       "condition": "between",
       "amountTo": 200,
       "amountFrom": 100
   }
 ]
}


Example for Response


{
   "data": {
       "type": "PLASTIQ_ROUTING_RULE",
       "entityId": "82787b9f-6a7a-5105-9786-33b6ec632812",
       "ruleLevel": "buyer",
       "criteria": [
           {
               "ruleType": "ACH",
               "condition": "between",
               "amountTo": 200,
               "amountFrom": 100,
               "supplierIds": [
                   "2109e8a2-6b8d-593c-a0e1-021f43852b8e"
               ],
               "id": "99dce675-fb23-5a46-94a7-a51c41b9cb2a"
           }
       ],
       "acl": [
           "pps:cpx-acquiring",
           "buyer:82787b9f-6a7a-5105-9786-33b6ec632812",
           "institution:0df2d073-64d5-58e2-96ee-4770201facb7",
           "network:45cf4f64-e4f2-5a7e-9344-fbd400d77133"
       ],
       "id": "01e65152-64b2-5818-9f8b-3be9acb7ffe6",
       "modifier": {
           "id": "404b861c-74df-5e29-b70c-5e9c13c09984",
           "username": "john.doe"
       },
       "format": "2.3",
       "timestamp": "2024-08-26T09:18:19.344Z",
       "changes": {
           "type": "PLASTIQ_ROUTING_RULE",
           "entityId": "82787b9f-6a7a-5105-9786-33b6ec632812",
           "ruleLevel": "buyer",
           "criteria": [
               {
                   "ruleType": "ACH",
                   "condition": "between",
                   "amountTo": 200,
                   "amountFrom": 100,
                   "supplierIds": [
                       "2109e8a2-6b8d-593c-a0e1-021f43852b8e"
                   ],
                   "id": "99dce675-fb23-5a46-94a7-a51c41b9cb2a"
               }
           ],
           "acl": [
               "pps:cpx-acquiring",
               "buyer:82787b9f-6a7a-5105-9786-33b6ec632812",
               "institution:0df2d073-64d5-58e2-96ee-4770201facb7",
               "network:45cf4f64-e4f2-5a7e-9344-fbd400d77133"
           ],
           "id": "01e65152-64b2-5818-9f8b-3be9acb7ffe6"
       },
       "originator": "cpx-enterprise",
       "originInfo": {
           "hostname": "cpx-enterprise-api-buyer-55b78475cc-ggfvr",
           "versionInfo": {
               "name": "CPX BUYER API",
               "build": "1.126.2177"
           },
           "packageInfo": {
               "name": "cpx-api-buyer",
               "version": "1.0.0"
           },
           "requestId": "d7f61356-29ce-4e40-b015-1580b289d677"
       },
       "overwrite": true,
       "entityKey": "Rule",
       "environment": "aws-nv-cpxqa",
       "consistency": {
           "messageId": "c4696201-c573-5d7a-9da5-ab30645b480a",
           "timestamp": "2024-08-26T09:18:19.353Z"
       }
   }
}



Priority Technology Holdings Logo