POST

Create Payment

Creates a new payment.

Important

Calls to this method must include the cookie .LawPanel.AuthCookie in order to identify you at user level. For more details about authentication please check this link. To obtain the cookie you can use the method Login.

Request URL

Request headers

string
Subscription key which provides access to this API.

Request body

Payload must contain information about the Payment to be created.

  • string Required invoice_id: The Invoice ID for the Payment. To get a list of Invoices available please check this link.
  • string Optional payment_provider_id: The Payment Provider ID for the Payment. If you leave it as null the default Payment Provider will be selected. To get a list of Payment Providers available please check this link.
  • string Required payment_method_id: The Payment Method ID for the Payment. To get a list of Payment Methods available please check this link.
  • array Required payment_method_components: The components for the Payment Method selected. You can get the list of them, checking the Payment Method on details on this link.
  • bool Required capture: If this property is true the Payment will be captured at the Payment Provider. Else, it will be only authorized.
  • bool Required save_current_payment_method_data: If this property is true the Payment Method will be associated with the Company on the Invoice and saved on the Payment Provider vault.
  • bool Required impact_on_payment_provider: If this property is true the Payment will be executed on the Payment Provider, else it will be recorded only on LawPanel.

Loading...
                  {
  "type": "object",
  "properties": {
    "invoice_id": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "payment_provider_id": {
      "type": "string"
    },
    "payment_method_id": {
      "type": "string"
    },
    "payment_method_components": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "value"
        ]
      }
    },
    "currency_units": {
      "type": "string"
    },
    "capture": {
      "type": "boolean"
    },
    "save_current_payment_method_data": {
      "type": "boolean"
    },
    "impact_on_payment_provider": {
      "type": "boolean"
    }
  },
  "example": {
    "invoice_id": "ab88a885-f937-4ce8-9f5d-ac3100f0cb9e",
    "description": "A little description for the payment. This is a sample of a payment created with a credit card.",
    "payment_provider_id": "b9fcbbd8-f584-4e44-bf28-a7cc00ffed97",
    "payment_method_id": "9fca11c1-bad6-4a14-bd96-a7cc00ffbdf4",
    "payment_method_components": [
      {
        "name": "payment_provider_token",
        "value": "tok_1HPug6BekBiB2yVLoh0mrG66"
      },
      {
        "name": "card_name",
        "value": "Johann Sebastian Bach"
      },
      {
        "name": "address_line_one",
        "value": "Frauenplan 21"
      },
      {
        "name": "address_line_two",
        "value": ""
      },
      {
        "name": "address_city",
        "value": "Eisenach"
      },
      {
        "name": "address_state",
        "value": "Thuringia"
      },
      {
        "name": "address_zip",
        "value": ""
      },
      {
        "name": "address_country",
        "value": "Germany"
      },
      {
        "name": "observations",
        "value": ""
      }
    ],
    "currency_units": "11.00",
    "capture": true,
    "save_current_payment_method_data": true,
    "impact_on_payment_provider": true
  }
}
                  
              

Response 201

This code is returned if the Payment was created successfully.

Loading...
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "date_time": {
      "type": "string"
    },
    "payment_provider": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "implementation": {
          "type": "string"
        },
        "is_default": {
          "type": "boolean"
        }
      }
    },
    "payment_method": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "code": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "payment_method_component_definitions": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "class_name": {
                "type": "string"
              },
              "pattern": {
                "type": "string"
              },
              "mask": {},
              "required": {
                "type": "boolean"
              },
              "select_from": {},
              "disabled": {
                "type": "boolean"
              },
              "max": {},
              "max_length": {
                "type": "integer"
              },
              "min": {},
              "read_only": {
                "type": "boolean"
              },
              "step": {},
              "place_holder": {},
              "private": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "display_order": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "display_name",
              "class_name",
              "pattern",
              "mask",
              "required",
              "select_from",
              "disabled",
              "max",
              "max_length",
              "min",
              "read_only",
              "step",
              "place_holder",
              "private",
              "internal",
              "display_order"
            ]
          }
        },
        "reusable": {
          "type": "boolean"
        }
      }
    },
    "payment_method_details": {
      "type": "string"
    },
    "payment_method_component_instances": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "payment_method_component_definition": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "display_name": {
                "type": "string"
              },
              "class_name": {
                "type": "string"
              },
              "pattern": {
                "type": "string"
              },
              "mask": {},
              "required": {
                "type": "boolean"
              },
              "select_from": {},
              "disabled": {
                "type": "boolean"
              },
              "max": {},
              "max_length": {
                "type": "integer"
              },
              "min": {},
              "read_only": {
                "type": "boolean"
              },
              "step": {},
              "place_holder": {},
              "private": {
                "type": "boolean"
              },
              "internal": {
                "type": "boolean"
              },
              "display_order": {
                "type": "integer"
              }
            }
          },
          "value": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "payment_method_component_definition",
          "value"
        ]
      }
    },
    "payment_status": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "code": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        }
      }
    },
    "currency": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "name_short": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        }
      }
    },
    "currency_units": {
      "type": "integer"
    },
    "payment_status_payment_transaction_types": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "payment_status": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "payment_transaction_type": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "payment_method_type": {
            "type": "string"
          },
          "payment_amount": {}
        },
        "required": [
          "id",
          "payment_status",
          "payment_transaction_type",
          "payment_method_type",
          "payment_amount"
        ]
      }
    },
    "payment_transactions": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "payment_id": {
            "type": "string"
          },
          "date_time": {
            "type": "integer"
          },
          "payment_transaction_status": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "payment_transaction_type": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "code": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "description": {
                "type": "string"
              }
            }
          },
          "response": {
            "type": "string"
          },
          "notes": {},
          "payment_provider_transaction_id": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "payment_id",
          "date_time",
          "payment_transaction_status",
          "payment_transaction_type",
          "response",
          "notes",
          "payment_provider_transaction_id",
          "amount"
        ]
      }
    },
    "payment_provider_entity_id": {
      "type": "string"
    }
  }
}
* See getting started for more information on how to use this API. You can also check the API change history.